From e2e5289788fee14886d531d48d8292992ad8ff95 Mon Sep 17 00:00:00 2001 From: Hat Kid <6624576+Hat-Kid@users.noreply.github.com> Date: Sun, 28 Apr 2024 14:59:46 +0200 Subject: [PATCH] decomp3: font widescreen and shadow hacks, generic renderer, misc files (#3483) - `pecker-ingame` - `des-bbush-tasks` - `des-burning-bush` - `des-bush-part` - `des-bush` - `mh-centipede` - `mh-centipede-part` - `mh-wasp` - `mh-wasp-part` - `needle-fish` - `des-bush-time-chase` - `timer-path` - `mission-squad-control-h` - `mh-bat` - `hover-nav-factoryd` - `hover-nav-factoryc` - `conveyor` - `fac-part` - `factory-part` - `factoryc-mood` - `factoryc-obs` - `factoryc-obs2` - `lfaccar-init` - `factory-boss-part` - `factory-boss-scenes` - `factory-boss-setup` - `factory-boss-states` - `factory-mood` - `factoryc-manager` - `lfacrm1-mood` - `lfacrm2-mood` - `missile-bot` - `sew-laser-turret` - `ai-task-h` - `ash-h` - `ash-shot` - `ash-states` - `ash-task` - `ash` - `bot-h` - `bot-states` - `bot` - `ash-oasis-course` - `oasis-defense` - `comb-field` - `comb-mood` - `comb-obs` - `comb-part` - `comb-scenes` - `comb-sentry` - `comb-travel` - `comba-init` - `combx-scenes` - `h-sled` - `destroy-dark-eco` - `fac-gunturret` - `fac-robotank-turret` - `fac-robotank` - `fac-tower` - `factory-h` - `factory-hud` - `factory-manager` - `factorya-init` - `ffight-projectile` - `ftank-projectile` - `fturret-projectile` - `h-warf` - `warf-projectile` --- decompiler/config/jak3/all-types.gc | 3912 ++++++++--------- .../ntsc_v1/anonymous_function_types.jsonc | 81 + decompiler/config/jak3/ntsc_v1/art_info.jsonc | 5 +- decompiler/config/jak3/ntsc_v1/hacks.jsonc | 29 +- decompiler/config/jak3/ntsc_v1/inputs.jsonc | 82 +- .../config/jak3/ntsc_v1/label_types.jsonc | 160 + .../jak3/ntsc_v1/stack_structures.jsonc | 210 +- .../config/jak3/ntsc_v1/type_casts.jsonc | 572 ++- .../config/jak3/ntsc_v1/var_names.jsonc | 18 + decompiler/util/DecompilerTypeSystem.cpp | 2 +- decompiler/util/data_decompile.cpp | 11 + game/CMakeLists.txt | 1 + .../opengl_renderer/OpenGLRenderer.cpp | 32 + .../foreground/Generic2_OpenGL.cpp | 2 +- game/mips2c/jak3_functions/font.cpp | 42 +- game/mips2c/jak3_functions/generic_merc.cpp | 3588 +++++++++++++++ game/mips2c/mips2c_table.cpp | 13 + goal_src/jak3/engine/anim/joint-mod-h.gc | 2 +- .../jak3/engine/collide/collide-edge-grab.gc | 2 +- .../jak3/engine/common-obs/particle-curves.gc | 1 + goal_src/jak3/engine/debug/debug.gc | 3 +- goal_src/jak3/engine/debug/menu.gc | 8 +- goal_src/jak3/engine/draw/drawable.gc | 2 +- goal_src/jak3/engine/entity/entity-table.gc | 4 +- goal_src/jak3/engine/game/game-h.gc | 3 +- goal_src/jak3/engine/game/main-h.gc | 34 +- .../jak3/engine/game/task/task-control-h.gc | 6 +- goal_src/jak3/engine/gfx/font.gc | 22 +- .../jak3/engine/gfx/generic/generic-merc.gc | 155 + .../jak3/engine/gfx/generic/generic-vu1.gc | 3 +- goal_src/jak3/engine/gfx/hw/video-h.gc | 5 + .../jak3/engine/gfx/texture/texture-anim-h.gc | 3 +- goal_src/jak3/engine/gfx/texture/texture.gc | 2 +- goal_src/jak3/engine/gfx/warp.gc | 27 + goal_src/jak3/engine/math/matrix-compose.gc | 6 +- goal_src/jak3/engine/physics/trajectory.gc | 2 +- .../process-drawable/process-drawable.gc | 2 +- .../process-drawable/process-focusable.gc | 5 +- .../engine/process-drawable/simple-focus.gc | 48 + .../jak3/engine/target/board/target-board.gc | 2 +- .../jak3/engine/target/gun/gun-dark-shot.gc | 9 +- .../jak3/engine/target/gun/gun-yellow-shot.gc | 36 +- goal_src/jak3/engine/target/target-darkjak.gc | 2 +- goal_src/jak3/engine/target/target-gun.gc | 2 +- goal_src/jak3/engine/target/target-h.gc | 1 + .../jak3/engine/target/target-lightjak.gc | 2 +- goal_src/jak3/game.gp | 104 +- .../levels/city/traffic/vehicle/vehicle-h.gc | 2 +- .../levels/city/traffic/vehicle/vehicle.gc | 2 +- goal_src/jak3/levels/comb/comb-field.gc | 342 ++ goal_src/jak3/levels/comb/comb-mood.gc | 282 ++ goal_src/jak3/levels/comb/comb-obs.gc | 1148 +++++ goal_src/jak3/levels/comb/comb-part.gc | 1017 +++++ goal_src/jak3/levels/comb/comb-scenes.gc | 914 ++++ goal_src/jak3/levels/comb/comb-sentry.gc | 738 ++++ goal_src/jak3/levels/comb/comb-travel.gc | 314 ++ goal_src/jak3/levels/comb/comba-init.gc | 36 + goal_src/jak3/levels/comb/combx-scenes.gc | 103 + goal_src/jak3/levels/comb/h-sled.gc | 1934 ++++++++ .../jak3/levels/comb/pecker/pecker-ingame.gc | 118 + goal_src/jak3/levels/comb/railx-mood.gc | 146 + goal_src/jak3/levels/comb/railx-obs.gc | 587 +++ goal_src/jak3/levels/comb/railx-scenes.gc | 2200 +++++++++ goal_src/jak3/levels/common/ai/ai-task-h.gc | 240 + .../jak3/levels/common/ai/ashelin/ash-h.gc | 68 + .../jak3/levels/common/ai/ashelin/ash-shot.gc | 452 ++ .../levels/common/ai/ashelin/ash-states.gc | 1072 +++++ .../jak3/levels/common/ai/ashelin/ash-task.gc | 73 + goal_src/jak3/levels/common/ai/ashelin/ash.gc | 1427 ++++++ goal_src/jak3/levels/common/ai/bot-h.gc | 727 +++ goal_src/jak3/levels/common/ai/bot-states.gc | 290 ++ goal_src/jak3/levels/common/ai/bot.gc | 1916 ++++++++ .../common/enemy/hover/hover-nav-control-h.gc | 2 +- .../common/enemy/hover/hover-nav-control.gc | 6 +- .../jak3/levels/desert/des-bbush-tasks.gc | 758 ++++ .../jak3/levels/desert/des-burning-bush.gc | 1619 +++++++ goal_src/jak3/levels/desert/des-bush-part.gc | 555 +++ goal_src/jak3/levels/desert/des-bush.gc | 2428 ++++++++++ .../levels/desert/oasis/ash-oasis-course.gc | 472 ++ .../jak3/levels/desert/oasis/oasis-defense.gc | 804 ++++ .../desert/wvehicle/was-squad-control.gc | 2 - .../desert/wvehicle/wvehicle-effects.gc | 4 +- .../jak3/levels/desert/wvehicle/wvehicle-h.gc | 17 +- .../desert/wvehicle/wvehicle-physics.gc | 113 +- goal_src/jak3/levels/factory/car/hvehicle.gc | 2 +- .../jak3/levels/factory/car/lfaccar-init.gc | 18 + goal_src/jak3/levels/factory/conveyor.gc | 375 ++ goal_src/jak3/levels/factory/fac-gunturret.gc | 1034 +++++ goal_src/jak3/levels/factory/fac-part.gc | 2383 ++++++++++ .../levels/factory/fac-robotank-turret.gc | 898 ++++ goal_src/jak3/levels/factory/fac-robotank.gc | 889 ++++ goal_src/jak3/levels/factory/fac-tower.gc | 1015 +++++ .../jak3/levels/factory/factory-boss-part.gc | 1216 +++++ .../levels/factory/factory-boss-scenes.gc | 2140 +++++++++ .../jak3/levels/factory/factory-boss-setup.gc | 2161 +++++++++ .../levels/factory/factory-boss-states.gc | 1825 ++++++++ goal_src/jak3/levels/factory/factory-h.gc | 181 + goal_src/jak3/levels/factory/factory-hud.gc | 44 + .../jak3/levels/factory/factory-manager.gc | 1899 ++++++++ goal_src/jak3/levels/factory/factory-mood.gc | 88 + goal_src/jak3/levels/factory/factory-part.gc | 765 ++++ .../jak3/levels/factory/factory-scenes.gc | 1535 +++++++ goal_src/jak3/levels/factory/factorya-init.gc | 23 + goal_src/jak3/levels/factory/factoryb-init.gc | 15 + .../jak3/levels/factory/factoryc-manager.gc | 145 + goal_src/jak3/levels/factory/factoryc-mood.gc | 48 + goal_src/jak3/levels/factory/factoryc-obs.gc | 1210 +++++ goal_src/jak3/levels/factory/factoryc-obs2.gc | 1774 ++++++++ .../jak3/levels/factory/ffight-projectile.gc | 702 +++ .../jak3/levels/factory/ftank-projectile.gc | 609 +++ .../jak3/levels/factory/fturret-projectile.gc | 692 +++ goal_src/jak3/levels/factory/h-warf.gc | 1824 ++++++++ .../jak3/levels/factory/hover-nav-factoryc.gc | 398 ++ .../jak3/levels/factory/hover-nav-factoryd.gc | 50 + goal_src/jak3/levels/factory/lfacrm1-mood.gc | 159 + goal_src/jak3/levels/factory/lfacrm2-mood.gc | 202 + goal_src/jak3/levels/factory/missile-bot.gc | 1295 ++++++ .../jak3/levels/factory/warf-projectile.gc | 1461 ++++++ goal_src/jak3/levels/forest/for-turret.gc | 3 +- goal_src/jak3/levels/forest/neo-spawner.gc | 16 +- .../jak3/levels/mhcity/destroy-dark-eco.gc | 1402 ++++++ goal_src/jak3/levels/nest/mh-bat.gc | 1828 ++++++++ .../jak3/levels/nest/mh-centipede-part.gc | 1515 +++++++ goal_src/jak3/levels/nest/mh-centipede.gc | 3436 +++++++++++++++ goal_src/jak3/levels/sewer/mh-wasp-part.gc | 510 +++ goal_src/jak3/levels/sewer/mh-wasp.gc | 1308 ++++++ goal_src/jak3/levels/sewer/needle-fish.gc | 722 +++ .../jak3/levels/sewer/sew-laser-turret.gc | 1204 +++++ goal_src/jak3/levels/sewer/sewer-obs.gc | 2 +- goal_src/jak3/levels/temple/temple-obs.gc | 2 +- goal_src/jak3/levels/tower/tower-obs.gc | 2 +- .../wascity/bbush/des-bush-time-chase.gc | 1827 ++++++++ .../jak3/levels/wascity/bbush/timer-path.gc | 610 +++ .../levels/wascity/mission-squad-control-h.gc | 113 + .../jak3/engine/anim/joint-mod-h_REF.gc | 2 +- .../engine/collide/collide-edge-grab_REF.gc | 6 +- .../reference/jak3/engine/game/game-h_REF.gc | 3 +- .../engine/gfx/texture/texture-anim-h_REF.gc | 3 +- .../jak3/engine/math/matrix-compose_REF.gc | 6 +- .../jak3/engine/physics/trajectory_REF.gc | 2 +- .../process-drawable/process-drawable_REF.gc | 2 +- .../process-drawable/process-focusable_REF.gc | 5 +- .../process-drawable/simple-focus_REF.gc | 73 + .../engine/target/board/target-board_REF.gc | 2 +- .../engine/target/gun/gun-dark-shot_REF.gc | 9 +- .../engine/target/gun/gun-yellow-shot_REF.gc | 36 +- .../jak3/engine/target/target-darkjak_REF.gc | 2 +- .../jak3/engine/target/target-gun_REF.gc | 2 +- .../jak3/engine/target/target-h_REF.gc | 1 + .../jak3/engine/target/target-lightjak_REF.gc | 2 +- .../city/traffic/vehicle/vehicle-h_REF.gc | 2 +- .../city/traffic/vehicle/vehicle_REF.gc | 6 +- .../jak3/levels/comb/comb-field_REF.gc | 383 ++ .../jak3/levels/comb/comb-mood_REF.gc | 308 ++ .../jak3/levels/comb/comb-obs_REF.gc | 1346 ++++++ .../jak3/levels/comb/comb-part_REF.gc | 1096 +++++ .../jak3/levels/comb/comb-scenes_REF.gc | 959 ++++ .../jak3/levels/comb/comb-sentry_REF.gc | 846 ++++ .../jak3/levels/comb/comb-travel_REF.gc | 388 ++ .../jak3/levels/comb/comba-init_REF.gc | 49 + .../jak3/levels/comb/combx-scenes_REF.gc | 112 + .../reference/jak3/levels/comb/h-sled_REF.gc | 2143 +++++++++ .../levels/comb/pecker/pecker-ingame_REF.gc | 145 + .../jak3/levels/comb/railx-mood_REF.gc | 178 + .../jak3/levels/comb/railx-obs_REF.gc | 651 +++ .../jak3/levels/comb/railx-scenes_REF.gc | 2303 ++++++++++ .../jak3/levels/common/ai/ai-task-h_REF.gc | 306 ++ .../levels/common/ai/ashelin/ash-h_REF.gc | 157 + .../levels/common/ai/ashelin/ash-shot_REF.gc | 505 +++ .../common/ai/ashelin/ash-states_REF.gc | 1090 +++++ .../levels/common/ai/ashelin/ash-task_REF.gc | 85 + .../jak3/levels/common/ai/ashelin/ash_REF.gc | 1510 +++++++ .../jak3/levels/common/ai/bot-h_REF.gc | 882 ++++ .../jak3/levels/common/ai/bot-states_REF.gc | 302 ++ .../jak3/levels/common/ai/bot_REF.gc | 1999 +++++++++ .../enemy/hover/hover-nav-control-h_REF.gc | 2 +- .../enemy/hover/hover-nav-control_REF.gc | 2 +- .../jak3/levels/desert/des-bbush-tasks_REF.gc | 997 +++++ .../levels/desert/des-burning-bush_REF.gc | 1756 ++++++++ .../jak3/levels/desert/des-bush-part_REF.gc | 598 +++ .../jak3/levels/desert/des-bush_REF.gc | 3231 ++++++++++++++ .../desert/oasis/ash-oasis-course_REF.gc | 513 +++ .../levels/desert/oasis/oasis-defense_REF.gc | 911 ++++ .../desert/wvehicle/was-squad-control_REF.gc | 6 - .../levels/desert/wvehicle/wvehicle-h_REF.gc | 18 +- .../desert/wvehicle/wvehicle-physics_REF.gc | 117 +- .../jak3/levels/factory/car/hvehicle_REF.gc | 6 +- .../levels/factory/car/lfaccar-init_REF.gc | 29 + .../jak3/levels/factory/conveyor_REF.gc | 445 ++ .../jak3/levels/factory/fac-gunturret_REF.gc | 1157 +++++ .../jak3/levels/factory/fac-part_REF.gc | 2564 +++++++++++ .../levels/factory/fac-robotank-turret_REF.gc | 1132 +++++ .../jak3/levels/factory/fac-robotank_REF.gc | 1022 +++++ .../jak3/levels/factory/fac-tower_REF.gc | 1093 +++++ .../levels/factory/factory-boss-part_REF.gc | 1318 ++++++ .../levels/factory/factory-boss-scenes_REF.gc | 2204 ++++++++++ .../levels/factory/factory-boss-setup_REF.gc | 2490 +++++++++++ .../levels/factory/factory-boss-states_REF.gc | 1866 ++++++++ .../jak3/levels/factory/factory-h_REF.gc | 369 ++ .../jak3/levels/factory/factory-hud_REF.gc | 57 + .../levels/factory/factory-manager_REF.gc | 2069 +++++++++ .../jak3/levels/factory/factory-mood_REF.gc | 126 + .../jak3/levels/factory/factory-part_REF.gc | 840 ++++ .../jak3/levels/factory/factory-scenes_REF.gc | 1587 +++++++ .../jak3/levels/factory/factorya-init_REF.gc | 36 + .../jak3/levels/factory/factoryb-init_REF.gc | 22 + .../levels/factory/factoryc-manager_REF.gc | 175 + .../jak3/levels/factory/factoryc-mood_REF.gc | 71 + .../jak3/levels/factory/factoryc-obs2_REF.gc | 2153 +++++++++ .../jak3/levels/factory/factoryc-obs_REF.gc | 1369 ++++++ .../levels/factory/ffight-projectile_REF.gc | 765 ++++ .../levels/factory/ftank-projectile_REF.gc | 674 +++ .../levels/factory/fturret-projectile_REF.gc | 761 ++++ .../jak3/levels/factory/h-warf_REF.gc | 1925 ++++++++ .../levels/factory/hover-nav-factoryc_REF.gc | 406 ++ .../levels/factory/hover-nav-factoryd_REF.gc | 58 + .../jak3/levels/factory/lfacrm1-mood_REF.gc | 202 + .../jak3/levels/factory/lfacrm2-mood_REF.gc | 244 + .../jak3/levels/factory/missile-bot_REF.gc | 1372 ++++++ .../levels/factory/warf-projectile_REF.gc | 1657 +++++++ .../jak3/levels/forest/neo-spawner_REF.gc | 20 +- .../levels/mhcity/destroy-dark-eco_REF.gc | 1649 +++++++ .../reference/jak3/levels/nest/mh-bat_REF.gc | 1931 ++++++++ .../jak3/levels/nest/mh-centipede-part_REF.gc | 1629 +++++++ .../jak3/levels/nest/mh-centipede_REF.gc | 3709 ++++++++++++++++ .../jak3/levels/sewer/mh-wasp-part_REF.gc | 550 +++ .../jak3/levels/sewer/mh-wasp_REF.gc | 1427 ++++++ .../jak3/levels/sewer/needle-fish_REF.gc | 840 ++++ .../jak3/levels/sewer/sew-laser-turret_REF.gc | 1319 ++++++ .../jak3/levels/sewer/sewer-obs_REF.gc | 6 +- .../jak3/levels/temple/temple-obs_REF.gc | 6 +- .../jak3/levels/tower/tower-obs_REF.gc | 2 +- .../wascity/bbush/des-bush-time-chase_REF.gc | 2124 +++++++++ .../levels/wascity/bbush/timer-path_REF.gc | 632 +++ .../wascity/mission-squad-control-h_REF.gc | 223 + test/offline/config/jak3/config.jsonc | 46 +- 236 files changed, 147764 insertions(+), 2437 deletions(-) create mode 100644 game/mips2c/jak3_functions/generic_merc.cpp create mode 100644 test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-scenes_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/comba-init_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/combx-scenes_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/comb/railx-scenes_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/ai-task-h_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-h_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-task_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/desert/des-bush-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/car/lfaccar-init_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/fac-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-boss-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-boss-scenes_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-h_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-hud_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-mood_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factory-scenes_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factorya-init_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factoryc-manager_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factoryc-mood_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/hover-nav-factoryc_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/hover-nav-factoryd_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/sewer/mh-wasp-part_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/wascity/bbush/timer-path_REF.gc create mode 100644 test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc diff --git a/decompiler/config/jak3/all-types.gc b/decompiler/config/jak3/all-types.gc index 83fd6170ea..9ee070274d 100644 --- a/decompiler/config/jak3/all-types.gc +++ b/decompiler/config/jak3/all-types.gc @@ -2275,7 +2275,7 @@ (define-extern matrix-u-r-compose (function matrix vector vector vector matrix)) (define-extern matrix-r-f-compose (function matrix vector vector vector matrix)) (define-extern matrix-r-u-compose (function matrix vector vector vector matrix)) -(define-extern matrix-f-compose (function matrix vector float matrix)) +(define-extern matrix-f-compose (function matrix vector matrix)) (define-extern matrix-u-compose (function matrix vector vector vector matrix)) (define-extern matrix-r-compose (function matrix vector vector vector matrix)) @@ -6789,7 +6789,8 @@ ) (deftype texture-anim-array (array) - () + ((array-data texture-anim :dynamic :offset-assert 16) + ) :method-count-assert 11 :size-assert #x10 :flag-assert #xb00000010 @@ -12081,23 +12082,23 @@ ;; +++main-h:bot-marks-controls (defenum bot-marks-controls :type int64 - ; (all-off 0) - ; (course-spots 1) - ; (task-spots 2) - ; (all-on 3) - ; (bmc04 4) - ; (bmc05 5) - ; (bmc06 6) - ; (bmc07 7) - ; (bmc08 8) - ; (bmc09 9) - ; (bmc10 10) - ; (bmc11 11) - ; (bmc12 12) - ; (bmc13 13) - ; (bmc14 14) - ; (bmc15 15) - ; (bmc16 16) + (all-off 0) + (course-spots 1) + (task-spots 2) + (all-on 3) + (bmc04 4) + (bmc05 5) + (bmc06 6) + (bmc07 7) + (bmc08 8) + (bmc09 9) + (bmc10 10) + (bmc11 11) + (bmc12 12) + (bmc13 13) + (bmc14 14) + (bmc15 15) + (bmc16 16) ) ;; ---main-h:bot-marks-controls @@ -19121,6 +19122,7 @@ The actual child classes will add most of the functionality, and this just serves as a common container for references to the `-control` objects for this object." ((self process-drawable :override) + (ppointer (pointer process-drawable) :override) (root trsqv :offset-assert 128) ;; guessed by decompiler (node-list cspace-array :offset-assert 132) ;; guessed by decompiler (draw draw-control :offset-assert 136) ;; guessed by decompiler @@ -21907,6 +21909,7 @@ (deftype process-focusable (process-drawable) ((self process-focusable :override) + (ppointer (pointer process-focusable) :override) (root collide-shape :override) (focus-status focus-status :offset-assert 200) ) @@ -22865,6 +22868,7 @@ (deftype target (process-focusable) ((self target :override) + (ppointer (pointer target) :override) (control control-info :offset 128 :score 1) ;; guessed by decompiler (fact fact-info-target :override) (skel2 joint-control :offset-assert 208) ;; guessed by decompiler @@ -30265,31 +30269,30 @@ ;; generic-merc ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype invinitdata (structure) ((count uint8 :offset-assert 0) (init-data uint8 :offset-assert 1) (init-addr uint16 :offset-assert 2) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -;; (define-extern mercneric-vu0-block object) ;; vu-function -;; (define-extern *inv-init-table* object) ;; (inline-array invinitdata) -;; (define-extern generic-merc-init-asm function) ;; (function none) +(define-extern mercneric-vu0-block vu-function) +(define-extern *inv-init-table* (inline-array invinitdata)) +(define-extern generic-merc-init-asm (function none)) ;; (define-extern mercneric-matrix-asm function) ;; (define-extern mercneric-shader-asm function) ;; (define-extern mercneric-bittable-asm function) ;; (define-extern mercneric-convert function) ;; (define-extern high-speed-reject function) -;; (define-extern generic-translucent function) ;; (function gsf-buffer none) +(define-extern generic-translucent (function gsf-buffer none)) ;; (define-extern generic-merc-query function) ;; (define-extern generic-merc-death function) ;; (define-extern generic-merc-execute-asm function) -;; (define-extern generic-merc-do-chain function) ;; (function mercneric-chain dma-buffer pointer) +(define-extern generic-merc-do-chain (function mercneric-chain dma-buffer pointer)) (define-extern generic-merc-execute-all (function dma-buffer none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -34555,6 +34558,7 @@ :bitfield #t (pcf0 0) (pcf1 1) + (pcf2 2) ) ;; ---particle-curves:particle-curve-flags @@ -42254,112 +42258,92 @@ ;; des-bush-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *bb-ring-alpha* object) -;; (define-extern spt-func-bb-ring-fader function) +(define-extern *bb-ring-alpha* int) +(define-extern spt-func-bb-ring-fader (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; des-bush ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-desert-bbush-ring (task-manager) - ((actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (current-ring int32 :offset-assert 244) + ((actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (current-ring int32 :offset-assert 248) ) :method-count-assert 34 :size-assert #xfc :flag-assert #x22008000fc (:methods - (task-manager-desert-bbush-ring-method-32 () none) ;; 32 - (task-manager-desert-bbush-ring-method-33 () none) ;; 33 - ) - (:state-methods - fail ;; 18 - active ;; 15 - resolution ;; 17 + (task-manager-desert-bbush-ring-method-32 (_type_) none) ;; 32 + (task-manager-desert-bbush-ring-method-33 (_type_) none) ;; 33 ) ) -|# -#| (deftype task-manager-desert-bbush-ring-2 (task-manager-desert-bbush-ring) () :method-count-assert 34 :size-assert #xfc :flag-assert #x22008000fc ) -|# -#| (deftype task-manager-desert-bbush-ring-3 (task-manager-desert-bbush-ring) () :method-count-assert 34 :size-assert #xfc :flag-assert #x22008000fc ) -|# -#| (deftype task-manager-desert-bbush-ring-4 (task-manager-desert-bbush-ring) () :method-count-assert 34 :size-assert #xfc :flag-assert #x22008000fc ) -|# -#| (deftype task-manager-desert-bbush-ring-5 (task-manager-desert-bbush-ring) () :method-count-assert 34 :size-assert #xfc :flag-assert #x22008000fc ) -|# -#| (deftype task-manager-desert-bbush-ring-6 (task-manager-desert-bbush-ring) () :method-count-assert 34 :size-assert #xfc :flag-assert #x22008000fc ) -|# -#| (deftype desert-chase-ring (process-drawable) ((mat matrix :inline :offset-assert 208) - (taskman uint64 :offset-assert 272) - (turbo-handle uint64 :offset-assert 280) - (alt-actor basic :offset-assert 288) + (taskman handle :offset-assert 272) + (turbo-handle handle :offset-assert 280) + (alt-actor entity-actor :offset-assert 288) (ring-radius float :offset-assert 292) (minimap connection-minimap :offset-assert 296) - (is-final? basic :offset-assert 300) - (part-final basic :offset-assert 304) + (is-final? symbol :offset-assert 300) + (part-final sparticle-launch-control :offset-assert 304) ) :method-count-assert 24 :size-assert #x134 :flag-assert #x1800c00134 - (:methods - (desert-chase-ring-method-23 () none) ;; 23 - ) (:state-methods - die ;; 22 - idle ;; 21 dormant ;; 20 + idle ;; 21 + die ;; 22 + ) + (:methods + (alloc-trsqv! (_type_) none) ;; 23 ) ) -|# -#| (deftype spirit (process-drawable) - ((part-subsampler basic :offset-assert 200) - (sound-id uint32 :offset-assert 204) - (sound-id-2 uint32 :offset-assert 208) - (play-pixie? basic :offset-assert 212) - (goal-part basic :offset-assert 216) - (draw-start-goal? basic :offset-assert 220) + ((part-subsampler sparticle-subsampler :offset-assert 200) + (sound-id sound-id :offset-assert 204) + (sound-id-2 sound-id :offset-assert 208) + (play-pixie? symbol :offset-assert 212) + (goal-part sparticle-launch-control :offset-assert 216) + (draw-start-goal? symbol :offset-assert 220) ) :method-count-assert 23 :size-assert #xe0 @@ -42370,189 +42354,167 @@ explode ;; 22 ) ) -|# -#| (deftype hud-spider-killed (hud-goal) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype task-manager-bbush-egg-spider (task-manager) - ((actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (goal-score uint32 :offset-assert 244) - (hud-score uint64 :offset-assert 252) - (hud-goal uint64 :offset-assert 260) + ((actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (goal-score uint32 :offset-assert 248) + (hud-score handle :offset-assert 256) + (hud-goal handle :offset-assert 264) ) :method-count-assert 33 :size-assert #x110 :flag-assert #x2100900110 (:methods - (task-manager-bbush-egg-spider-method-32 () none) ;; 32 - ) - (:state-methods - active ;; 15 - resolution ;; 17 + (task-manager-bbush-egg-spider-method-32 (_type_) none) ;; 32 ) ) -|# -#| (deftype task-manager-bbush-spirit-chase (task-manager) - ((actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (path-pos float :offset-assert 244) - (trans vector :inline :offset-assert 252) - (touched basic :offset-assert 268) - (spirit uint64 :offset-assert 276) - (current-curve-distance float :offset-assert 284) - (current-curve-length float :offset-assert 288) - (min-spirit-vel float :offset-assert 292) - (current-spirit-vel float :offset-assert 296) - (high-spirit-vel float :offset-assert 300) - (fail-radius float :offset-assert 304) - (chase-distance float :offset-assert 308) - (start-offset-vel float :offset-assert 312) - (sound-id uint32 :offset-assert 316) + ((actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (path-pos float :offset-assert 248) + (trans vector :inline :offset-assert 256) + (touched symbol :offset-assert 272) + (spirit handle :offset-assert 280) + (current-curve-distance float :offset-assert 288) + (current-curve-length float :offset-assert 292) + (min-spirit-vel float :offset-assert 296) + (current-spirit-vel float :offset-assert 300) + (high-spirit-vel float :offset-assert 304) + (fail-radius float :offset-assert 308) + (chase-distance float :offset-assert 312) + (start-offset-vel float :offset-assert 316) + (sound-id sound-id :offset-assert 320) ) :method-count-assert 36 :size-assert #x144 :flag-assert #x2400d00144 (:methods - (task-manager-bbush-spirit-chase-method-32 () none) ;; 32 - (task-manager-bbush-spirit-chase-method-33 () none) ;; 33 - (task-manager-bbush-spirit-chase-method-34 () none) ;; 34 - (task-manager-bbush-spirit-chase-method-35 () none) ;; 35 - ) - (:state-methods - active ;; 15 - resolution ;; 17 + (get-entity-name (_type_) string) ;; 32 + (task-manager-bbush-spirit-chase-method-33 (_type_) float) ;; 33 + (task-manager-bbush-spirit-chase-method-34 (_type_) float) ;; 34 + (set-sbanks (_type_) none) ;; 35 ) ) -|# -#| (deftype task-manager-bbush-spirit-chase-2 (task-manager-bbush-spirit-chase) () :method-count-assert 36 :size-assert #x144 :flag-assert #x2400d00144 ) -|# -#| (deftype task-manager-bbush-spirit-chase-3 (task-manager-bbush-spirit-chase) () :method-count-assert 36 :size-assert #x144 :flag-assert #x2400d00144 ) -|# -#| (deftype bb-score-a-pickup (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| (deftype bb-score-b-pickup (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| (deftype bb-score-c-pickup (process-hidden) () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 ) -|# -#| +;; +++des-bush:bb-score-type +(defenum bb-score-type + :type uint8 + (small) + (medium) + (large) + ) +;; ---des-bush:bb-score-type + (deftype score-drop (process-drawable) ((src vector :inline :offset-assert 208) (dst vector :inline :offset-assert 224) (pickup-radius float :offset-assert 240) (score uint32 :offset-assert 244) (score-pickup-radius float :offset-assert 248) - (bb-score-type uint8 :offset-assert 252) + (bb-score-type bb-score-type :offset-assert 252) (traj trajectory :inline :offset-assert 256) ) :method-count-assert 23 :size-assert #x128 :flag-assert #x1700b00128 (:state-methods - die ;; 22 idle ;; 20 dormant ;; 21 + die ;; 22 ) ) -|# -#| (deftype task-manager-bbush-spirit-drop (task-manager) - ((actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (path-pos float :offset-assert 244) - (trans vector :inline :offset-assert 252) - (touched basic :offset-assert 268) - (spirit uint64 :offset-assert 276) - (score-drop-handles UNKNOWN 64 :offset-assert 284) - (score-drop-num int32 :offset-assert 796) - (current-curve-distance float :offset-assert 800) - (current-curve-length float :offset-assert 804) - (goal-score uint32 :offset-assert 808) - (current-score uint32 :offset-assert 812) - (score-drop-activation-radius float :offset-assert 816) - (min-spirit-vel float :offset-assert 820) - (high-spirit-vel float :offset-assert 824) - (current-spirit-vel float :offset-assert 828) - (fail-radius float :offset-assert 832) - (hud-score uint64 :offset-assert 836) - (hud-goal uint64 :offset-assert 844) + ((actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (path-pos float :offset-assert 248) + (trans vector :inline :offset-assert 256) + (touched symbol :offset-assert 272) + (spirit handle :offset-assert 280) + (score-drop-handles handle 64 :offset-assert 288) + (score-drop-num int32 :offset-assert 800) + (current-curve-distance float :offset-assert 804) + (current-curve-length float :offset-assert 808) + (goal-score uint32 :offset-assert 812) + (current-score uint32 :offset-assert 816) + (score-drop-activation-radius float :offset-assert 820) + (min-spirit-vel float :offset-assert 824) + (high-spirit-vel float :offset-assert 828) + (current-spirit-vel float :offset-assert 832) + (fail-radius float :offset-assert 836) + (hud-score handle :offset-assert 840) + (hud-goal handle :offset-assert 848) ) :method-count-assert 39 :size-assert #x358 :flag-assert #x2702e00358 (:methods - (task-manager-bbush-spirit-drop-method-32 () none) ;; 32 - (task-manager-bbush-spirit-drop-method-33 () none) ;; 33 - (task-manager-bbush-spirit-drop-method-34 () none) ;; 34 - (task-manager-bbush-spirit-drop-method-35 () none) ;; 35 - (task-manager-bbush-spirit-drop-method-36 () none) ;; 36 - (task-manager-bbush-spirit-drop-method-37 () none) ;; 37 - (task-manager-bbush-spirit-drop-method-38 () none) ;; 38 - ) - (:state-methods - active ;; 15 - resolution ;; 17 + (get-entity-name (_type_) string) ;; 32 + (task-manager-bbush-spirit-drop-method-33 (_type_) float) ;; 33 + (task-manager-bbush-spirit-drop-method-34 (_type_) float) ;; 34 + (task-manager-bbush-spirit-drop-method-35 (_type_) int) ;; 35 + (send-trigger (_type_) symbol) ;; 36 + (spawn-drops (_type_) symbol) ;; 37 + (set-sbanks (_type_) none) ;; 38 ) ) -|# -;; (define-extern *tex-level-list* array) -;; (define-extern find-level-name function) -;; (define-extern set-ring-particle-texture function) -;; (define-extern *des-ring-times* array) -;; (define-extern *bb-fail* object) -;; (define-extern *bbush-ring-6-kg-squad-member-settings* object) -;; (define-extern desert-chase-ring-cleared? function) -;; (define-extern spirit-init-by-other function) -;; (define-extern bb-score-type->string function) -;; (define-extern score-drop-init-by-other function) +(declare-type squad-unit-settings structure) + +(define-extern *tex-level-list* (array symbol)) +(define-extern find-level-name (function level)) +(define-extern set-ring-particle-texture (function none)) +(define-extern *des-ring-times* (array (array float))) +(define-extern *bb-fail* resetter-params) +(define-extern *bbush-ring-6-kg-squad-member-settings* squad-unit-settings) +(define-extern desert-chase-ring-cleared? (function vector vector desert-chase-ring symbol)) +(define-extern spirit-init-by-other (function vector object :behavior spirit)) +(define-extern bb-score-type->string (function bb-score-type string)) +(define-extern score-drop-init-by-other (function entity-actor object :behavior score-drop)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; grunt ;; @@ -43047,7 +43009,7 @@ :flag-assert #x260000003c (:methods (new (symbol type) _type_) ;; 0 - (nav-network-method-9 (_type_ int int) none) ;; 9 + (alloc-nav-network-for-level! (_type_ int int) none) ;; 9 (init-by-other! (_type_ level nav-network-data) none) ;; 10 (nav-network-method-11 (_type_) none) ;; 11 (reset! (_type_) none) ;; 12 @@ -44166,69 +44128,62 @@ ;; des-burning-bush ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bbush-menu-item (structure) - ((text uint32 :offset-assert 0) - (node uint16 :offset-assert 4) + ((text text-id :offset-assert 0) + (node game-task-node :offset-assert 4) ) :method-count-assert 9 :size-assert #x6 :flag-assert #x900000006 ) -|# -#| (deftype bbush-menu (structure) - ((title-text uint32 :offset-assert 0) - (req-text uint32 :offset-assert 4) - (req-check basic :offset-assert 8) + ((title-text text-id :offset-assert 0) + (req-text text-id :offset-assert 4) + (req-check (function symbol) :offset-assert 8) (item-count int8 :offset-assert 12) - (items UNKNOWN 10 :offset-assert 16) + (items bbush-menu-item 10 :inline :offset-assert 16) ) :method-count-assert 9 :size-assert #xb0 :flag-assert #x9000000b0 ) -|# -#| (deftype des-burning-bush (process-focusable) - ((task basic :offset-assert 208) - (part-off basic :offset-assert 212) + ((task game-task-control :offset-assert 208) + (part-off sparticle-launch-control :offset-assert 212) (angle float :offset-assert 216) (time float :offset-assert 220) (rotmin float :offset-assert 224) (rotmax float :offset-assert 228) (bb-perm entity-perm :offset-assert 232) (menu bbush-menu :offset-assert 236) - (menu-node basic :offset-assert 240) - (menu-exit? basic :offset-assert 244) - (menu-have-req? basic :offset-assert 248) - (message-id uint32 :offset-assert 252) - (required-vehicles uint64 :offset-assert 256) + (menu-node game-task-node-info :offset-assert 240) + (menu-exit? symbol :offset-assert 244) + (menu-have-req? symbol :offset-assert 248) + (message-id text-id :offset-assert 252) + (required-vehicles game-vehicles :offset-assert 256) ) :method-count-assert 39 :size-assert #x108 :flag-assert #x2700900108 - (:methods - (des-burning-bush-method-32 () none) ;; 32 - (des-burning-bush-method-33 () none) ;; 33 - (des-burning-bush-method-34 () none) ;; 34 - (des-burning-bush-method-35 () none) ;; 35 - (des-burning-bush-method-36 () none) ;; 36 - (des-burning-bush-method-37 () none) ;; 37 - (des-burning-bush-method-38 () none) ;; 38 - ) (:state-methods - menu ;; 30 - talking ;; 29 - collect-gems ;; 31 idle ;; 28 + talking ;; 29 + menu ;; 30 + collect-gems ;; 31 + ) + (:methods + (des-burning-bush-method-32 (_type_) none) ;; 32 + (des-burning-bush-method-33 (_type_) none) ;; 33 + (des-burning-bush-method-34 (_type_) object) ;; 34 + (des-burning-bush-method-35 (_type_) none) ;; 35 + (des-burning-bush-method-36 (_type_) none) ;; 36 + (des-burning-bush-method-37 (_type_) none) ;; 37 + (des-burning-bush-method-38 (_type_) none) ;; 38 ) ) -|# -#| (deftype burning-bush-get-on-info (structure) ((trans vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) @@ -44241,45 +44196,62 @@ :size-assert #x5c :flag-assert #x90000005c ) -|# -#| +(deftype des-burning-bush-stack-var0 (structure) + ((mat matrix :inline :offset 0) + (vec0 vector :inline :offset 64) + (vec1 vector :inline :offset 128) + (vec2 vector :inline :offset 160) + (quat quaternion :inline :offset 176) + (vec3 vector :inline :offset 192) + ) + ) + +(deftype des-burning-bush-stack-var1 (structure) + ((word0 int32 :offset 0) + (fnt-origin-x int32 :offset 4) + (scale float :offset 8) + ) + ) + +;; added +(deftype bbush-menu-state (structure) + ((cur int8 :offset 0) + (idx int8 :offset 1) + (fnt-height int32 :offset 4) + (fnt-origin-x int32 :offset 8) + (fnt-origin-y int32 :offset 12) + ) + ) + (deftype task-manager-desert-bbush-get-to (task-manager) - ((skill uint64 :offset-assert 240) - (update-fov? basic :offset-assert 248) + ((skill handle :offset-assert 240) + (update-fov? symbol :offset-assert 248) ) :method-count-assert 33 :size-assert #xfc :flag-assert #x21008000fc (:methods - (task-manager-desert-bbush-get-to-method-32 () none) ;; 32 - ) - (:state-methods - active ;; 15 + (task-manager-desert-bbush-get-to-method-32 (_type_) none) ;; 32 ) ) -|# -#| (deftype wascity-burning-bush (des-burning-bush) () :method-count-assert 39 :size-assert #x108 :flag-assert #x2700900108 ) -|# -#| (deftype city-des-burning-bush (des-burning-bush) () :method-count-assert 39 :size-assert #x108 :flag-assert #x2700900108 ) -|# -;; (define-extern *bbush-menu* object) -;; (define-extern *burning-bush-get-on-info* array) ;; (array burning-bush-get-on-info) +(define-extern *bbush-menu* bbush-menu) +(define-extern *burning-bush-get-on-info* (array burning-bush-get-on-info)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctysluma-part ;; @@ -45615,7 +45587,6 @@ ;; needle-fish ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype needle-fish-shot (projectile-bounce) ((scale float :offset-assert 548) ) @@ -45623,22 +45594,18 @@ :size-assert #x228 :flag-assert #x2c01b00228 ) -|# -#| (deftype needle-fish-chain-physics (chain-physics) () :method-count-assert 18 :size-assert #x570 :flag-assert #x1200000570 ) -|# -#| (deftype needle-fish (nav-enemy) - ((scared-timer uint64 :offset-assert 624) - (tail basic :offset-assert 632) - (tail-initialized basic :offset-assert 636) + ((scared-timer time-frame :offset-assert 624) + (tail needle-fish-chain-physics :offset-assert 632) + (tail-initialized symbol :offset-assert 636) (tail-clock float :offset-assert 640) (tail-blend float :offset-assert 644) ) @@ -45646,31 +45613,28 @@ :size-assert #x288 :flag-assert #xc002100288 (:state-methods - hostile ;; 38 - stare ;; 37 - explode ;; 191 - notice ;; 35 - attack ;; 190 active ;; 34 + notice ;; 35 + stare ;; 37 + hostile ;; 38 + attack ;; 190 + explode ;; 191 ) ) -|# -#| (deftype sew-needle-fish (needle-fish) () :method-count-assert 192 :size-assert #x288 :flag-assert #xc002100288 ) -|# -;; (define-extern spawn-needle-fish-projectile function) -;; (define-extern *needle-fish-spike-tbl* array) -;; (define-extern *needle-fish-chain-setup* array) -;; (define-extern *fact-info-needle-fish-defaults* fact-info-enemy-defaults) -;; (define-extern *needle-fish-nav-enemy-info* nav-enemy-info) -;; (define-extern needle-fish-joint-mod-tail function) +(define-extern spawn-needle-fish-projectile (function needle-fish vector vector float (pointer needle-fish-shot))) +(define-extern *needle-fish-spike-tbl* (array int32)) +(define-extern *needle-fish-chain-setup* (array chain-physics-setup)) +(define-extern *fact-info-needle-fish-defaults* fact-info-enemy-defaults) +(define-extern *needle-fish-nav-enemy-info* nav-enemy-info) +(define-extern needle-fish-joint-mod-tail (function cspace transformq none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; sewer-frog ;; @@ -46048,25 +46012,22 @@ ;; mh-wasp ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mh-wasp-shot (metalhead-shot) () :method-count-assert 41 :size-assert #x210 :flag-assert #x2901900210 ) -|# -#| (deftype mh-wasp (hover-enemy) ((gun-jmod joint-mod-rotate-local :inline :offset-assert 976) - (entity-group basic :offset-assert 1008) - (smoke-part basic :offset-assert 1012) - (engine-part basic :offset-assert 1016) - (old-gravity float :offset-assert 1024) + (entity-group actor-group :offset-assert 1008) + (smoke-part sparticle-launch-control :offset-assert 1012) + (engine-part sparticle-launch-control :offset-assert 1016) + (old-gravity float :offset 1024) (knocked-anim int32 :offset-assert 1028) (knocked-recover-anim int32 :offset-assert 1032) - (last-fire-time uint64 :offset-assert 1040) + (last-fire-time time-frame :offset-assert 1040) (bridge-index int32 :offset-assert 1048) (gun-x-angle float :offset-assert 1052) (gun-x-angle-final float :offset-assert 1056) @@ -46074,7 +46035,7 @@ (path-du float :offset-assert 1064) (path-du-final float :offset-assert 1068) (path-dest float :offset-assert 1072) - (sound-id uint32 :offset-assert 1076) + (sound-id sound-id :offset-assert 1076) (attack-wait-min float :offset-assert 1080) (attack-wait-max float :offset-assert 1084) (attack-miss-dist-min float :offset-assert 1088) @@ -46084,44 +46045,40 @@ :method-count-assert 181 :size-assert #x44c :flag-assert #xb503d0044c - (:methods - (mh-wasp-method-180 () none) ;; 180 - ) (:state-methods - die-explode ;; 179 knocked-recover ;; 32 - hostile ;; 38 - die-now ;; 178 notice ;; 35 - attack ;; 177 + hostile ;; 38 ambush ;; 47 + attack ;; 177 + die-now ;; 178 + die-explode ;; 179 + ) + (:methods + (fire-shot (_type_ projectile-init-by-other-params int int float) none) ;; 180 ) ) -|# -;; (define-extern *mh-wasp-exploder-params* joint-exploder-static-params) -;; (define-extern *fact-info-mh-wasp-defaults* fact-info-enemy-defaults) -;; (define-extern *mh-wasp-enemy-info* enemy-info) +(define-extern *mh-wasp-exploder-params* joint-exploder-static-params) +(define-extern *fact-info-mh-wasp-defaults* fact-info-enemy-defaults) +(define-extern *mh-wasp-enemy-info* enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bombbot-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bombbot-node (structure) ((position vector :inline :offset-assert 0) (nav-mesh-id uint32 :offset-assert 16) - (pos-x float :offset-assert 0) - (pos-y float :offset-assert 4) - (pos-z float :offset-assert 8) + (pos-x float :offset 0) + (pos-y float :offset 4) + (pos-z float :offset 8) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype bombbot-path (structure) ((node-count uint16 :offset-assert 0) (node (inline-array bombbot-node) :offset-assert 4) ;; guessed by decompiler @@ -46130,56 +46087,49 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bombbot-path ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *bombbot-path-1* object) ;; bombbot-path -;; (define-extern *bombbot-path-2* object) ;; bombbot-path -;; (define-extern *bombbot-path-3* object) ;; bombbot-path +(define-extern *bombbot-path-1* bombbot-path) +(define-extern *bombbot-path-2* bombbot-path) +(define-extern *bombbot-path-3* bombbot-path) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bombbot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bombbot-hud (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype bombbot-bomb (process-focusable) - ((explode-part basic :offset-assert 208) + ((explode-part sparticle-launch-control :offset-assert 208) (rot-axis vector :inline :offset-assert 224) (rot-angle float :offset-assert 240) - (warning-glow-part basic :offset-assert 244) - (next-countdown-tick uint64 :offset-assert 248) - (fizzle-timer uint64 :offset-assert 256) + (warning-glow-part sparticle-launch-control :offset-assert 244) + (next-countdown-tick time-frame :offset-assert 248) + (fizzle-timer time-frame :offset-assert 256) ) :method-count-assert 34 :size-assert #x108 :flag-assert #x2200900108 - (:methods - (bombbot-bomb-method-32 () none) ;; 32 - (bombbot-bomb-method-33 () none) ;; 33 - ) (:state-methods idle ;; 28 smoke ;; 29 explode ;; 30 back ;; 31 ) + (:methods + (bombbot-bomb-method-32 (_type_) none) ;; 32 + (bombbot-bomb-method-33 (_type_) none) ;; 33 + ) ) -|# -#| (deftype bombbot-foot (structure) ((pos-offset vector :inline :offset-assert 0) (joint-index uint32 :offset-assert 16) @@ -46196,12 +46146,13 @@ :size-assert #x6c :flag-assert #x90000006c ) -|# -#| +(declare-type city-attacker-info structure) +(declare-type mission-squad-control structure) + (deftype bombbot (nav-enemy) ((joint-ik joint-mod-ik 4 :offset-assert 620) ;; guessed by decompiler - (feet bombbot-foot 4 :offset-assert 640) ;; guessed by decompiler + (feet bombbot-foot 4 :inline :offset-assert 640) ;; guessed by decompiler (legs-strength float 4 :offset-assert 1088) ;; guessed by decompiler (last-trans vector :inline :offset-assert 1104) (linear-speed vector :inline :offset-assert 1120) @@ -46214,11 +46165,11 @@ (city-path bombbot-path :offset-assert 1216) (current-node uint32 :offset-assert 1220) (shot-count uint32 :offset-assert 1224) - (next-shoot uint64 :offset-assert 1232) - (stop-shoot uint64 :offset-assert 1240) - (next-target uint64 :offset-assert 1248) - (start-target uint64 :offset-assert 1256) - (beep-time uint64 :offset-assert 1264) ;; time-frame + (next-shoot time-frame :offset-assert 1232) + (stop-shoot time-frame :offset-assert 1240) + (next-target time-frame :offset-assert 1248) + (start-target time-frame :offset-assert 1256) + (beep-time time-frame :offset-assert 1264) ;; time-frame (target-pos vector :inline :offset-assert 1280) (start-target-pos vector :inline :offset-assert 1296) (start-target-vel vector :inline :offset-assert 1312) @@ -46248,42 +46199,41 @@ (gun-type uint32 :offset-assert 1492) (drop-mask uint32 :offset-assert 1496) (attacker-info city-attacker-info :offset-assert 1500) - (mission-squad basic :offset-assert 1504) + (mission-squad mission-squad-control :offset-assert 1504) (max-hit-points float :offset-assert 1508) ) :method-count-assert 209 :size-assert #x5e8 :flag-assert #xd1057005e8 - (:methods - (bombbot-method-192 () none) ;; 192 - (bombbot-method-194 () none) ;; 194 - (bombbot-method-195 () none) ;; 195 - (bombbot-method-196 () none) ;; 196 - (bombbot-method-197 () none) ;; 197 - (bombbot-method-198 () none) ;; 198 - (bombbot-method-199 () none) ;; 199 - (bombbot-method-200 () none) ;; 200 - (bombbot-method-201 () none) ;; 201 - (bombbot-method-202 () none) ;; 202 - (bombbot-method-203 () none) ;; 203 - (bombbot-method-204 () none) ;; 204 - (bombbot-method-205 () none) ;; 205 - (bombbot-method-206 () none) ;; 206 - (bombbot-method-207 () none) ;; 207 - (bombbot-method-208 () none) ;; 208 - ) (:state-methods - explode ;; 190 - die ;; 40 - drop-bombs ;; 193 - hostile ;; 38 - blow-wall ;; 191 notice ;; 35 + hostile ;; 38 + die ;; 40 + explode ;; 190 + blow-wall ;; 191 + undefined ;; 192, not defined + drop-bombs ;; 193 + ) + (:methods + ; (bombbot-method-192 () none) ;; 192 + (bombbot-method-194 (_type_) none) ;; 194 + (bombbot-method-195 (_type_) none) ;; 195 + (bombbot-method-196 (_type_) none) ;; 196 + (bombbot-method-197 (_type_) none) ;; 197 + (bombbot-method-198 (_type_) none) ;; 198 + (bombbot-method-199 (_type_) none) ;; 199 + (bombbot-method-200 (_type_) none) ;; 200 + (bombbot-method-201 (_type_) none) ;; 201 + (bombbot-method-202 (_type_) none) ;; 202 + (bombbot-method-203 (_type_) none) ;; 203 + (bombbot-method-204 (_type_) none) ;; 204 + (bombbot-method-205 (_type_) none) ;; 205 + (bombbot-method-206 (_type_) none) ;; 206 + (bombbot-method-207 (_type_) none) ;; 207 + (bombbot-method-208 (_type_) none) ;; 208 ) ) -|# -#| (deftype bombbot-shot (guard-shot) () :method-count-assert 41 @@ -46293,9 +46243,7 @@ impact ;; 22 ) ) -|# -#| (deftype spring-setup (structure) ((bpos1 vector :offset-assert 0) (wpos2 vector :offset-assert 4) @@ -46304,13 +46252,11 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype bombbot-spawn-params (structure) ((position vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) - (nav-mesh basic :offset-assert 32) + (nav-mesh nav-mesh :offset-assert 32) (path bombbot-path :offset-assert 36) (first-node uint32 :offset-assert 40) (stop-offset float :offset-assert 44) @@ -46319,9 +46265,7 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype bomb-bot (bombbot) () :method-count-assert 209 @@ -46331,48 +46275,40 @@ hostile ;; 38 ) ) -|# -#| (deftype bombbot-player (bombbot) ((camera-x-angle float :offset-assert 1512) - (hold-fire basic :offset-assert 1516) - (hold-fire-time uint64 :offset-assert 1520) - (health-hud uint64 :offset-assert 1528) + (hold-fire symbol :offset-assert 1516) + (hold-fire-time time-frame :offset-assert 1520) + (health-hud handle :offset-assert 1528) ) :method-count-assert 210 :size-assert #x600 :flag-assert #xd205800600 (:state-methods - done ;; 209 - explode ;; 190 hostile ;; 38 + explode ;; 190 + done ;; 209 ) ) -|# -#| (deftype task-manager-blow-barricade (task-manager) - ((check-timer uint64 :offset-assert 236) - (bombbot-h uint64 :offset-assert 244) - (actor-group uint32 :offset-assert 252) - (actor-group-count int32 :offset-assert 256) - (done? int32 :offset-assert 260) - (minimap connection-minimap :offset-assert 264) - (wall-h uint64 :offset-assert 268) - (start-point vector :inline :offset-assert 284) + ((check-timer time-frame :offset-assert 240) + (bombbot-h handle :offset-assert 248) + (actor-group uint32 :offset-assert 256) + (actor-group-count int32 :offset-assert 260) + (done? int32 :offset-assert 264) + (minimap connection-minimap :offset-assert 268) + (wall-h handle :offset-assert 272) + (start-point vector :inline :offset-assert 288) ) :method-count-assert 33 :size-assert #x130 :flag-assert #x2100b00130 (:methods - (task-manager-blow-barricade-method-32 () none) ;; 32 - ) - (:state-methods - active ;; 15 + (task-manager-blow-barricade-method-32 (_type_) none) ;; 32 ) ) -|# #| (deftype task-manager-port-fight (task-manager) @@ -48457,20 +48393,30 @@ ;; mission-squad-control-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++mission-squad-control-h:city-attacker-info-flag +(defenum city-attacker-info-flag + :type uint16 + :bitfield #t + (cai0 0) + (cai1 1) + (cai2 2) + (cai3 3) + ) +;; ---mission-squad-control-h:city-attacker-info-flag + (deftype city-attacker-info (structure) - ((proc uint64 :offset-assert 0) - (enemy uint64 :offset-assert 8) - (next-update-target-time uint64 :offset-assert 16) - (flags uint16 :offset-assert 24) + ((proc handle :offset-assert 0) + (enemy handle :offset-assert 8) + (next-update-target-time time-frame :offset-assert 16) + (flags city-attacker-info-flag :offset-assert 24) (num-current-attackers uint8 :offset-assert 26) (max-num-attackers uint8 :offset-assert 27) (self-type int16 :offset-assert 28) (enemy-type int16 :offset-assert 30) (self-index int16 :offset-assert 32) (enemy-index int16 :offset-assert 34) - (callback basic :offset-assert 36) - (hatred-map-callback basic :offset-assert 40) + (callback function :offset-assert 36) + (hatred-map-callback function :offset-assert 40) ) :method-count-assert 11 :size-assert #x2c @@ -48480,28 +48426,31 @@ (city-attacker-info-method-10 () none) ;; 10 ) ) -|# -#| (deftype city-attacker-cache (structure) ((pos vector :offset-assert 0) (proc basic :offset-assert 4) - (attackable? basic :offset-assert 8) + (attackable? symbol :offset-assert 8) ) :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| +;; +++mission-squad-control-h:city-hatred-info-flag +(defenum city-hatred-info-flag + :type uint16 + :bitfield #t + ) +;; ---mission-squad-control-h:city-hatred-info-flag + (deftype city-hatred-info (structure) ((hatred float :offset-assert 0) (max-consider-dist float :offset-assert 4) (hatred-dist float :offset-assert 8) (dist-scale float :offset-assert 12) (attacker-scale float :offset-assert 16) - (flags uint16 :offset-assert 20) + (flags city-hatred-info-flag :offset-assert 20) (index uint8 :offset-assert 22) (pad uint8 :offset-assert 23) ) @@ -48509,45 +48458,37 @@ :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype city-attacker-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data city-attacker-info :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype city-hatred-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data city-hatred-info :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype city-attacker-cache-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data city-attacker-cache :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype mission-squad-control (basic) - ((attackers basic :offset-assert 4) + ((attackers city-attacker-array :offset-assert 4) (unused-list basic :offset-assert 8) (hatred-vals basic :offset-assert 12) (hatred-indices basic :offset-assert 16) - (attacker-cache basic :offset-assert 20) + (attacker-cache city-attacker-cache-array :offset-assert 20) (target-attacker city-attacker-info :offset-assert 24) (max-num-object-types int32 :offset-assert 28) ) @@ -48572,8 +48513,6 @@ (mission-squad-control-method-23 () none) ;; 23 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; citizen-h ;; @@ -49123,7 +49062,6 @@ ;; cty-attack-controller ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype cty-attack-controller (mission-squad-control) ((guard-angry-hatred-info-index int8 :offset-assert 32) ) @@ -49131,12 +49069,11 @@ :size-assert #x21 :flag-assert #x1800000021 ) -|# ;; (define-extern city-target-type->cty-faction function) ;; (define-extern city-target-type->traffic-object-type function) ;; (define-extern symbol->city-target-type function) -(define-extern *cty-attack-controller* symbol) +(define-extern *cty-attack-controller* cty-attack-controller) ;; (define-extern initialize-cty-attack-controller function) (define-extern cty-attack-reset (function symbol symbol symbol none)) @@ -50309,33 +50246,30 @@ ;; railx-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype railx-states (structure) - ((pulses UNKNOWN 6 :offset-assert 0) - (blue pulse-state :inline :offset-assert 0) - (yellow pulse-state :inline :offset-assert 16) - (warp pulse-state :inline :offset-assert 32) - (spill pulse-state :inline :offset-assert 48) - (egg pulse-state :inline :offset-assert 64) - (transform pulse-state :inline :offset-assert 80) + ((pulses pulse-state 6 :inline :offset-assert 0) + (blue pulse-state :inline :offset 0) + (yellow pulse-state :inline :offset 16) + (warp pulse-state :inline :offset 32) + (spill pulse-state :inline :offset 48) + (egg pulse-state :inline :offset 64) + (transform pulse-state :inline :offset 80) (flicker float :offset-assert 96) ) :method-count-assert 9 :size-assert #x64 :flag-assert #x900000064 ) -|# -;; (define-extern init-mood-railx function) -;; (define-extern update-railx-lights function) -;; (define-extern update-mood-railx function) -;; (define-extern set-railx-light-brightness! function) +(define-extern init-mood-railx (function mood-context float)) +(define-extern update-railx-lights (function mood-context none)) +(define-extern update-mood-railx (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-railx-light-brightness! (function int float float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; railx-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype rail-warp-gate (process-drawable) () :method-count-assert 21 @@ -50345,16 +50279,15 @@ idle ;; 20 ) ) -|# -;; (define-extern spt-birth-func-capsulescreen function) +(define-extern spt-birth-func-capsulescreen (function sparticle-system sparticle-cpuinfo object object object none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; railx-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern railx-death-precursor death-info) -;; (define-extern start-railx-precursor-effect function) +(define-extern railx-death-precursor death-info) +(define-extern start-railx-precursor-effect (function process-drawable none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyslumb-part ;; @@ -50760,14 +50693,13 @@ ;; mh-bat ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype mh-bat (enemy) ((rotation-matrix matrix :inline :offset-assert 560) (move-curve cubic-curve :inline :offset-assert 624) (start-pos vector :inline :offset-assert 688) (up-vector vector :inline :offset-assert 704) (focus-bullseye-pos vector :inline :offset-assert 720) - (focus-xz-dir vector :inline :offset-assert 752) + (focus-xz-dir vector :inline :offset 752) (target-velocity vector :inline :offset-assert 768) (target-speed float :offset-assert 784) (y-offset float :offset-assert 788) @@ -50778,39 +50710,38 @@ (bank-angle float :offset-assert 808) (pitch-angle float :offset-assert 812) (anim-speed float :offset-assert 816) - (last-off-screen-time uint64 :offset-assert 824) - (nav-mesh basic :offset-assert 832) + (last-off-screen-time time-frame :offset-assert 824) + (nav-mesh nav-mesh :offset-assert 832) (flap-interp float :offset-assert 836) (shadow-id int32 :offset-assert 840) - (move-dest vector :inline :offset-assert 368) + (move-dest vector :inline :offset 368) ) :method-count-assert 162 :size-assert #x34c :flag-assert #xa202d0034c - (:methods - (mh-bat-method-158 () none) ;; 158 - (mh-bat-method-159 () none) ;; 159 - (mh-bat-method-160 () none) ;; 160 - (mh-bat-method-161 () none) ;; 161 - ) (:state-methods + dormant-aware ;; 29 knocked-recover ;; 32 - attack-1 ;; 157 - attack-0 ;; 156 stare ;; 37 hostile ;; 38 - retreat ;; 155 ambush ;; 47 - dormant-aware ;; 29 + retreat ;; 155 + attack-0 ;; 156 + attack-1 ;; 157 + ) + (:methods + (mh-bat-method-158 (_type_) vector) ;; 158 + (mh-bat-method-159 (_type_) none) ;; 159 + (set-scale! (_type_ float) none) ;; 160 + (probe-shadow (_type_) none) ;; 161 ) ) -|# -;; (define-extern *fact-info-mh-bat-defaults* fact-info-enemy-defaults) -;; (define-extern *mh-bat-enemy-info* enemy-info) -;; (define-extern mh-bat-fly-code function) -;; (define-extern mh-bat-fly-post function) -;; (define-extern mh-bat-chase-post function) +(define-extern *fact-info-mh-bat-defaults* fact-info-enemy-defaults) +(define-extern *mh-bat-enemy-info* enemy-info) +(define-extern mh-bat-fly-code (function (function object :behavior mh-bat) symbol :behavior mh-bat)) +(define-extern mh-bat-fly-post (function none :behavior mh-bat)) +(define-extern mh-bat-chase-post (function none :behavior mh-bat)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; egg-spider ;; @@ -50924,184 +50855,167 @@ ;; timer-path ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype timer-chase-node (structure) ((pos vector :inline :offset-assert 0) - (is-spawn? basic :offset-assert 16) + (is-spawn? symbol :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -;; (define-extern *timer-chase-path-0* array) -;; (define-extern *timer-chase-path-1* array) +(define-extern *timer-chase-path-0* (array timer-chase-node)) +(define-extern *timer-chase-path-1* (array timer-chase-node)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; des-bush-time-chase ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype trail-effect (process-drawable) - ((trail uint64 :offset-assert 200) - (goal-part basic :offset-assert 208) + ((trail handle :offset-assert 200) + (goal-part sparticle-launch-control :offset-assert 208) ) :method-count-assert 22 :size-assert #xd4 :flag-assert #x16006000d4 (:state-methods - dormant ;; 21 idle ;; 20 + dormant ;; 21 ) ) -|# -#| (deftype timer-chase-trail (light-trail-tracker-projectile) - ((time-offset uint64 :offset-assert 192) - (start-tracking? basic :offset-assert 200) + ((time-offset time-frame :offset 192) + (start-tracking? symbol :offset-assert 200) ) :method-count-assert 24 :size-assert #xcc :flag-assert #x18005000cc - (:methods - (timer-chase-trail-method-23 () none) ;; 23 - ) (:state-methods - fadeout ;; 22 tracking ;; 14 + fadeout ;; 22 + ) + (:methods + (timer-chase-trail-method-23 (_type_) none) ;; 23 ) ) -|# -#| (deftype bb-goal (process-drawable) ((activate-radius float :offset-assert 200) - (sound-id uint32 :offset-assert 204) + (sound-id sound-id :offset-assert 204) ) :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 ) ) -|# -#| +;; +++des-bush-time-chase:bb-pickup-type +(defenum bb-pickup-type + :type uint8 + (small) + (medium) + (large) + ) +;; ---des-bush-time-chase:bb-pickup-type + (deftype bb-freeze (process-drawable) ((launch-pos vector :inline :offset-assert 208) (activate-radius float :offset-assert 224) (freeze-time float :offset-assert 228) (freeze-pickup-radius float :offset-assert 232) - (bb-pickup-type uint8 :offset-assert 236) + (bb-pickup-type bb-pickup-type :offset-assert 236) ) :method-count-assert 23 :size-assert #xed :flag-assert #x17007000ed (:state-methods - die ;; 22 idle ;; 20 dormant ;; 21 + die ;; 22 ) ) -|# -#| (deftype a-bb-freeze (bb-freeze) () :method-count-assert 23 :size-assert #xed :flag-assert #x17007000ed ) -|# -#| (deftype b-bb-freeze (bb-freeze) () :method-count-assert 23 :size-assert #xed :flag-assert #x17007000ed ) -|# -#| (deftype freeze-time-hud (hud-goal) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype task-manager-bbush-timer-chase (task-manager) - ((actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (freeze-time float :offset-assert 244) - (path-pos float :offset-assert 248) - (trail-effect uint64 :offset-assert 252) - (trans vector :inline :offset-assert 268) - (freeze-activation-radius float :offset-assert 284) - (goal-activation-radius float :offset-assert 288) - (total-time float :offset-assert 292) - (touched basic :offset-assert 296) - (freeze-time float :offset-assert 244) - (freeze-time-1 float :offset-assert 304) - (freeze-time-2 float :offset-assert 308) - (freeze-time-3 float :offset-assert 312) - (freeze-pickup-radius float :offset-assert 316) - (freeze-time-hud uint64 :offset-assert 324) - (sound-id uint32 :offset-assert 332) - (color-flash-time uint64 :offset-assert 340) + ((actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (freeze-time float :offset-assert 248) + (path-pos float :offset-assert 252) + (trail-effect handle :offset-assert 256) + (trans vector :inline :offset-assert 272) + (freeze-activation-radius float :offset-assert 288) + (goal-activation-radius float :offset-assert 292) + (total-time float :offset-assert 296) + (touched symbol :offset-assert 300) + ; (freeze-time float :offset-assert 248) + (freeze-time-1 float :offset 308) + (freeze-time-2 float :offset-assert 312) + (freeze-time-3 float :offset-assert 316) + (freeze-pickup-radius float :offset-assert 320) + (freeze-time-hud handle :offset-assert 328) + (sound-id sound-id :offset-assert 336) + (color-flash-time time-frame :offset-assert 344) ) :method-count-assert 35 :size-assert #x160 :flag-assert #x2300e00160 (:methods - (task-manager-bbush-timer-chase-method-32 () none) ;; 32 - (task-manager-bbush-timer-chase-method-33 () none) ;; 33 - (task-manager-bbush-timer-chase-method-34 () none) ;; 34 - ) - (:state-methods - active ;; 15 - resolution ;; 17 + (get-entity-name (_type_) string) ;; 32 + (set-sbanks (_type_) none) ;; 33 + (get-node-array (_type_) (array timer-chase-node)) ;; 34 ) ) -|# -#| (deftype task-manager-bbush-timer-chase-2 (task-manager-bbush-timer-chase) () :method-count-assert 35 :size-assert #x160 :flag-assert #x2300e00160 ) -|# -#| (deftype task-manager-bbush-timer-chase-3 (task-manager-bbush-timer-chase) () :method-count-assert 35 :size-assert #x160 :flag-assert #x2300e00160 ) -|# -;; (define-extern *tex-time-chase-level-list* array) -;; (define-extern find-time-chase-level-name function) -;; (define-extern *bb-alpha* object) -;; (define-extern spt-func-bb-fader function) -;; (define-extern *bb-timer-chase-trail* object) -;; (define-extern trail-effect-init-by-other function) -;; (define-extern bb-goal-init-by-other function) -;; (define-extern bb-pickup-type->string function) -;; (define-extern set-time-chase-particle-texture function) -;; (define-extern bb-freeze-init-by-other function) -;; (define-extern a-bb-freeze-init-by-other function) -;; (define-extern b-bb-freeze-init-by-other function) +(define-extern *tex-time-chase-level-list* (array symbol)) +(define-extern find-time-chase-level-name (function level)) +(define-extern *bb-alpha* int) +(define-extern spt-func-bb-fader (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern *bb-timer-chase-trail* light-trail-composition) +(define-extern trail-effect-init-by-other (function vector object :behavior trail-effect)) +(define-extern bb-goal-init-by-other (function entity-actor float object :behavior bb-goal)) +(define-extern bb-pickup-type->string (function bb-pickup-type string)) +(define-extern set-time-chase-particle-texture (function none)) +(define-extern bb-freeze-init-by-other (function entity-actor object float float float object :behavior bb-freeze)) +(define-extern a-bb-freeze-init-by-other (function entity-actor object float float float object :behavior a-bb-freeze)) +(define-extern b-bb-freeze-init-by-other (function entity-actor object float float float object :behavior b-bb-freeze)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyslumc-part ;; @@ -51140,7 +51054,6 @@ ;; pecker-ingame ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype pecker-ingame (process-drawable) ((path-u float :offset-assert 200) ) @@ -51148,14 +51061,13 @@ :size-assert #xcc :flag-assert #x17005000cc (:state-methods - die ;; 22 - active ;; 21 idle ;; 20 + active ;; 21 + die ;; 22 ) ) -|# -;; (define-extern pecker-ingame-handler function) +(def-event-handler pecker-ingame-handler pecker-ingame) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; combx-obs ;; @@ -51282,38 +51194,36 @@ ;; factory-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern sparticle-torch-spline-align function) -;; (define-extern spt-func-fact-torch function) -;; (define-extern spt-birth-func-fact-torch function) -;; (define-extern *range-color-fact-big-torch-flame* curve-color-fast) -;; (define-extern *range-alpha-fact-big-torch-flame* curve2d-fast) -;; (define-extern *range-scale-fact-big-torch-flame-x* curve2d-fast) -;; (define-extern *range-scale-fact-big-torch-flame-y* curve2d-fast) -;; (define-extern *r-curve-fact-big-torch-flame* curve2d-fast) -;; (define-extern *g-curve-fact-big-torch-flame* curve2d-fast) -;; (define-extern *b-curve-fact-big-torch-flame* curve2d-fast) -;; (define-extern *curve-alpha-fact-big-torch-flame* curve2d-fast) -;; (define-extern *curve-fact-big-torch-flame-x* curve2d-fast) -;; (define-extern *curve-fact-big-torch-flame-y* curve2d-fast) -;; (define-extern *part-fact-big-torch-flame-curve-settings* object) +(define-extern sparticle-torch-spline-align (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern spt-func-fact-torch (function sparticle-system sparticle-cpuinfo sparticle-launchinfo none)) +(define-extern spt-birth-func-fact-torch (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-color-fact-big-torch-flame* curve-color-fast) +(define-extern *range-alpha-fact-big-torch-flame* curve2d-fast) +(define-extern *range-scale-fact-big-torch-flame-x* curve2d-fast) +(define-extern *range-scale-fact-big-torch-flame-y* curve2d-fast) +(define-extern *r-curve-fact-big-torch-flame* curve2d-fast) +(define-extern *g-curve-fact-big-torch-flame* curve2d-fast) +(define-extern *b-curve-fact-big-torch-flame* curve2d-fast) +(define-extern *curve-alpha-fact-big-torch-flame* curve2d-fast) +(define-extern *curve-fact-big-torch-flame-x* curve2d-fast) +(define-extern *curve-fact-big-torch-flame-y* curve2d-fast) +(define-extern *part-fact-big-torch-flame-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factoryc-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype factoryc-states (structure) - ((electricity UNKNOWN 2 :offset-assert 0) - (flame flames-state :inline :offset-assert 32) + ((electricity electricity-state 2 :inline :offset-assert 0) + (flame flames-state :inline :offset 32) ) :method-count-assert 9 :size-assert #x27 :flag-assert #x900000027 ) -|# -;; (define-extern update-mood-factoryc function) -;; (define-extern set-factoryc-light! function) +(define-extern update-mood-factoryc (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-factoryc-light! (function float int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factoryc-texture ;; @@ -51326,7 +51236,6 @@ ;; conveyor ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype conveyor-section (structure) ((start vector :inline :offset-assert 0) (trailing plane :inline :offset-assert 16) @@ -51337,24 +51246,20 @@ :size-assert #x40 :flag-assert #x900000040 ) -|# -#| (deftype conveyor-section-array (inline-array-class) - ((data conveyor-section :dynamic :offset-assert 16) ;; guessed by decompiler + ((data conveyor-section :dynamic :inline :offset-assert 16) ;; guessed by decompiler ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype conveyor (process-drawable) ((speed float :offset-assert 200) (belt-radius float :offset-assert 204) (pull-y-threshold float :offset-assert 208) - (speed-mult-array (array float) :offset-assert 212) ;; guessed by decompiler + (speed-mult-array (pointer float) :offset-assert 212) ;; guessed by decompiler (speed-mult-array-len int8 :offset-assert 216) (sections conveyor-section-array :offset-assert 220) ;; guessed by decompiler (leading plane :inline :offset-assert 224) @@ -51363,39 +51268,36 @@ :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 - (:methods - (conveyor-method-21 () none) ;; 21 ;; (conveyor-method-21 (_type_) float) - (conveyor-method-22 () none) ;; 22 ;; (get-art-group (_type_) art-group) - (conveyor-method-23 () none) ;; 23 ;; (reset-root! (_type_) none) - (conveyor-method-24 () none) ;; 24 ;; (init! (_type_) none) - (conveyor-method-25 () none) ;; 25 ;; (set-and-get-ambient-sound! (_type_) ambient-sound) - (conveyor-method-26 () none) ;; 26 ;; (conveyor-method-26 (_type_ process-focusable) symbol) - (conveyor-method-27 () none) ;; 27 ;; (conveyor-method-27 (_type_) symbol) - (conveyor-method-28 () none) ;; 28 - ) (:state-methods - idle ;; 20, old: (idle () _type_ :state) + idle ;; 20 + ) + (:methods + (conveyor-method-21 (_type_) float) ;; 21 + (get-skel (_type_) art-group) ;; 22 + (alloc-trsqv! (_type_) none) ;; 23 + (init-fields! (_type_) none) ;; 24 + (alloc-sound! (_type_) none) ;; 25 + (init-skel! (_type_) none) ;; 26 + (push-focus (_type_ process-focusable) symbol) ;; 27 + (find-pushables (_type_) symbol) ;; 28 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hover-nav-factoryc ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *factoryc-adjacency* object) +(define-extern *factoryc-adjacency* nav-network-data) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factoryc-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype generic-spot-shadow-effect (process-drawable) ((focal-length float :offset-assert 200) (near-clip float :offset-assert 204) (far-clip float :offset-assert 208) - (color uint32 :offset-assert 212) + (color rgba :offset-assert 212) (pre-flicker-pos vector :inline :offset-assert 224) (jmod-outer joint-mod-add-local :inline :offset-assert 240) (jmod-inner joint-mod-add-local :inline :offset-assert 304) @@ -51403,27 +51305,25 @@ :method-count-assert 24 :size-assert #x170 :flag-assert #x1800f00170 - (:methods - (generic-spot-shadow-effect-method-22 () none) ;; 22 - (generic-spot-shadow-effect-method-23 () none) ;; 23 - ) (:state-methods - inactive ;; 21 idle ;; 20 + inactive ;; 21 + ) + (:methods + (set-jmod-inner-scale! (_type_ vector) none) ;; 22 + (set-jmod-outer-scale! (_type_ vector) none) ;; 23 ) ) -|# -#| (deftype fac-zapper (process) - ((on-duration uint64 :offset-assert 128) - (off-duration uint64 :offset-assert 136) - (phase-offset uint64 :offset-assert 144) - (beam-is-on basic :offset-assert 152) - (bzzt-sound uint32 :offset-assert 156) - (path basic :offset-assert 160) - (lightning basic :offset-assert 164) - (hilite uint64 :offset-assert 168) + ((on-duration time-frame :offset-assert 128) + (off-duration time-frame :offset-assert 136) + (phase-offset time-frame :offset-assert 144) + (beam-is-on symbol :offset-assert 152) + (bzzt-sound sound-id :offset-assert 156) + (path path-control :offset-assert 160) + (lightning lightning-control :offset-assert 164) + (hilite handle :offset-assert 168) ) :method-count-assert 15 :size-assert #xb0 @@ -51432,17 +51332,15 @@ idle ;; 14 ) ) -|# -#| (deftype fac-fire-torch (process-drawable) - ((on-duration uint64 :offset-assert 200) - (off-duration uint64 :offset-assert 208) - (phase-offset uint64 :offset-assert 216) - (fire-is-on basic :offset-assert 224) + ((on-duration time-frame :offset-assert 200) + (off-duration time-frame :offset-assert 208) + (phase-offset time-frame :offset-assert 216) + (fire-is-on symbol :offset-assert 224) (sync sync-eased :inline :offset-assert 232) (path-pos float :offset-assert 276) - (looping-sound uint32 :offset-assert 280) + (looping-sound sound-id :offset-assert 280) (particle-hack matrix :inline :offset-assert 288) ) :method-count-assert 21 @@ -51452,94 +51350,85 @@ idle ;; 20 ) ) -|# -#| (deftype fac-robopod (process-focusable) - ((my-baby UNKNOWN 3 :offset-assert 208) + ((my-baby handle 3 :offset-assert 208) (num-babies uint32 :offset-assert 232) (subtask-countdown int32 :offset-assert 236) - (suppressed basic :offset-assert 240) + (suppressed symbol :offset-assert 240) ) :method-count-assert 32 :size-assert #xf4 :flag-assert #x20008000f4 (:state-methods - already-dead ;; 31 - die ;; 30 - generate ;; 29 idle ;; 28 + generate ;; 29 + die ;; 30 + already-dead ;; 31 ) ) -|# -#| (deftype factory-elec-gate (process) - ((path-l basic :offset-assert 124) - (path-r basic :offset-assert 128) - (beams UNKNOWN 4 :offset-assert 132) - (beams-on UNKNOWN 4 :offset-assert 148) - (bzzt-sound uint32 :offset-assert 164) - (blocking-plane uint64 :offset-assert 172) - (actor-group uint32 :offset-assert 180) - (actor-group-count int32 :offset-assert 184) + ((path-l path-control :offset-assert 128) + (path-r path-control :offset-assert 132) + (beams lightning-control 4 :offset-assert 136) + (beams-on symbol 4 :offset-assert 152) + (bzzt-sound sound-id :offset-assert 168) + (blocking-plane handle :offset-assert 176) + (actor-group (pointer actor-group) :offset-assert 184) + (actor-group-count int32 :offset-assert 188) ) :method-count-assert 16 :size-assert #xc0 :flag-assert #x10004000c0 (:state-methods - flickering ;; 15 idle ;; 14 + flickering ;; 15 ) ) -|# -;; (define-extern factoryc-activate function) -;; (define-extern factoryc-login function) -;; (define-extern factoryc-logout function) -;; (define-extern generic-spot-shadow-effect-init-by-other function) -;; (define-extern generic-spot-shadow-effect-handler function) -;; (define-extern *fac-robopod-pool-count* object) -;; (define-extern *fac-robopod-exploder-params* joint-exploder-static-params) -;; (define-extern fac-robopod-add-hoverbot function) -;; (define-extern fac-robopod-invalidate-hoverbot function) -;; (define-extern fac-robopod-base-handler function) +(define-extern factoryc-activate (function level none)) +(define-extern factoryc-login (function level none)) +(define-extern factoryc-logout (function level none)) +(define-extern generic-spot-shadow-effect-init-by-other (function vector quaternion object :behavior generic-spot-shadow-effect)) +(def-event-handler generic-spot-shadow-effect-handler generic-spot-shadow-effect) +(define-extern *fac-robopod-pool-count* int) +(define-extern *fac-robopod-exploder-params* joint-exploder-static-params) +(define-extern fac-robopod-add-hoverbot (function fac-robopod none)) +(define-extern fac-robopod-invalidate-hoverbot (function fac-robopod int none)) +(def-event-handler fac-robopod-base-handler fac-robopod) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factoryc-obs2 ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fac-break-floor (process-drawable) - ((notify-actor basic :offset-assert 200) + ((root collide-shape :override) + (notify-actor entity-actor :offset-assert 200) ) :method-count-assert 22 :size-assert #xcc :flag-assert #x16005000cc (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 ) ) -|# -#| (deftype fac-break-fence (process-focusable) - ((notify-actor basic :offset-assert 208) + ((notify-actor entity-actor :offset-assert 208) ) :method-count-assert 30 :size-assert #xd4 :flag-assert #x1e006000d4 (:state-methods - die ;; 29 idle ;; 28 + die ;; 29 ) ) -|# -#| (deftype fac-break-fence-a (fac-break-fence) - () + ((pad uint8 4)) :method-count-assert 30 :size-assert #xd8 :flag-assert #x1e006000d8 @@ -51547,11 +51436,9 @@ die ;; 29 ) ) -|# -#| (deftype fac-break-fence-b (fac-break-fence) - () + ((pad uint8 4)) :method-count-assert 30 :size-assert #xd8 :flag-assert #x1e006000d8 @@ -51559,128 +51446,87 @@ die ;; 29 ) ) -|# -#| (deftype fac-break-fence-c (fac-break-fence) - () + ((pad uint8 4)) :method-count-assert 30 :size-assert #xd8 :flag-assert #x1e006000d8 (:state-methods - die ;; 29 idle ;; 28 + die ;; 29 ) ) -|# -#| (deftype fac-switch (process-drawable) - ((actor-group uint32 :offset-assert 196) - (actor-group-count int32 :offset-assert 200) - (lever-jmod joint-mod-rotate-local :inline :offset-assert 204) - (part-red basic :offset-assert 164) - (part-green basic :offset-assert 236) - (minimap connection-minimap :offset-assert 240) + ((actor-group (pointer actor-group) :offset-assert 200) + (actor-group-count int32 :offset-assert 204) + (lever-jmod joint-mod-rotate-local :inline :offset-assert 208) + (part-red sparticle-launch-control :offset 168) + (part-green sparticle-launch-control :offset-assert 240) + (minimap connection-minimap :offset-assert 244) ) :method-count-assert 23 :size-assert #xf8 :flag-assert #x17008000f8 - (:methods - (fac-switch-method-22 () none) ;; 22 - ) (:state-methods - done ;; 21 idle ;; 20 + (done symbol) ;; 21 + ) + (:methods + (is-done? (_type_) symbol) ;; 22 ) ) -|# -#| (deftype fac-move-plat-a (plat) ((dead-set-time float :offset-assert 324) ) :method-count-assert 40 :size-assert #x148 :flag-assert #x2800d00148 - (:methods - (fac-move-plat-a-method-39 () none) ;; 39 - ) (:state-methods - locking-down ;; 38 - plat-path-active ;; 36 plat-idle ;; 35 + plat-path-active ;; 36 + locking-down ;; 38 + ) + (:methods + (fac-move-plat-a-method-39 (_type_) none) ;; 39 ) ) -|# -#| (deftype fac-move-plat-b (plat) () :method-count-assert 38 :size-assert #x144 :flag-assert #x2600d00144 (:state-methods - plat-path-active ;; 36 plat-idle ;; 35 + plat-path-active ;; 36 ) ) -|# -#| (deftype fac-rotfan (process-drawable) - ((motor-noise uint32 :offset-assert 200) + ((root collide-shape :override) + (motor-noise sound-id :offset-assert 200) (effect-opacity float :offset-assert 204) - (no-collision-timer uint64 :offset-assert 208) + (no-collision-timer time-frame :offset-assert 208) (attack-id int32 :offset-assert 216) ) :method-count-assert 24 :size-assert #xdc :flag-assert #x18006000dc - (:methods - (fac-rotfan-method-23 () none) ;; 23 - ) (:state-methods - out ;; 22 - spindown ;; 21 idle ;; 20 + spindown ;; 21 + out ;; 22 + ) + (:methods + (is-out? (_type_) symbol) ;; 23 ) ) -|# -#| (deftype fac-robot-ass-manager (process) - ((name basic :offset-assert 0) - (mask process-mask :offset-assert 4) - (clock basic :offset-assert 8) - (parent uint32 :offset-assert 12) - (brother uint32 :offset-assert 16) - (child uint32 :offset-assert 20) - (ppointer uint32 :offset-assert 24) - (self basic :offset-assert 28) - (pool basic :offset-assert 32) - (status basic :offset-assert 36) - (pid int32 :offset-assert 40) - (main-thread basic :offset-assert 44) - (top-thread basic :offset-assert 48) - (entity basic :offset-assert 52) - (level basic :offset-assert 56) - (state basic :offset-assert 60) - (prev-state basic :offset-assert 64) - (next-state basic :offset-assert 68) - (state-stack basic :offset-assert 72) - (trans-hook basic :offset-assert 76) - (post-hook basic :offset-assert 80) - (event-hook basic :offset-assert 84) - (allocated-length int32 :offset-assert 88) - (heap-base uint32 :offset-assert 92) - (heap-top uint32 :offset-assert 96) - (heap-cur uint32 :offset-assert 100) - (stack-frame-top basic :offset-assert 104) - (heap kheap :inline :offset-assert 92) - (connection-list connectable :inline :offset-assert 108) - (stack UNKNOWN :dynamic :offset-assert 124) - ) + () :method-count-assert 15 :size-assert #x80 :flag-assert #xf00000080 @@ -51688,38 +51534,36 @@ idle ;; 14 ) ) -|# -#| (deftype factory-conveyor (conveyor) () :method-count-assert 29 :size-assert #x100 :flag-assert #x1d00800100 ) -|# -#| (deftype fac-punch-wall (process-drawable) - ((notify-actor basic :offset-assert 200) - (spool-sound-id uint32 :offset-assert 204) + ((root collide-shape :override) + (notify-actor entity-actor :offset-assert 200) + (spool-sound-id sound-id :offset-assert 204) ) :method-count-assert 22 :size-assert #xd0 :flag-assert #x16005000d0 (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 ) + (:states + perish-immediately + ) ) -|# -;; (define-extern *fac-break-floor-exploder-params* joint-exploder-static-params) -;; (define-extern *fac-break-fence-a-exploder-params* joint-exploder-static-params) -;; (define-extern *fac-break-fence-b-exploder-params* joint-exploder-static-params) -;; (define-extern *fac-break-fence-c-exploder-params* joint-exploder-static-params) -;; (define-extern fac-rotfan-part-trans function) -;; (define-extern perish-immediately state) +(define-extern *fac-break-floor-exploder-params* joint-exploder-static-params) +(define-extern *fac-break-fence-a-exploder-params* joint-exploder-static-params) +(define-extern *fac-break-fence-b-exploder-params* joint-exploder-static-params) +(define-extern *fac-break-fence-c-exploder-params* joint-exploder-static-params) +(define-extern fac-rotfan-part-trans (function none :behavior fac-rotfan)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; target-indax ;; @@ -51991,54 +51835,45 @@ ;; des-bbush-tasks ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hud-wasbbv-goal (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype hud-wasbbv-score (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype hud-wasbbv-counter (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype wasbbv-hud-info (structure) ((goal float :offset-assert 0) (score float :offset-assert 4) (current float :offset-assert 8) (goal-cup uint8 :offset-assert 12) - (goal-text uint32 :offset-assert 16) - (score-text uint32 :offset-assert 20) + (goal-text text-id :offset-assert 16) + (score-text text-id :offset-assert 20) (decimal-place-count int8 :offset-assert 24) ) :method-count-assert 9 :size-assert #x19 :flag-assert #x900000019 ) -|# -#| (deftype task-manager-vehicle-bbush (task-manager) ((ground-pos vector :inline :offset-assert 240) - (ground-time uint64 :offset-assert 256) - (pre-start-time uint64 :offset-assert 264) + (ground-time time-frame :offset-assert 256) + (pre-start-time time-frame :offset-assert 264) (display-units float :offset-assert 272) (max-distance float :offset-assert 276) (distance float :offset-assert 280) @@ -52049,68 +51884,58 @@ (goal float :offset-assert 300) (score float :offset-assert 304) (current float :offset-assert 308) - (hud-score uint64 :offset-assert 312) - (hud-goal uint64 :offset-assert 320) - (squad-manager uint64 :offset-assert 336) + (hud-score handle :offset-assert 312) + (hud-goal handle :offset-assert 320) + (squad-manager handle :offset 336) (game-score uint8 :offset-assert 344) (last-cup uint8 :offset-assert 345) (goal-cup uint8 :offset-assert 346) - (new-high-score basic :offset-assert 348) - (want-current-hud? basic :offset-assert 352) + (new-high-score symbol :offset-assert 348) + (want-current-hud? symbol :offset-assert 352) ) :method-count-assert 37 :size-assert #x164 :flag-assert #x2500f00164 - (:methods - (task-manager-vehicle-bbush-method-33 () none) ;; 33 - (task-manager-vehicle-bbush-method-34 () none) ;; 34 - (task-manager-vehicle-bbush-method-35 () none) ;; 35 - (task-manager-vehicle-bbush-method-36 () none) ;; 36 - ) (:state-methods - report ;; 32 active ;; 15 + report ;; 32 + ) + (:methods + (award-skill (_type_ float) none) ;; 33 + (task-manager-vehicle-bbush-method-34 (_type_) none) ;; 34 + (task-manager-vehicle-bbush-method-35 (_type_) none) ;; 35 + (task-manager-vehicle-bbush-method-36 (_type_) none) ;; 36 ) ) -|# -#| (deftype task-manager-bbush-air-time (task-manager-vehicle-bbush) () :method-count-assert 37 :size-assert #x164 :flag-assert #x2500f00164 ) -|# -#| (deftype task-manager-bbush-total-air-time (task-manager-vehicle-bbush) () :method-count-assert 37 :size-assert #x164 :flag-assert #x2500f00164 ) -|# -#| (deftype task-manager-bbush-jump-distance (task-manager-vehicle-bbush) - () + ((pad uint8 36)) :method-count-assert 37 :size-assert #x188 :flag-assert #x2501100188 ) -|# -#| (deftype task-manager-bbush-total-jump-distance (task-manager-vehicle-bbush) () :method-count-assert 37 :size-assert #x164 :flag-assert #x2500f00164 ) -|# -#| (deftype task-manager-bbush-roll-count (task-manager-vehicle-bbush) ((roll-count float :offset-assert 356) (y-proj float :offset-assert 360) @@ -52119,9 +51944,7 @@ :size-assert #x16c :flag-assert #x2500f0016c ) -|# -#| (deftype task-manager-bbush-destroy-interceptors (task-manager-vehicle-bbush) ((max-reserve-count int32 :offset-assert 356) ) @@ -52129,10 +51952,9 @@ :size-assert #x168 :flag-assert #x2500f00168 ) -|# -;; (define-extern *wasbbv-hud-info* object) -;; (define-extern *bbv-fail-time-expired* object) +(define-extern *wasbbv-hud-info* wasbbv-hud-info) +(define-extern *bbv-fail-time-expired* resetter-params) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; hfrag-vu1-h ;; @@ -53394,7 +53216,7 @@ (vehicle-method-88 (_type_ vehicle-controls) none) ;; 88 (init-reverse (_type_ vehicle-controls) none) ;; 89 (control-hook-ai (_type_ vehicle-controls) none) ;; 90 - (control-hook-player (_type_ vehicle-controls) none) ;; 91 + (control-hook-player (_type_) none) ;; 91 (vehicle-method-92 (_type_ vehicle-controls) none) ;; 92 (vehicle-method-93 (_type_) none) ;; 93 (vehicle-method-94 (_type_) none) ;; 94 @@ -56535,108 +56357,118 @@ ;; factory-boss-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-factory-boss-shot-explo-color* curve-color-fast) -;; (define-extern *range-factory-boss-shot-explo-alpha* curve2d-fast) -;; (define-extern *range-factory-boss-shot-explo-scale-x* curve2d-fast) -;; (define-extern *range-factory-boss-shot-explo-scale-y* curve2d-fast) -;; (define-extern *curve-factory-boss-shot-explo-alpha* curve2d-fast) -;; (define-extern *curve-factory-boss-shot-explo-scale-x* curve2d-fast) -;; (define-extern *curve-factory-boss-shot-explo-scale-y* curve2d-fast) -;; (define-extern *part-factory-boss-shot-explosion-texture-curve-settings* object) -;; (define-extern *part-factory-boss-machine-explosion-texture-curve-settings* object) +(define-extern *range-factory-boss-shot-explo-color* curve-color-fast) +(define-extern *range-factory-boss-shot-explo-alpha* curve2d-fast) +(define-extern *range-factory-boss-shot-explo-scale-x* curve2d-fast) +(define-extern *range-factory-boss-shot-explo-scale-y* curve2d-fast) +(define-extern *curve-factory-boss-shot-explo-alpha* curve2d-fast) +(define-extern *curve-factory-boss-shot-explo-scale-x* curve2d-fast) +(define-extern *curve-factory-boss-shot-explo-scale-y* curve2d-fast) +(define-extern *part-factory-boss-shot-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *part-factory-boss-machine-explosion-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-boss-setup ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++factory-boss-setup:facboss-speech-instance-flag +(defenum facboss-speech-instance-flag + :type uint64 + :bitfield #t + (fsi0 0) + (fsi1 1) + (fsi2 2) + (fsi3 3) + (fsi4 4) + ) +;; ---factory-boss-setup:facboss-speech-instance-flag + (deftype factory-boss-speech-instance (structure) - ((speech basic :offset-assert 0) + ((speech string :offset-assert 0) (probability float :offset-assert 4) - (flags uint64 :offset-assert 8) + (flags facboss-speech-instance-flag :offset-assert 8) (play-count uint32 :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| +;; +++factory-boss-setup:facboss-speech-info-flag +(defenum facboss-speech-info-flag + :type uint8 + :bitfield #t + (fsi0 0) + (fsi1 1) + ) +;; ---factory-boss-setup:facboss-speech-info-flag + (deftype factory-boss-speech-info (structure) - ((speeches basic :offset-assert 0) - (play-time uint64 :offset-assert 8) - (current-random uint64 :offset-assert 16) - (minimum-interval uint64 :offset-assert 24) - (random-interval uint64 :offset-assert 32) + ((speeches (array factory-boss-speech-instance) :offset-assert 0) + (play-time time-frame :offset-assert 8) + (current-random time-frame :offset-assert 16) + (minimum-interval time-frame :offset-assert 24) + (random-interval time-frame :offset-assert 32) (last-played int8 :offset-assert 40) - (flags uint8 :offset-assert 41) + (flags facboss-speech-info-flag :offset-assert 41) ) :method-count-assert 9 :size-assert #x2a :flag-assert #x90000002a ) -|# -#| (deftype factory-boss-speech-group (structure) - ((play-time uint64 :offset-assert 0) - (info basic :offset-assert 8) + ((play-time time-frame :offset-assert 0) + (info (array factory-boss-speech-info) :offset-assert 8) ) :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype factory-boss-reticle-info (structure) - ((reticle basic :offset-assert 0) - (reticle-corner-0 basic :offset-assert 4) - (reticle-corner-1 basic :offset-assert 8) - (reticle-corner-2 basic :offset-assert 12) - (reticle-corner-3 basic :offset-assert 16) - (reticle-dot basic :offset-assert 20) - (reticle-arrow basic :offset-assert 24) - (reticle-super basic :offset-assert 28) - (reticle-super-ring basic :offset-assert 32) - (lock-time uint64 :offset-assert 40) + ((reticle sparticle-launch-control :offset-assert 0) + (reticle-corner-0 sparticle-launch-control :offset-assert 4) + (reticle-corner-1 sparticle-launch-control :offset-assert 8) + (reticle-corner-2 sparticle-launch-control :offset-assert 12) + (reticle-corner-3 sparticle-launch-control :offset-assert 16) + (reticle-dot sparticle-launch-control :offset-assert 20) + (reticle-arrow sparticle-launch-control :offset-assert 24) + (reticle-super sparticle-launch-control :offset-assert 28) + (reticle-super-ring sparticle-launch-control :offset-assert 32) + (lock-time time-frame :offset-assert 40) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (factory-boss-reticle-info-method-9 () none) ;; 9 - (factory-boss-reticle-info-method-10 () none) ;; 10 - (factory-boss-reticle-info-method-11 () none) ;; 11 + (init! (_type_ process) none) ;; 9 + (factory-boss-reticle-info-method-10 (_type_ vector vector int int) none) ;; 10 + (factory-boss-reticle-info-method-11 (_type_) none) ;; 11 ) ) -|# -#| (deftype factory-boss-shot (projectile) - ((trail-part basic :offset-assert 512) + ((trail-part sparticle-launch-control :offset-assert 512) (traj trajectory :inline :offset-assert 528) - (traj-time uint64 :offset-assert 568) + (traj-time time-frame :offset-assert 568) (shot-dest vector :inline :offset-assert 576) - (impact-played basic :offset-assert 592) - (reticle-sound uint32 :offset-assert 596) - (reticle-sound-playing basic :offset-assert 600) + (impact-played symbol :offset-assert 592) + (reticle-sound sound-id :offset-assert 596) + (reticle-sound-playing symbol :offset-assert 600) ) :method-count-assert 42 :size-assert #x25c :flag-assert #x2a01e0025c - (:methods - (factory-boss-shot-method-41 () none) ;; 41 - ) (:state-methods impact ;; 22 moving ;; 23 ) + (:methods + (stop-reticle-sound (_type_) none) ;; 41 + ) ) -|# -#| (deftype factory-boss-shockwave-bomb (factory-boss-shot) () :method-count-assert 42 @@ -56646,18 +56478,14 @@ impact ;; 22 ) ) -|# -#| (deftype shockwave-bomb-explosion (explosion) () :method-count-assert 23 :size-assert #x168 :flag-assert #x1700f00168 ) -|# -#| (deftype factory-boss-floorbuster-bomb (factory-boss-shot) ((targetted-group int8 :offset-assert 604) ) @@ -56668,9 +56496,7 @@ impact ;; 22 ) ) -|# -#| (deftype floorbuster-bomb-explosion (explosion) ((targetted-group int8 :offset-assert 360) ) @@ -56678,9 +56504,7 @@ :size-assert #x169 :flag-assert #x1700f00169 ) -|# -#| (deftype fac-drop-plat-nocollide (process-drawable) () :method-count-assert 21 @@ -56690,148 +56514,167 @@ idle ;; 20 ) ) -|# -#| (deftype fac-drop-plat (process-drawable) - ((x-rotation-speed float :offset-assert 200) + ((root collide-shape :override) + (x-rotation-speed float :offset-assert 200) (y-rotation-speed float :offset-assert 204) - (boss basic :offset-assert 208) + (boss entity-actor :offset-assert 208) ) :method-count-assert 23 :size-assert #xd4 :flag-assert #x17006000d4 (:state-methods - done-falling ;; 22 - fall-away ;; 21 idle ;; 20 + fall-away ;; 21 + done-falling ;; 22 ) ) -|# -#| +;; +++factory-boss-setup:facboss-critter-tracker-flag +(defenum facboss-critter-tracker-flag + :type uint32 + :bitfield #t + (fct0 0) + (fct1 1) + (fct2 2) + ) +;; ---factory-boss-setup:facboss-critter-tracker-flag + (deftype factory-boss-critter-tracker (structure) - ((handle uint64 :offset-assert 0) - (flags uint32 :offset-assert 8) + ((handle handle :offset-assert 0) + (flags facboss-critter-tracker-flag :offset-assert 8) (dest vector :inline :offset-assert 16) ) :method-count-assert 9 :size-assert #x20 :flag-assert #x900000020 ) -|# -#| +;; +++factory-boss-setup:facboss-machine-state-flag +(defenum facboss-machine-state-flag + :type uint8 + :bitfield #t + (fms0 0) + (fms1 1) + (fms2 2) + (fms3 3) + ) +;; ---factory-boss-setup:facboss-machine-state-flag + (deftype factory-boss-machine-state (structure) - ((damaged-low-smoke-part basic :offset-assert 0) - (damaged-high-smoke-part basic :offset-assert 4) - (damaged-left-spark-part basic :offset-assert 8) - (damaged-right-spark-part basic :offset-assert 12) - (ring-part basic :offset-assert 16) - (lightning basic :offset-assert 20) - (machine-sound uint32 :offset-assert 24) + ((damaged-low-smoke-part sparticle-launch-control :offset-assert 0) + (damaged-high-smoke-part sparticle-launch-control :offset-assert 4) + (damaged-left-spark-part sparticle-launch-control :offset-assert 8) + (damaged-right-spark-part sparticle-launch-control :offset-assert 12) + (ring-part sparticle-launch-control :offset-assert 16) + (lightning lightning-control :offset-assert 20) + (machine-sound sound-id :offset-assert 24) (state int8 :offset-assert 28) - (flags uint8 :offset-assert 29) - (left-spark-timer uint64 :offset-assert 32) - (right-spark-timer uint64 :offset-assert 40) - (ring-timer uint64 :offset-assert 48) + (flags facboss-machine-state-flag :offset-assert 29) + (left-spark-timer time-frame :offset-assert 32) + (right-spark-timer time-frame :offset-assert 40) + (ring-timer time-frame :offset-assert 48) ) :method-count-assert 9 :size-assert #x38 :flag-assert #x900000038 ) -|# -#| (deftype factory-boss-lightning-gate (structure) ((center vector :inline :offset-assert 0) (x-off float :offset-assert 16) (z-off float :offset-assert 20) - (blocking-plane uint64 :offset-assert 24) - (lightning UNKNOWN 4 :offset-assert 32) + (blocking-plane handle :offset-assert 24) + (lightning lightning-control 4 :offset-assert 32) ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (factory-boss-lightning-gate-method-9 () none) ;; 9 - (factory-boss-lightning-gate-method-10 () none) ;; 10 - (factory-boss-lightning-gate-method-11 () none) ;; 11 + (init! (_type_ int) none) ;; 9 + (disable (_type_) none) ;; 10 + (factory-boss-lightning-gate-method-11 (_type_ vector float float process) none) ;; 11 ) ) -|# -#| +;; +++factory-boss-setup:facboss-bomb-type +(defenum facboss-bomb-type + :type uint64 + (bomb0 0) + (bomb1 1) + (bomb2 2) + ) +;; ---factory-boss-setup:facboss-bomb-type + (deftype factory-boss (process-drawable) - ((center vector :inline :offset-assert 204) - (shot-timer uint64 :offset-assert 220) - (critter UNKNOWN 8 :offset-assert 236) - (ammo UNKNOWN 10 :offset-assert 492) - (catwalk-angle float :offset-assert 572) - (catwalk-vel float :offset-assert 576) - (bombs-to-drop int8 :offset-assert 580) - (bomb-type uint64 :offset-assert 588) - (root-angle float :offset-assert 596) - (machine-state UNKNOWN 4 :offset-assert 604) - (chosen-machine int8 :offset-assert 860) - (command-index int8 :offset-assert 861) - (command-timer uint64 :offset-assert 868) - (current-round int32 :offset-assert 876) - (hits-taken int8 :offset-assert 880) - (camera-timer uint64 :offset-assert 884) - (reticle-info factory-boss-reticle-info :inline :offset-assert 892) - (actor-group uint32 :offset-assert 940) - (actor-group-count int32 :offset-assert 944) - (launching-group basic :offset-assert 948) - (floor-targets UNKNOWN 7 :offset-assert 952) - (num-floor-targets int8 :offset-assert 959) - (reticle-sound uint32 :offset-assert 960) - (reticle-sound-playing basic :offset-assert 964) - (warp-blocker factory-boss-lightning-gate :inline :offset-assert 972) - (entry-blocker factory-boss-lightning-gate :inline :offset-assert 1020) + ((child (pointer process-drawable) :override) + (self factory-boss :override) + (center vector :inline :offset-assert 208) + (shot-timer time-frame :offset-assert 224) + (critter factory-boss-critter-tracker 8 :inline :offset-assert 240) + (ammo handle 10 :offset-assert 496) + (catwalk-angle float :offset-assert 576) + (catwalk-vel float :offset-assert 580) + (bombs-to-drop int8 :offset-assert 584) + (bomb-type facboss-bomb-type :offset-assert 592) + (root-angle float :offset-assert 600) + (machine-state factory-boss-machine-state 4 :inline :offset-assert 608) + (chosen-machine int8 :offset-assert 864) + (command-index int8 :offset-assert 865) + (command-timer time-frame :offset-assert 872) + (current-round int32 :offset-assert 880) + (hits-taken int8 :offset-assert 884) + (camera-timer time-frame :offset-assert 888) + (reticle-info factory-boss-reticle-info :inline :offset-assert 896) + (actor-group (pointer actor-group) :offset-assert 944) + (actor-group-count int32 :offset-assert 948) + (launching-group sparticle-launch-group :offset-assert 952) + (floor-targets int8 7 :offset-assert 956) + (num-floor-targets int8 :offset-assert 963) + (reticle-sound sound-id :offset-assert 964) + (reticle-sound-playing symbol :offset-assert 968) + (warp-blocker factory-boss-lightning-gate :inline :offset-assert 976) + (entry-blocker factory-boss-lightning-gate :inline :offset-assert 1024) ) :method-count-assert 31 :size-assert #x430 :flag-assert #x1f03b00430 + (:state-methods + beaten ;; 20 + run-to-machine + get-hit + launch-critters + drop-bombs + hidden + ) (:methods - (factory-boss-method-20 () none) ;; 20 - (factory-boss-method-21 () none) ;; 21 - (factory-boss-method-22 () none) ;; 22 - (factory-boss-method-23 () none) ;; 23 - (factory-boss-method-24 () none) ;; 24 - (factory-boss-method-25 () none) ;; 25 - (factory-boss-method-26 () none) ;; 26 - (factory-boss-method-27 () none) ;; 27 - (factory-boss-method-28 () none) ;; 28 - (factory-boss-method-29 () none) ;; 29 - (factory-boss-method-30 () none) ;; 30 + (factory-boss-method-26 (_type_ int vector vector symbol) symbol) ;; 26 + (factory-boss-method-27 (_type_ vector) symbol) ;; 27 + (next-catwalk-angle (_type_ int) float) ;; 28 + (factory-boss-method-29 (_type_ float vector) none) ;; 29 + (factory-boss-method-30 (_type_) none) ;; 30 ) ) -|# -#| (deftype hud-factory-boss (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype task-manager-factory-boss (task-manager) - ((button-up basic :offset-assert 240) + ((button-up symbol :offset-assert 240) ) :method-count-assert 33 :size-assert #xf4 :flag-assert #x21008000f4 (:methods - (task-manager-factory-boss-method-32 () none) ;; 32 + (task-manager-factory-boss-method-32 (_type_) none) ;; 32 ) ) -|# -#| (deftype fac-warp-effect (process-drawable) () :method-count-assert 21 @@ -56841,85 +56684,109 @@ idle ;; 20 ) ) -|# -;; (define-extern *factory-boss-dead-pool* object) -;; (define-extern *factory-boss-speech* object) -;; (define-extern reset-factory-boss-speeches function) -;; (define-extern factory-boss-play-speech function) -;; (define-extern fac-drop-plat-nocollide-init-by-other function) -;; (define-extern fac-drop-plat-setup-rots function) -;; (define-extern fac-drop-plat-rot-once function) -;; (define-extern fac-drop-plat-init-by-other function) -;; (define-extern factoryd-login function) -;; (define-extern factoryd-logout function) +(define-extern *factory-boss-dead-pool* dead-pool) +(define-extern *factory-boss-speech* factory-boss-speech-group) +(define-extern reset-factory-boss-speeches (function none)) +(define-extern factory-boss-play-speech (function int factory-boss none)) +(define-extern fac-drop-plat-nocollide-init-by-other (function entity-actor object :behavior fac-drop-plat-nocollide)) +(define-extern fac-drop-plat-setup-rots (function object :behavior fac-drop-plat)) +(define-extern fac-drop-plat-rot-once (function degrees object :behavior fac-drop-plat)) +(define-extern fac-drop-plat-init-by-other (function entity-actor object :behavior fac-drop-plat)) +(define-extern factoryd-login (function level none)) +(define-extern factoryd-logout (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; missile-bot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype missile-bot (nav-enemy) - ((traj trajectory :inline :offset-assert 624) + ((parent (pointer factory-boss) :override) + (traj trajectory :inline :offset-assert 624) (initial-y float :offset-assert 664) - (top-spin-jm basic :offset-assert 668) + (top-spin-jm joint-mod :offset-assert 668) (top-angle float :offset-assert 672) - (main-jm basic :offset-assert 676) + (main-jm joint-mod :offset-assert 676) (height-bob bouncing-float :inline :offset-assert 680) (height-bob-rand delayed-rand-float :inline :offset-assert 720) (main-wobble oscillating-vector :inline :offset-assert 752) (main-wobble-rand delayed-rand-vector :inline :offset-assert 816) - (thruster-part basic :offset-assert 864) - (lightning UNKNOWN 6 :offset-assert 868) - (lightning-wobble UNKNOWN 3 :offset-assert 896) - (lightning-wobble-rand UNKNOWN 3 :offset-assert 1088) + (thruster-part sparticle-launch-control :offset-assert 864) + (lightning lightning-control 6 :offset-assert 868) + (lightning-wobble oscillating-vector 3 :inline :offset-assert 896) + (lightning-wobble-rand delayed-rand-vector 3 :inline :offset-assert 1088) (lightning-mode uint64 :offset-assert 1232) - (lightning-timer uint64 :offset-assert 1240) - (lightning-sound uint32 :offset-assert 1248) - (lightning-sound-playing basic :offset-assert 1252) - (glows-on basic :offset-assert 1256) + (lightning-timer time-frame :offset-assert 1240) + (lightning-sound sound-id :offset-assert 1248) + (lightning-sound-playing symbol :offset-assert 1252) + (glows-on symbol :offset-assert 1256) (spin float :offset-assert 1260) - (engine-sound uint32 :offset-assert 1264) - (engine-sound-playing basic :offset-assert 1268) + (engine-sound sound-id :offset-assert 1264) + (engine-sound-playing symbol :offset-assert 1268) (explosion-sound-index int8 :offset-assert 1272) - (spin-whoosh-timer uint64 :offset-assert 1280) - (will-hit-errol basic :offset-assert 1288) - (spark-part basic :offset-assert 1292) - (spark-part-on basic :offset-assert 1296) - (spark-timer uint64 :offset-assert 1304) + (spin-whoosh-timer time-frame :offset-assert 1280) + (will-hit-errol symbol :offset-assert 1288) + (spark-part sparticle-launch-control :offset-assert 1292) + (spark-part-on symbol :offset-assert 1296) + (spark-timer time-frame :offset-assert 1304) ) :method-count-assert 195 :size-assert #x520 :flag-assert #xc304a00520 - (:methods - (missile-bot-method-194 () none) ;; 194 - ) (:state-methods - explode ;; 193 - lift-off ;; 192 - fizzle ;; 190 - die ;; 40 - hostile ;; 38 - kicked ;; 191 - notice ;; 35 knocked ;; 31 + notice ;; 35 + hostile ;; 38 + die ;; 40 jump ;; 44 + fizzle ;; 190 + kicked ;; 191 + lift-off ;; 192 + explode ;; 193 + ) + (:methods + (toggle-glow-sprites (_type_ symbol) none) ;; 194 ) ) -|# -;; (define-extern *missile-bot-nav-enemy-info* nav-enemy-info) -;; (define-extern stunned? function) -;; (define-extern missile-bot-get-kick-time function) -;; (define-extern missile-bot-find-dest function) +(define-extern *missile-bot-nav-enemy-info* nav-enemy-info) +(define-extern stunned? (function object :behavior missile-bot)) +(define-extern missile-bot-get-kick-time (function float float :behavior missile-bot)) +(define-extern missile-bot-find-dest (function vector vector :behavior missile-bot)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-boss-states ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++factory-boss-states:facboss-cmd +(defenum facboss-cmd + :type uint64 + (cmd1 1) + (cmd2 2) + (cmd3 3) + (cmd4 4) + (cmd5 5) + (cmd6 6) + (cmd7 7) + (cmd8 8) + (cmd9 9) + (cmd10 10) + (cmd11 11) + (cmd12 12) + (cmd13 13) + (cmd14 14) + (cmd15 15) + (cmd16 16) + (cmd17 17) + (cmd18 18) + (cmd19 19) + (cmd20 20) + (cmd21 21) + ) +;; ---factory-boss-states:facboss-cmd + (deftype factory-boss-command (structure) - ((action uint64 :offset-assert 0) + ((action facboss-cmd :offset-assert 0) (suck float :offset-assert 8) (random float :offset-assert 12) (round int8 :offset-assert 16) @@ -56928,59 +56795,58 @@ :size-assert #x11 :flag-assert #x900000011 ) -|# -;; (define-extern factory-boss-angle-sub function) -;; (define-extern factory-boss-target-pos function) -;; (define-extern factory-boss-move function) -;; (define-extern factory-boss-pick-machine function) -;; (define-extern factory-boss-pick-camera function) -;; (define-extern factory-boss-pick-pers-camera function) -;; (define-extern factory-boss-machine-angle function) -;; (define-extern factory-boss-approaching? function) -;; (define-extern factory-boss-move-to-dest-angle function) -;; (define-extern factory-boss-time-until-angle function) -;; (define-extern factory-boss-get-particle-spawn-points function) -;; (define-extern factory-boss-drop-bomb function) -;; (define-extern factory-boss-check-bomb-timer function) -;; (define-extern factory-boss-end-cutscene function) -;; (define-extern factory-boss-spawn-ring function) -;; (define-extern factory-boss-always function) -;; (define-extern factory-boss-always-handler function) -;; (define-extern factory-boss-handler function) -;; (define-extern *factory-boss-swarm-0* array) -;; (define-extern *factory-boss-swarm-1* array) -;; (define-extern *factory-boss-swarm-2* array) -;; (define-extern *factory-boss-swarm-3* array) -;; (define-extern *factory-boss-swarm-4* array) -;; (define-extern factory-boss-launch-critter-handler function) -;; (define-extern factory-boss-advance-launch-script function) -;; (define-extern factory-boss-check-launch-script function) -;; (define-extern factory-boss-launch-critter function) -;; (define-extern factory-boss-launch-critter-pick-anim function) -;; (define-extern factory-boss-pick-floor-targets function) +(define-extern factory-boss-angle-sub (function degrees degrees degrees :behavior factory-boss)) +(define-extern factory-boss-target-pos (function vector int int vector :behavior factory-boss)) +(define-extern factory-boss-move (function none :behavior factory-boss)) +(define-extern factory-boss-pick-machine (function none :behavior factory-boss)) +(define-extern factory-boss-pick-camera (function none :behavior factory-boss)) +(define-extern factory-boss-pick-pers-camera (function none :behavior factory-boss)) +(define-extern factory-boss-machine-angle (function float :behavior factory-boss)) +(define-extern factory-boss-approaching? (function degrees symbol :behavior factory-boss)) +(define-extern factory-boss-move-to-dest-angle (function float float symbol :behavior factory-boss)) +(define-extern factory-boss-time-until-angle (function degrees time-frame :behavior factory-boss)) +(define-extern factory-boss-get-particle-spawn-points (function int vector vector matrix none :behavior factory-boss)) +(define-extern factory-boss-drop-bomb (function int (pointer process) :behavior factory-boss)) +(define-extern factory-boss-check-bomb-timer (function int symbol :behavior factory-boss)) +(define-extern factory-boss-end-cutscene (function none :behavior factory-boss)) +(define-extern factory-boss-spawn-ring (function matrix vector factory-boss-machine-state none :behavior factory-boss)) +(define-extern factory-boss-always (function none :behavior factory-boss)) +(def-event-handler factory-boss-always-handler factory-boss) +(def-event-handler factory-boss-handler factory-boss) +(define-extern *factory-boss-swarm-0* (array factory-boss-command)) +(define-extern *factory-boss-swarm-1* (array factory-boss-command)) +(define-extern *factory-boss-swarm-2* (array factory-boss-command)) +(define-extern *factory-boss-swarm-3* (array factory-boss-command)) +(define-extern *factory-boss-swarm-4* (array factory-boss-command)) +(def-event-handler factory-boss-launch-critter-handler factory-boss) +(define-extern factory-boss-advance-launch-script (function none :behavior factory-boss)) +(define-extern factory-boss-check-launch-script (function int :behavior factory-boss)) +(define-extern factory-boss-launch-critter (function int symbol :behavior factory-boss)) +(define-extern factory-boss-launch-critter-pick-anim (function int none :behavior factory-boss)) +(define-extern factory-boss-pick-floor-targets (function int int none :behavior factory-boss)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-boss-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-fbme-dust-color* curve-color-fast) -;; (define-extern *range-fbme-dust-alpha* curve2d-fast) -;; (define-extern *range-fbme-dust-scale-x* curve2d-fast) -;; (define-extern *range-fbme-dust-scale-y* curve2d-fast) -;; (define-extern *curve-fbme-dust-alpha* curve2d-fast) -;; (define-extern *curve-fbme-dust-scale-x* curve2d-fast) -;; (define-extern *curve-fbme-dust-scale-y* curve2d-fast) -;; (define-extern *part-fac-boss-missile-explosion-dust-in-curve-settings* object) -;; (define-extern *range-fbme-color* curve-color-fast) -;; (define-extern *range-fbme-alpha* curve2d-fast) -;; (define-extern *range-fbme-scale-x* curve2d-fast) -;; (define-extern *range-fbme-scale-y* curve2d-fast) -;; (define-extern *curve-fbme-alpha* curve2d-fast) -;; (define-extern *curve-fbme-scale-x* curve2d-fast) -;; (define-extern *curve-fbme-scale-y* curve2d-fast) -;; (define-extern *part-fac-boss-missile-explosion-texture-curve-settings* object) -;; (define-extern spt-birth-func-part-factory-debris-trails function) +(define-extern *range-fbme-dust-color* curve-color-fast) +(define-extern *range-fbme-dust-alpha* curve2d-fast) +(define-extern *range-fbme-dust-scale-x* curve2d-fast) +(define-extern *range-fbme-dust-scale-y* curve2d-fast) +(define-extern *curve-fbme-dust-alpha* curve2d-fast) +(define-extern *curve-fbme-dust-scale-x* curve2d-fast) +(define-extern *curve-fbme-dust-scale-y* curve2d-fast) +(define-extern *part-fac-boss-missile-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-fbme-color* curve-color-fast) +(define-extern *range-fbme-alpha* curve2d-fast) +(define-extern *range-fbme-scale-x* curve2d-fast) +(define-extern *range-fbme-scale-y* curve2d-fast) +(define-extern *curve-fbme-alpha* curve2d-fast) +(define-extern *curve-fbme-scale-x* curve2d-fast) +(define-extern *curve-fbme-scale-y* curve2d-fast) +(define-extern *part-fac-boss-missile-explosion-texture-curve-settings* particle-curve-settings) +(define-extern spt-birth-func-part-factory-debris-trails (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; nst-eggs-h ;; @@ -57231,66 +57097,65 @@ ;; hover-nav-factoryd ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *factoryd-adjacency* object) +(define-extern *factoryd-adjacency* nav-network-data) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fac-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *range-ffexplo-dust-color* curve-color-fast) -;; (define-extern *range-ffexplo-dust-alpha* curve2d-fast) -;; (define-extern *range-ffexplo-dust-scale-x* curve2d-fast) -;; (define-extern *range-ffexplo-dust-scale-y* curve2d-fast) -;; (define-extern *curve-ffexplo-dust-alpha* curve2d-fast) -;; (define-extern *curve-ffexplo-dust-scale-x* curve2d-fast) -;; (define-extern *curve-ffexplo-dust-scale-y* curve2d-fast) -;; (define-extern *part-fac-fighter-explosion-dust-in-curve-settings* object) -;; (define-extern *range-ffexplo-color* curve-color-fast) -;; (define-extern *range-ffexplo-alpha* curve2d-fast) -;; (define-extern *range-ffexplo-scale-x* curve2d-fast) -;; (define-extern *range-ffexplo-scale-y* curve2d-fast) -;; (define-extern *curve-ffexplo-alpha* curve2d-fast) -;; (define-extern *curve-ffexplo-scale-x* curve2d-fast) -;; (define-extern *curve-ffexplo-scale-y* curve2d-fast) -;; (define-extern *part-fac-fighter-explosion-texture-curve-settings* object) -;; (define-extern *range-fgtexplo-color* curve-color-fast) -;; (define-extern *range-fgtexplo-alpha* curve2d-fast) -;; (define-extern *range-fgtexplo-scale-x* curve2d-fast) -;; (define-extern *range-fgtexplo-scale-y* curve2d-fast) -;; (define-extern *curve-fgtexplo-alpha* curve2d-fast) -;; (define-extern *curve-fgtexplo-scale-x* curve2d-fast) -;; (define-extern *curve-fgtexplo-scale-y* curve2d-fast) -;; (define-extern *part-fac-tower-explosion-texture-curve-settings* object) -;; (define-extern *range-ftexplo-dust-color* curve-color-fast) -;; (define-extern *range-ftexplo-dust-alpha* curve2d-fast) -;; (define-extern *range-ftexplo-dust-scale-x* curve2d-fast) -;; (define-extern *range-ftexplo-dust-scale-y* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-alpha* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) -;; (define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) -;; (define-extern *part-fac-tank-explosion-dust-in-curve-settings* object) -;; (define-extern *range-ftexplo-color* curve-color-fast) -;; (define-extern *range-ftexplo-alpha* curve2d-fast) -;; (define-extern *range-ftexplo-scale-x* curve2d-fast) -;; (define-extern *range-ftexplo-scale-y* curve2d-fast) -;; (define-extern *curve-ftexplo-alpha* curve2d-fast) -;; (define-extern *curve-ftexplo-scale-x* curve2d-fast) -;; (define-extern *curve-ftexplo-scale-y* curve2d-fast) -;; (define-extern *part-fac-tank-explosion-texture-curve-settings* object) -;; (define-extern *range-gthoexplo-color* curve-color-fast) -;; (define-extern *range-gthoexplo-alpha* curve2d-fast) -;; (define-extern *range-gthoexplo-scale-x* curve2d-fast) -;; (define-extern *range-gthoexplo-scale-y* curve2d-fast) -;; (define-extern *curve-gthoexplo-alpha* curve2d-fast) -;; (define-extern *curve-gthoexplo-scale-x* curve2d-fast) -;; (define-extern *curve-gthoexplo-scale-y* curve2d-fast) -;; (define-extern *part-gun-tower-hit-object-texture-curve-settings* object) +(define-extern *range-ffexplo-dust-color* curve-color-fast) +(define-extern *range-ffexplo-dust-alpha* curve2d-fast) +(define-extern *range-ffexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ffexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ffexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ffexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ffexplo-dust-scale-y* curve2d-fast) +(define-extern *part-fac-fighter-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-ffexplo-color* curve-color-fast) +(define-extern *range-ffexplo-alpha* curve2d-fast) +(define-extern *range-ffexplo-scale-x* curve2d-fast) +(define-extern *range-ffexplo-scale-y* curve2d-fast) +(define-extern *curve-ffexplo-alpha* curve2d-fast) +(define-extern *curve-ffexplo-scale-x* curve2d-fast) +(define-extern *curve-ffexplo-scale-y* curve2d-fast) +(define-extern *part-fac-fighter-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *range-fgtexplo-color* curve-color-fast) +(define-extern *range-fgtexplo-alpha* curve2d-fast) +(define-extern *range-fgtexplo-scale-x* curve2d-fast) +(define-extern *range-fgtexplo-scale-y* curve2d-fast) +(define-extern *curve-fgtexplo-alpha* curve2d-fast) +(define-extern *curve-fgtexplo-scale-x* curve2d-fast) +(define-extern *curve-fgtexplo-scale-y* curve2d-fast) +(define-extern *part-fac-tower-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *range-ftexplo-dust-color* curve-color-fast) +(define-extern *range-ftexplo-dust-alpha* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *part-fac-tank-explosion-dust-in-curve-settings* particle-curve-settings) +(define-extern *range-ftexplo-color* curve-color-fast) +(define-extern *range-ftexplo-alpha* curve2d-fast) +(define-extern *range-ftexplo-scale-x* curve2d-fast) +(define-extern *range-ftexplo-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-alpha* curve2d-fast) +(define-extern *curve-ftexplo-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-scale-y* curve2d-fast) +(define-extern *part-fac-tank-explosion-texture-curve-settings* particle-curve-settings) +(define-extern *range-gthoexplo-color* curve-color-fast) +(define-extern *range-gthoexplo-alpha* curve2d-fast) +(define-extern *range-gthoexplo-scale-x* curve2d-fast) +(define-extern *range-gthoexplo-scale-y* curve2d-fast) +(define-extern *curve-gthoexplo-alpha* curve2d-fast) +(define-extern *curve-gthoexplo-scale-x* curve2d-fast) +(define-extern *curve-gthoexplo-scale-y* curve2d-fast) +(define-extern *part-gun-tower-hit-object-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype factory-states (structure) ((light light-state :inline :offset-assert 0) (blink0 float :offset-assert 8) @@ -57300,9 +57165,7 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype factoryd-states (structure) ((electricity electricity-state :inline :offset-assert 0) ) @@ -57310,44 +57173,41 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -;; (define-extern update-mood-factory function) -;; (define-extern update-mood-factoryd function) -;; (define-extern set-factoryd-light! function) +(define-extern update-mood-factory (function mood-context float int none :behavior time-of-day-proc)) +(define-extern update-mood-factoryd (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-factoryd-light! (function float none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern *war-factory-vehicle-mask* object) -;; (define-extern *war-factory-effects-mask* object) -;; (define-extern *range-fac-dust-color* curve-color-fast) -;; (define-extern *range-fac-dust-alpha* curve2d-fast) -;; (define-extern *range-fac-dust-scale-x* curve2d-fast) -;; (define-extern *range-fac-dust-scale-y* curve2d-fast) -;; (define-extern *curve-fac-dust-alpha* curve2d-fast) -;; (define-extern *curve-fac-dust-scale-x* curve2d-fast) -;; (define-extern *curve-fac-dust-scale-y* curve2d-fast) -;; (define-extern *part-hellcat-dust-landing-fac-curve-settings* object) +(define-extern *war-factory-vehicle-mask* uint) +(define-extern *war-factory-effects-mask* uint) +(define-extern *range-fac-dust-color* curve-color-fast) +(define-extern *range-fac-dust-alpha* curve2d-fast) +(define-extern *range-fac-dust-scale-x* curve2d-fast) +(define-extern *range-fac-dust-scale-y* curve2d-fast) +(define-extern *curve-fac-dust-alpha* curve2d-fast) +(define-extern *curve-fac-dust-scale-x* curve2d-fast) +(define-extern *curve-fac-dust-scale-y* curve2d-fast) +(define-extern *part-hellcat-dust-landing-fac-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factoryc-manager ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-factory-assault (task-manager) - ((explode-car-time uint64 :offset-assert 240) - (daxter-done basic :offset-assert 248) - (region-hack basic :offset-assert 252) + ((explode-car-time time-frame :offset-assert 240) + (daxter-done symbol :offset-assert 248) + (region-hack symbol :offset-assert 252) ) :method-count-assert 32 :size-assert #x100 :flag-assert #x2000800100 ) -|# -;; (define-extern factoryd-activate function) +(define-extern factoryd-activate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; was-squad-control ;; @@ -57407,7 +57267,7 @@ (define-extern *was-squad-manager* object) (def-event-handler was-squad-manager-event-handler was-squad-manager) (define-extern was-squad-manager-init-by-other (function object :behavior was-squad-manager)) -(define-extern was-squad-manager-start (function process none)) +(define-extern was-squad-manager-start (function process (pointer process))) (define-extern was-squad-manager-kill (function none)) (define-extern wvh (function none)) @@ -57434,9 +57294,23 @@ ) ;; ---wvehicle-h:vehicle-wheel-surface-flag +;; +++wvehicle-h:vehicle-wheel-surface-type +(defenum vehicle-wheel-surface-type + :type uint8 + (stone) + (dirt) + (sand) + (quicksand) + (water) + (wall) + (conveyor) + (none) + ) +;; ---wvehicle-h:vehicle-wheel-surface-type + (deftype vehicle-wheel-surface (structure) ((flags vehicle-wheel-surface-flag :offset-assert 0) - (surface-type uint8 :offset-assert 1) + (surface-type vehicle-wheel-surface-type :offset-assert 1) (friction float :offset-assert 4) (drag float :offset-assert 8) (depth float :offset-assert 12) @@ -58576,26 +58450,26 @@ ;; ai-task-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type ai-task-pool basic) +(declare-type bot nav-enemy) + (deftype ai-task (basic) ((next ai-task :offset-assert 4) ;; guessed by decompiler (prev ai-task :offset-assert 8) ;; guessed by decompiler (pool ai-task-pool :offset-assert 12) ;; guessed by decompiler (unique-id uint32 :offset-assert 16) - (bytes int8 16 :offset-assert 32) ;; guessed by decompiler + (bytes int8 16 :offset 32) ;; guessed by decompiler ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 (:methods - (ai-task-method-9 () none) ;; 9 ;; (reset-task! (_type_) none) - (ai-task-method-10 () none) ;; 10 ;; (ai-task-method-10 (_type_ bot) none) - (ai-task-method-11 () none) ;; 11 ;; (ai-task-method-11 (_type_ bot) none) + (reset-task! (_type_) none) ;; 9 + (ai-task-method-10 (_type_ bot) none) ;; 10 + (ai-task-method-11 (_type_ bot) object) ;; 11 ) ) -|# -#| (deftype ai-task-pool (basic) ((anchor ai-task :offset-assert 4) ;; guessed by decompiler (tasks (pointer uint32) :offset-assert 8) ;; guessed by decompiler @@ -58606,14 +58480,12 @@ :size-assert #x14 :flag-assert #xc00000014 (:methods - (ai-task-pool-method-9 () none) ;; 9 ;; (assign-ids! (_type_ type) ai-task) - (ai-task-pool-method-10 () none) ;; 10 ;; (set-next-task! (_type_ ai-task) none) - (ai-task-pool-method-11 () none) ;; 11 ;; (ai-task-pool-method-11 (_type_) ai-task) + (assign-ids! (_type_ type) ai-task) ;; 9 + (set-next-task! (_type_ ai-task) ai-task) ;; 10 + (ai-task-pool-method-11 (_type_) ai-task) ;; 11 ) ) -|# -#| (deftype ai-task-control (basic) ((anchor ai-task :offset-assert 4) ;; guessed by decompiler (pool ai-task-pool :offset-assert 8) ;; guessed by decompiler @@ -58622,26 +58494,23 @@ :size-assert #xc :flag-assert #x120000000c (:methods - (new (symbol type) _type_) ;; 0 ;; (new (symbol type ai-task-pool) _type_) - (ai-task-control-method-9 () none) ;; 9 ;; (ai-task-control-method-9 (_type_) none) - (ai-task-control-method-10 () none) ;; 10 ;; (ai-task-control-method-10 (_type_ bot) none) - (ai-task-control-method-11 () none) ;; 11 ;; (get-task-by-type (_type_ type bot) ai-task) - (ai-task-control-method-12 () none) ;; 12 ;; (ai-task-control-method-12 (_type_ bot) symbol) - (ai-task-control-method-13 () none) ;; 13 ;; (ai-task-control-method-13 (_type_ ai-task bot) ai-task) - (ai-task-control-method-14 () none) ;; 14 ;; (ai-task-control-method-14 (_type_ ai-task bot) none) - (ai-task-control-method-15 () none) ;; 15 ;; (init-task! (_type_ type bot) ai-task) - (ai-task-control-method-16 () none) ;; 16 ;; (set-next-task-for-pool! (_type_ ai-task) none) - (ai-task-control-method-17 () none) ;; 17 ;; (set-next-task! (_type_ ai-task) none) + (new (symbol type ai-task-pool) _type_) ;; 0 + (ai-task-control-method-9 (_type_) symbol) ;; 9 + (ai-task-control-method-10 (_type_ bot) none) ;; 10 + (get-task-by-type (_type_ type bot) ai-task) ;; 11 + (ai-task-control-method-12 (_type_ bot) symbol) ;; 12 + (ai-task-control-method-13 (_type_ ai-task bot) ai-task) ;; 13 + (ai-task-control-method-14 (_type_ ai-task bot) none) ;; 14 + (init-task! (_type_ type bot) ai-task) ;; 15 + (set-next-task-for-pool! (_type_ ai-task) none) ;; 16 + (set-next-task! (_type_ ai-task) ai-task) ;; 17 ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; simple-focus ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype simple-focus (process-focusable) ((first-time? symbol :offset-assert 208) ;; guessed by decompiler ) @@ -58652,15 +58521,13 @@ idle ;; 28 ) ) -|# -;; (define-extern simple-focus-init-by-other function) ;; (function none :behavior simple-focus) +(define-extern simple-focus-init-by-other (function object :behavior simple-focus)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bot-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype bot-focus-info (structure) ((max-los-dist float :offset-assert 0) (fproc process-focusable :offset-assert 4) ;; guessed by decompiler @@ -58669,7 +58536,7 @@ (my-facing-ry float :offset-assert 16) (bullseye-ry float :offset-assert 20) (los int8 :offset-assert 24) - (update-time uint64 :offset-assert 32) ;; time-frame + (update-time time-frame :offset-assert 32) ;; time-frame (bullseye vector :inline :offset-assert 48) (pos vector :inline :offset-assert 64) (my-facing-xz-dir vector :inline :offset-assert 80) @@ -58679,9 +58546,7 @@ :size-assert #x70 :flag-assert #x900000070 ) -|# -#| (deftype bot-turn-info (structure) ((facing-ry float :offset-assert 0) (targ-ry float :offset-assert 4) @@ -58697,9 +58562,7 @@ :size-assert #x60 :flag-assert #x900000060 ) -|# -#| (deftype bot-speech-tuning (structure) ((fo-min int32 :offset-assert 0) (fo-max int32 :offset-assert 4) @@ -58710,12 +58573,32 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| +;; +++bot-h:bot-speech-info-flag +(defenum bot-speech-info-flag + :type uint16 + :bitfield #t + (playing) + (sf01) + (sf02) + (sf03) + (sf04) + (sf05) + (sf06) + (sf08) + (sf09) + (sf10) + (sf11) + (sf12) + (sf13) + (sf14) + (sf15) + ) +;; ---bot-h:bot-speech-info-flag + (deftype bot-speech-info (structure) - ((flags uint16 :offset-assert 0) ;; speech-flags - (hold-time uint16 :offset-assert 2) + ((flags bot-speech-info-flag :offset-assert 0) + (hold-time uint16 :offset-assert 2 :decomp-as time-frame) (slave-id int8 :offset-assert 4) (tuning-id int8 :offset-assert 5) (name string :offset-assert 8) ;; guessed by decompiler @@ -58724,31 +58607,27 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype bot-spot (structure) ((center vector :inline :offset-assert 0) - (center-x float :offset-assert 0) - (center-y float :offset-assert 4) - (center-z float :offset-assert 8) - (inside-xz-dist float :offset-assert 12) + (center-x float :offset 0) + (center-y float :offset 4) + (center-z float :offset 8) + (inside-xz-dist float :offset 12) (blocked-xz-dist float :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| (deftype bot-waypoint (basic) ((waypoint-id int16 :offset-assert 4) (nav-mesh-index int8 :offset-assert 6) (skip-to int8 :offset-assert 7) - (on-set (function bot none) :offset-assert 8) ;; guessed by decompiler - (on-update (function bot none) :offset-assert 12) ;; guessed by decompiler - (on-skipping-here (function bot none) :offset-assert 16) ;; guessed by decompiler + (on-set (function bot object) :offset-assert 8) ;; guessed by decompiler + (on-update (function bot object) :offset-assert 12) ;; guessed by decompiler + (on-skipping-here (function bot object) :offset-assert 16) ;; guessed by decompiler (check-too-far symbol :offset-assert 20) ;; guessed by decompiler (warn-dist float :offset-assert 24) (fail-dist-delta float :offset-assert 28) @@ -58758,9 +58637,9 @@ :flag-assert #x900000020 ;; field check-too-far uses ~A with a signed load. ) -|# -#| +(declare-type bot-speech-list basic) +(declare-type bot-speech-list-shuffle bot-speech-list) (deftype bot-course (basic) ((course-id uint8 :offset-assert 4) (speech-count uint16 :offset-assert 6) @@ -58781,11 +58660,86 @@ :flag-assert #x900000030 ;; field default-check-too-far uses ~A with a signed load. ) -|# -#| +;; +++bot-h:bot-flag +(defenum bot-flag + :type uint32 + :bitfield #t + (bf00 0) + (failed 1) + (bf02 2) + (bf03 3) + (bf04 4) + (bf05 5) + (bf06 6) + (attacked 7) + (too-far-fail 8) + (bf09 9) + (bf10 10) + (bf11 11) + (bf12 12) + (bf13 13) + (bf14 14) + (bf15 15) + (bf16 16) + (bf17 17) + (bf18 18) + (bf19 19) + (bf20 20) + (bf21 21) + (bf22 22) + (bf23 23) + (bf24 24) + (bf25 25) + (bf26 26) + (bf27 27) + (bf28 28) + (bf29 29) + (bf30 30) + (bf31 31) + ) +;; ---bot-h:bot-flag + +;; +++bot-h:bot-task-bits +(defenum bot-task-bits + :type uint32 + :bitfield #t + (bb0) + (bb1) + (bb2) + (bb3) + (bb4) + (bb5) + (bb6) + (bb7) + ) +;; ---bot-h:bot-task-bits + +;; +++bot-h:waypoint-bits +(defenum waypoint-bits + :bitfield #t + :type uint32 + (wb0) + (wb1) + (wb2) + (wb3) + (wb4) + (wb5) + (wb6) + (wb7) + ) +;; ---bot-h:waypoint-bits + +;; +++bot-h:waypoint-bits-s32 +(defenum waypoint-bits-s32 + :bitfield #t + :type int32 + :copy-entries waypoint-bits + ) +;; ---bot-h:waypoint-bits-s32 + (deftype bot (nav-enemy) - ((bot-flags bot-flags :offset-assert 620) ;; guessed by decompiler + ((bot-flags bot-flag :offset-assert 620) ;; guessed by decompiler (min-speed float :offset-assert 624) (max-speed float :offset-assert 628) (follow-offset float :offset-assert 632) @@ -58800,7 +58754,7 @@ (course bot-course :offset-assert 668) ;; guessed by decompiler (waypoint bot-waypoint :offset-assert 672) ;; guessed by decompiler (waypoint-bits waypoint-bits :offset-assert 676) ;; guessed by decompiler - (waypoint-int32a int32 :offset-assert 680) + (waypoint-int32a waypoint-bits-s32 :offset-assert 680) (bot-task-bits bot-task-bits :offset-assert 684) ;; guessed by decompiler (hit-invuln-ignore-me-delay uint32 :offset-assert 688) (hit-invuln-focus-disable-delay uint32 :offset-assert 692) @@ -58812,7 +58766,7 @@ (hit-by-enemy-count uint16 :offset-assert 714) (hit-by-player-count uint16 :offset-assert 716) (notice-enemy-dist float :offset-assert 720) - (channel uint8 :offset-assert 724) ;; gui-channel + (channel gui-channel :offset-assert 724) ;; gui-channel (focus-mode int8 :offset-assert 725) (nav-mesh-index int8 :offset-assert 726) (delay-too-far-check int8 :offset-assert 727) @@ -58820,21 +58774,21 @@ (vehicle-seat-index int8 :offset-assert 729) (bot-health-index int8 :offset-assert 730) (task game-task-control :offset-assert 732) ;; guessed by decompiler - (task-node basic :offset-assert 736) + (task-node game-task-node-info :offset-assert 736) (swivel-joint-mod joint-mod :offset-assert 740) ;; guessed by decompiler - (health-handle uint64 :offset-assert 744) ;; handle - (poi-handle uint64 :offset-assert 752) ;; handle + (health-handle handle :offset-assert 744) ;; handle + (poi-handle handle :offset-assert 752) ;; handle (my-simple-focus (pointer simple-focus) :offset-assert 760) ;; guessed by decompiler - (attacker-handle uint64 :offset-assert 768) ;; handle - (scene-player-handle uint64 :offset-assert 776) ;; handle - (master-handle uint64 :offset-assert 784) ;; handle - (vehicle-handle uint64 :offset-assert 792) ;; handle - (hit-invuln-starting-time uint64 :offset-assert 800) ;; time-frame - (danger-time uint64 :offset-assert 808) ;; time-frame - (attacker-time uint64 :offset-assert 816) ;; time-frame - (started-warning-time uint64 :offset-assert 824) ;; time-frame - (waypoint-time0 uint64 :offset-assert 832) ;; time-frame - (next-too-far-warn-time uint64 :offset-assert 840) ;; time-frame + (attacker-handle handle :offset-assert 768) ;; handle + (scene-player-handle handle :offset-assert 776) ;; handle + (master-handle handle :offset-assert 784) ;; handle + (vehicle-handle handle :offset-assert 792) ;; handle + (hit-invuln-starting-time time-frame :offset-assert 800) ;; time-frame + (danger-time time-frame :offset-assert 808) ;; time-frame + (attacker-time time-frame :offset-assert 816) ;; time-frame + (started-warning-time time-frame :offset-assert 824) ;; time-frame + (waypoint-time0 time-frame :offset-assert 832) ;; time-frame + (next-too-far-warn-time time-frame :offset-assert 840) ;; time-frame (spot bot-spot :inline :offset-assert 848) (follow-dir vector :inline :offset-assert 880) (focus-info bot-focus-info :inline :offset-assert 896) @@ -58842,61 +58796,72 @@ :method-count-assert 237 :size-assert #x3f0 :flag-assert #xed037003f0 + (:state-methods + failed + hidden + ) (:methods - (bot-method-190 () none) ;; 190 ;; (bot-method-190 (_type_) symbol) - (bot-method-191 () none) ;; 191 ;; (bot-method-191 (_type_) none) - (bot-method-192 () none) ;; 192 ;; (bot-method-192 (_type_) none) - (bot-method-193 () none) ;; 193 ;; (bot-method-193 (_type_) symbol) - (bot-method-194 () none) ;; 194 ;; (outside-spot-radius? (_type_ bot-spot vector symbol) symbol) - (bot-method-195 () none) ;; 195 ;; (attacked-by-player? (_type_ process-focusable) symbol) - (bot-method-196 () none) ;; 196 ;; (bot-method-196 (_type_) none) - (bot-method-197 () none) ;; 197 ;; (fail-mission! (_type_) none) - (bot-method-198 () none) ;; 198 ;; (set-cam-height! (_type_ vector) meters) - (bot-method-199 () none) ;; 199 ;; (cam-move-to-bot (_type_) none) - (bot-method-200 () none) ;; 200 ;; (fail-falling (_type_) none) - (bot-method-201 () none) ;; 201 ;; (set-next-focus! (_type_ enemy enemy-best-focus) none) - (bot-method-202 () none) ;; 202 ;; (choose-spot (_type_ int (pointer uint)) int) - (bot-method-203 () none) ;; 203 ;; (play-attacked-speech (_type_) none) - (bot-method-204 () none) ;; 204 ;; (play-too-far-warn-speech (_type_) symbol) - (bot-method-205 () none) ;; 205 ;; (scene-play (_type_ string symbol) symbol) - (bot-method-206 () none) ;; 206 ;; (play-speech (_type_ int) none) - (bot-method-207 () none) ;; 207 ;; (play-death-sound (_type_ string) none) - (bot-method-208 () none) ;; 208 ;; (bot-method-208 (_type_) symbol) - (bot-method-209 () none) ;; 209 ;; (channel-active? (_type_ gui-channel) symbol) - (bot-method-210 () none) ;; 210 ;; (init! (_type_) none) - (bot-method-211 () none) ;; 211 ;; (clear-speech-flags! (_type_) none) - (bot-method-212 () none) ;; 212 ;; (reset-warn-time! (_type_) none) - (bot-method-213 () none) ;; 213 ;; (go-to-waypoint! (_type_ int symbol) object) - (bot-method-214 () none) ;; 214 ;; (bot-method-214 (_type_) symbol) - (bot-method-215 () none) ;; 215 ;; (skip-waypoint (_type_) object) - (bot-method-216 () none) ;; 216 ;; (bot-method-216 (_type_) none) - (bot-method-217 () none) ;; 217 ;; (speech-ended? (_type_ int) symbol) - (bot-method-218 () none) ;; 218 ;; (speech-playing? (_type_ int) symbol) - (bot-method-219 () none) ;; 219 ;; (player-blocking-spot? (_type_ bot-spot) symbol) - (bot-method-220 () none) ;; 220 ;; (stop-speech (_type_ uint symbol) none) - (bot-method-221 () none) ;; 221 ;; (bot-method-221 (_type_) quaternion) - (bot-method-222 () none) ;; 222 ;; (bot-method-222 (_type_ vector) none) - (bot-method-223 () none) ;; 223 ;; (bot-method-223 (_type_ symbol) none) - (bot-method-224 () none) ;; 224 ;; (bot-check-too-far (_type_) symbol) - (bot-method-225 () none) ;; 225 - (bot-method-226 () none) ;; 226 - (bot-method-227 () none) ;; 227 - (bot-method-228 () none) ;; 228 - (bot-method-229 () none) ;; 229 - (bot-method-230 () none) ;; 230 - (bot-method-231 () none) ;; 231 - (bot-method-232 () none) ;; 232 - (bot-method-233 () none) ;; 233 - (bot-method-234 () none) ;; 234 - (bot-method-235 () none) ;; 235 - (bot-method-236 () none) ;; 236 + (clear-poi (_type_) none) ;; 192 + (bot-method-193 (_type_ vector vector vector vector vector float) none) ;; 193 + (bot-method-194 (_type_ bot-turn-info process-focusable float) float) ;; 194 + (alive? (_type_) symbol) ;; 195 + (bot-method-196 (_type_) none) ;; 196 ;; + (debug-draw-spot (_type_ bot-spot rgba) symbol) ;; 197 ;; (fail-mission! (_type_) none) + (bot-method-198 (_type_ int (pointer uint8) int) symbol) ;; 198 + (bot-method-199 (_type_) none) ;; 199 + (scene-stop (_type_) symbol) ;; 200 ;; (fail-falling (_type_) none) + (bot-method-201 (_type_) process) ;; 201 + (bot-method-202 (_type_) symbol) ;; 202 + (bot-method-203 (_type_) none) ;; 203 ;; (play-attacked-speech (_type_) none) + (bot-method-204 (_type_) none) ;; 204 ;; (play-too-far-warn-speech (_type_) symbol) + (bot-method-205 (_type_) symbol) ;; 205 + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol) ;; 206 ;; (play-speech (_type_ int) none) + (attacked-by-player? (_type_ process-focusable) object) ;; 207 ;; (play-death-sound (_type_ string) none) + (set-fail-flag (_type_) none) ;; 208 ;; (bot-method-208 (_type_) symbol) + (bot-method-209 (_type_) none) ;; 209 ;; (channel-active? (_type_ gui-channel) symbol) + (set-cam-height (_type_ vector) float) ;; 210 + (cam-move-to-bot (_type_) none) ;; 211 ;; (clear-speech-flags! (_type_) none) + (bot-method-212 (_type_) none) ;; 212 + (set-next-focus! (_type_ enemy enemy-best-focus) enemy) ;; 213 ;; + (choose-spot (_type_ int (pointer uint8)) int) ;; 214 + (play-next-speech (_type_) gui-connection) ;; 215 ;; (skip-waypoint (_type_) object) + (bot-method-216 (_type_) none) ;; 216 ;; (bot-method-216 (_type_) none) + (scene-play (_type_ scene symbol) symbol) ;; 217 ;; (speech-ended? (_type_ int) symbol) + (play-speech-by-id (_type_ int) gui-connection) ;; 218 ;; (speech-playing? (_type_ int) symbol) + (play-speech-by-name (_type_ string) sound-id) ;; 219 ;; (player-blocking-spot? (_type_ bot-spot) symbol) + (bot-method-220 (_type_) symbol) ;; 220 ;; (stop-speech (_type_ uint symbol) none) + (channel-active? (_type_ gui-channel) symbol) ;; 221 + (init-fields! (_type_) none) ;; 222 ;; (bot-method-222 (_type_ vector) none) + (bot-method-223 (_type_) none) ;; 223 ;; (bot-method-223 (_type_ symbol) none) + (reset-warn-time (_type_) none) ;; 224 + (go-to-waypoint! (_type_ int symbol) object) ;; 225 + (bot-method-226 (_type_) object) ;; 226 + (skip-waypoint (_type_) object) ;; 227 + (bot-method-228 (_type_) none) ;; 228 + (course-speech-ended? (_type_ int) symbol) ;; 229 + (course-speech-playing? (_type_ int) symbol) ;; 230 + (player-blocking-spot? (_type_ bot-spot) symbol) ;; 231 + (bot-method-232 (_type_ gui-channel symbol) int) ;; 232 + (bot-method-233 (_type_) quaternion) ;; 233 + (bot-method-234 (_type_ vector) none) ;; 234 + (bot-method-235 (_type_ symbol) none) ;; 235 + (bot-check-too-far (_type_) symbol) ;; 236 ) ) -|# -#| +;; +++bot-h:bot-speech-list-flag +(defenum bot-speech-list-flag + :type uint8 + :bitfield #t + (bsl0 0) + (bsl1 1) + (bsl2 2) + (bsl3 3) + ) +;; ---bot-h:bot-speech-list-flag + (deftype bot-speech-list (basic) - ((flags uint8 :offset-assert 4) + ((flags bot-speech-list-flag :offset-assert 4) (retry-cookie uint8 :offset-assert 5) (last-local-index int16 :offset-assert 6) (speech-indexes (array int16) :offset-assert 8) ;; guessed by decompiler @@ -58905,13 +58870,11 @@ :size-assert #xc :flag-assert #xb0000000c (:methods - (bot-speech-list-method-9 () none) ;; 9 ;; (bot-speech-list-method-9 (_type_ bot (inline-array bot-speech-info) speech-flags) int) - (bot-speech-list-method-10 () none) ;; 10 ;; (reset-index (_type_ symbol) none) + (get-next-speech-idx (_type_ bot (inline-array bot-speech-info) bot-speech-info-flag) int) ;; 9 + (reset-index (_type_ symbol) none) ;; 10 ) ) -|# -#| (deftype bot-speech-list-shuffle (bot-speech-list) ((history-mask uint64 :offset-assert 16) (history-mask-full uint64 :offset-assert 24) @@ -58920,9 +58883,7 @@ :size-assert #x20 :flag-assert #xb00000020 ) -|# -#| (deftype bot-course-table (basic) ((course bot-course 1 :offset-assert 4) ;; guessed by decompiler ) @@ -58930,17 +58891,16 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -;; (define-extern *bot-task-pool* ai-task-pool) ;; ai-task-pool -;; (define-extern *bot-course-table* bot-course-table) ;; bot-course-table +(define-extern *bot-task-pool* ai-task-pool) +(define-extern *bot-course-table* bot-course-table) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern bot-simple-check-too-far function) ;; (function bot int) -;; (define-extern bot-check-too-far-always-okay function) ;; (function none) +(define-extern bot-simple-check-too-far (function bot int)) +(define-extern bot-check-too-far-always-okay (function int)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; bot-states ;; @@ -58951,7 +58911,6 @@ ;; ash-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-course (bot-course) ((ouch-speeches bot-speech-list-shuffle :offset-assert 48) ;; guessed by decompiler (victory-speeches bot-speech-list-shuffle :offset-assert 52) ;; guessed by decompiler @@ -58961,72 +58920,68 @@ :flag-assert #x900000038 ;; field default-check-too-far uses ~A with a signed load. ) -|# -#| (deftype ashelin (bot) - ((knocked-anim art-joint-anim :offset-assert 1008) ;; guessed by decompiler + ((self ashelin :override) + (course ashelin-course :override) + (knocked-anim art-joint-anim :offset-assert 1008) ;; guessed by decompiler (travel-anim-interp float :offset-assert 1012) (fired-gun-count uint32 :offset-assert 1016) - (last-fire-time uint64 :offset-assert 1024) ;; time-frame - (victory-speech-time uint64 :offset-assert 1032) ;; time-frame + (last-fire-time time-frame :offset-assert 1024) ;; time-frame + (victory-speech-time time-frame :offset-assert 1032) ;; time-frame (frontline plane :inline :offset-assert 1040) ) :method-count-assert 262 :size-assert #x420 :flag-assert #x10603a00420 + (:state-methods + back-spring ;; 237 + cartwheel-left ;; 238 + tumble-right ;; 239 + chase ;; 240 + traveling ;; 241 + traveling-blocked ;; 242 + waiting-idle ;; 243 + standing-idle ;; 244 + standing-turn ;; 245 + standing-blast ;; 246 + ) (:methods - (ashelin-method-237 () none) ;; 237 ;; (fire-projectile (_type_ vector) none) - (ashelin-method-238 () none) ;; 238 ;; (ashelin-method-238 (_type_ symbol symbol) symbol) - (ashelin-method-239 () none) ;; 239 ;; (ashelin-method-239 (_type_) none) - (ashelin-method-240 () none) ;; 240 ;; (ashelin-method-240 (_type_ int) none) - (ashelin-method-241 () none) ;; 241 ;; (ashelin-method-241 (_type_) int) - (ashelin-method-242 () none) ;; 242 ;; (ashelin-method-242 (_type_) int) - (ashelin-method-243 () none) ;; 243 ;; (ashelin-method-243 (_type_ float) int) - (ashelin-method-244 () none) ;; 244 ;; (ashelin-method-244 (_type_) none) - (ashelin-method-245 () none) ;; 245 ;; (ashelin-method-245 (_type_) none) - (ashelin-method-246 () none) ;; 246 ;; (ashelin-method-246 (_type_) int) - (ashelin-method-247 () none) ;; 247 ;; (ashelin-method-247 (_type_) symbol) - (ashelin-method-248 () none) ;; 248 ;; (ashelin-method-248 (_type_) symbol) - (ashelin-method-249 () none) ;; 249 ;; (ashelin-method-249 (_type_) none) - (ashelin-method-250 () none) ;; 250 ;; (ashelin-method-250 (_type_ symbol) none) - (ashelin-method-251 () none) ;; 251 - (ashelin-method-252 () none) ;; 252 - (ashelin-method-253 () none) ;; 253 - (ashelin-method-254 () none) ;; 254 - (ashelin-method-255 () none) ;; 255 - (ashelin-method-256 () none) ;; 256 - (ashelin-method-257 () none) ;; 257 - (ashelin-method-258 () none) ;; 258 - (ashelin-method-259 () none) ;; 259 - (ashelin-method-260 () none) ;; 260 - (ashelin-method-261 () none) ;; 261 + (ashelin-method-247 (_type_ symbol) symbol) ;; 247 + (ashelin-method-248 (_type_ vector float float float float) symbol) ;; 248 + (fire-shot (_type_ vector) (pointer process)) ;; 249 + (ashelin-method-250 (_type_ symbol symbol) symbol) ;; 250 + (go-dodge-state (_type_ int) object) ;; 251 + (ashelin-method-252 (_type_) int) ;; 252 + (ashelin-method-253 (_type_) int) ;; 253 + (ashelin-method-254 (_type_ float) none) ;; 254 + (ashelin-method-255 (_type_) none) ;; 255 + (ashelin-method-256 (_type_) none) ;; 256 + (ashelin-method-257 (_type_) int) ;; 257 + (ashelin-method-258 (_type_) symbol) ;; 258 + (ashelin-method-259 (_type_) none) ;; 259 + (ashelin-method-260 (_type_) int) ;; 260 + (ashelin-method-261 (_type_ symbol) penetrate) ;; 261 ) ) -|# -#| (deftype asht-wait-spot (ai-task) - ((check-done (function asht-wait-spot ashelin symbol) :offset-assert 32) ;; guessed by decompiler - (which-spot int8 :offset-assert 36) - (num-spots uint8 :offset-assert 37) - (spot-indexes uint8 6 :offset-assert 38) ;; guessed by decompiler + ((check-done (function asht-wait-spot ashelin symbol) :offset 32) ;; guessed by decompiler + (which-spot int8 :offset 36) + (num-spots uint8 :offset 37) + (spot-indexes uint8 6 :offset 38) ;; guessed by decompiler ) :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 ) -|# -#| (deftype asht-fight-focus (ai-task) () :method-count-assert 12 :size-assert #x30 :flag-assert #xc00000030 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash-task ;; @@ -59037,47 +58992,43 @@ ;; ash-shot ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-shot (projectile) - ((tail-pos vector :inline :offset-assert 512) + ((parent (pointer ashelin) :override) + (tail-pos vector :inline :offset-assert 512) (hit-pos vector :inline :offset-assert 528) ) :method-count-assert 41 :size-assert #x220 :flag-assert #x2901a00220 ) -|# -;; (define-extern ashelin-shot-move function) ;; (function ashelin-shot none) +(define-extern ashelin-shot-move (function ashelin-shot none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-anim-info (structure) ((anim-index int32 :offset-assert 0) ) + :pack-me :method-count-assert 9 :size-assert #x4 :flag-assert #x900000004 ) -|# -#| (deftype ashelin-global-info (basic) ((prev-blue-hit int8 :offset-assert 4) - (blue-hit-anim int32 6 :offset-assert 8) ;; guessed by decompiler - (blue-hit-land-anim int32 6 :offset-assert 32) ;; guessed by decompiler + (blue-hit-anim ashelin-anim-info 6 :inline :offset-assert 8) ;; guessed by decompiler + (blue-hit-land-anim ashelin-anim-info 6 :inline :offset-assert 32) ;; guessed by decompiler ) :method-count-assert 9 :size-assert #x38 :flag-assert #x900000038 ) -|# -;; (define-extern *ashelin-global-info* ashelin-global-info) ;; ashelin-global-info -;; (define-extern *ashelin-nav-enemy-info* nav-enemy-info) ;; nav-enemy-info +(define-extern *ashelin-global-info* ashelin-global-info) +(define-extern *ashelin-nav-enemy-info* nav-enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash-states ;; @@ -59146,7 +59097,6 @@ ;; oasis-defense ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype oasis-point (structure) ((pos vector :inline :offset-assert 0) (quat quaternion :inline :offset-assert 16) @@ -59155,67 +59105,58 @@ :size-assert #x20 :flag-assert #x900000020 ) -|# -#| (deftype oasis-vehicle (structure) - ((handle uint64 :offset-assert 0) + ((handle handle :offset-assert 0) (path-type int8 :offset-assert 8) (path-pos int8 :offset-assert 9) - (spawned-marauder? basic :offset-assert 12) + (spawned-marauder? symbol :offset-assert 12) ) + :pack-me :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype oasis-marauder (structure) - ((handle uint64 :offset-assert 0) - (initialized? basic :offset-assert 8) + ((handle handle :offset-assert 0) + (initialized? symbol :offset-assert 8) ) + :pack-me :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype task-manager-desert-oasis-defense (task-manager) - ((nav-mesh basic :offset-assert 240) - (vehicle UNKNOWN 3 :offset-assert 248) + ((nav-mesh nav-mesh :offset-assert 240) + (vehicle oasis-vehicle 3 :inline :offset-assert 248) (vehicle-count uint8 :offset-assert 296) - (v-free-list basic :offset-assert 300) - (marauder UNKNOWN 7 :offset-assert 304) - (m-free-list basic :offset-assert 416) + (v-free-list (array uint8) :offset-assert 300) + (marauder oasis-marauder 7 :inline :offset-assert 304) + (m-free-list (array uint8) :offset-assert 416) (marauder-count uint8 :offset-assert 420) (total-spawned uint8 :offset-assert 421) (total-veh-spawned uint8 :offset-assert 422) - (check-timer uint64 :offset-assert 424) - (trans-timer uint64 :offset-assert 432) - (veh-fx UNKNOWN 2 :offset-assert 440) - (veh-fx-timer uint64 :offset-assert 456) - (ash-entity basic :offset-assert 464) - (marauder-entity basic :offset-assert 468) - (last-kill-time uint64 :offset-assert 472) + (check-timer time-frame :offset-assert 424) + (trans-timer time-frame :offset-assert 432) + (veh-fx handle 2 :offset-assert 440) + (veh-fx-timer time-frame :offset-assert 456) + (ash-entity entity-actor :offset-assert 464) + (marauder-entity entity-actor :offset-assert 468) + (last-kill-time time-frame :offset-assert 472) ) :method-count-assert 36 :size-assert #x1e0 :flag-assert #x24016001e0 (:methods - (task-manager-desert-oasis-defense-method-32 () none) ;; 32 - (task-manager-desert-oasis-defense-method-33 () none) ;; 33 - (task-manager-desert-oasis-defense-method-34 () none) ;; 34 - (task-manager-desert-oasis-defense-method-35 () none) ;; 35 - ) - (:state-methods - active ;; 15 + (spawn-v-marauder (_type_ int int) handle) ;; 32 + (spawn-marauder (_type_ oasis-point symbol) handle) ;; 33 + (task-manager-desert-oasis-defense-method-34 (_type_) none) ;; 34 + (task-manager-desert-oasis-defense-method-35 (_type_) none) ;; 35 ) ) -|# -#| (deftype desoasis-hellcat (process-drawable) () :method-count-assert 21 @@ -59225,42 +59166,39 @@ idle ;; 20 ) ) -|# -;; (define-extern *oasis-marauder-start* array) -;; (define-extern *oasis-vehicle-start* array) -;; (define-extern *oasis-vehicle-path* array) -;; (define-extern *oasis-vehicle-fx-path* array) -;; (define-extern *oasis-marauder-spawn-point* array) +(define-extern *oasis-marauder-start* (array oasis-point)) +(define-extern *oasis-vehicle-start* (array oasis-point)) +(define-extern *oasis-vehicle-path* (array (array oasis-point))) +(define-extern *oasis-vehicle-fx-path* (array (array oasis-point))) +(define-extern *oasis-marauder-spawn-point* (array oasis-point)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ash-oasis-course ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ashelin-oasis (ashelin) - ((player-in-bounds-time uint64 :offset-assert 1056) - (last-speech-time uint64 :offset-assert 1064) + ((player-in-bounds-time time-frame :offset-assert 1056) + (last-speech-time time-frame :offset-assert 1064) (last-speech-id int32 :offset-assert 1072) (last-sound-trans vector :inline :offset-assert 1088) - (last-sound-id uint32 :offset-assert 1104) + (last-sound-id sound-id :offset-assert 1104) (minimap connection-minimap :offset-assert 1108) ) :method-count-assert 264 :size-assert #x458 :flag-assert #x10803e00458 - (:methods - (ashelin-oasis-method-262 () none) ;; 262 - (ashelin-oasis-method-263 () none) ;; 263 - ) (:state-methods knocked ;; 31 traveling ;; 241 ) + (:methods + (set-frontline (_type_) none) ;; 262 + (ashelin-oasis-method-263 (_type_ symbol) none) ;; 263 + ) ) -|# -;; (define-extern *ash-oasis-course* ashelin-course) +(define-extern *ash-oasis-course* ashelin-course) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ctyindb-part ;; @@ -60703,9 +60641,8 @@ ;; lfacrm2-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fac-elevator-a (elevator) - ((mysound uint32 :offset-assert 416) + ((mysound sound-id :offset-assert 416) ) :method-count-assert 52 :size-assert #x1a4 @@ -60713,22 +60650,16 @@ (:state-methods dormant ;; 35 waiting ;; 36 - arrived ;; 38 running ;; 37 + arrived ;; 38 ) ) -|# -#| -(deftype lfacrm2-states (UNKNOWN) +(deftype lfacrm2-states (structure) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 ) -|# -;; (define-extern update-mood-lfacrm2 function) +(define-extern update-mood-lfacrm2 (function mood-context float int none :behavior time-of-day-proc)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; was-pre-game ;; @@ -62411,70 +62342,61 @@ ;; destroy-dark-eco ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hud-eco-egg (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype lightning-bolt-tower (lightning-bolt) () :method-count-assert 23 :size-assert #x74 :flag-assert #x1700000074 ) -|# -#| (deftype tower-lightning-disc (structure) - ((bolt basic :offset-assert 0) + ((bolt lightning-bolt-tower :offset-assert 0) (orient quaternion :inline :offset-assert 16) - (cur-state basic :offset-assert 32) - (last-spawn-time uint64 :offset-assert 40) - (pts UNKNOWN 8 :offset-assert 48) + (cur-state symbol :offset-assert 32) + (last-spawn-time time-frame :offset-assert 40) + (pts vector 8 :inline :offset-assert 48) (last-rot-angle float :offset-assert 176) ) :method-count-assert 9 :size-assert #xb4 :flag-assert #x9000000b4 ) -|# -#| (deftype dark-eco-orb (process-focusable) ((last-attack-id uint32 :offset-assert 208) (hit-points float :offset-assert 212) - (alt-actor basic :offset-assert 216) - (movie? basic :offset-assert 220) + (alt-actor entity-actor :offset-assert 216) + (movie? symbol :offset-assert 220) (minimap connection-minimap :offset-assert 224) - (discs UNKNOWN 2 :offset-assert 240) - (shock-sound uint32 :offset-assert 624) - (plasma-sound uint32 :offset-assert 628) - (shock-spawn-time uint64 :offset-assert 632) + (discs tower-lightning-disc 2 :inline :offset-assert 240) + (shock-sound sound-id :offset-assert 624) + (plasma-sound sound-id :offset-assert 628) + (shock-spawn-time time-frame :offset-assert 632) ) :method-count-assert 32 :size-assert #x280 :flag-assert #x2002000280 (:state-methods - hit ;; 29 active ;; 28 + hit ;; 29 die ;; 30 die-movie ;; 31 ) ) -|# -#| (deftype dark-eco-tower (process-drawable) - ((puffer? basic :offset-assert 200) - (puffer-h uint64 :offset-assert 208) + ((puffer? symbol :offset-assert 200) + (puffer-h handle :offset-assert 208) (jump-y float :offset-assert 216) (jump-z float :offset-assert 220) - (creak-sound basic :offset-assert 224) + (creak-sound ambient-sound :offset-assert 224) ) :method-count-assert 21 :size-assert #xe4 @@ -62483,9 +62405,7 @@ idle ;; 20 ) ) -|# -#| (deftype tower-wave (structure) ((start float :offset-assert 0) (end float :offset-assert 4) @@ -62496,41 +62416,32 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype task-manager-destroy-darkeco (task-manager) - ((actor-group uint32 :offset-assert 236) - (actor-group-count int32 :offset-assert 240) - (handles UNKNOWN 64 :offset-assert 244) - (orb-handles UNKNOWN 8 :offset-assert 756) - (orb-status UNKNOWN 8 :offset-assert 820) - (counter uint32 :offset-assert 852) - (initial-orb uint64 :offset-assert 860) + ((actor-group (pointer actor-group) :offset-assert 240) + (actor-group-count int32 :offset-assert 244) + (handles handle 64 :offset-assert 248) + (orb-handles handle 8 :offset-assert 760) + (orb-status uint32 8 :offset-assert 824) + (counter uint32 :offset-assert 856) + (initial-orb handle :offset-assert 864) ) :method-count-assert 32 :size-assert #x368 :flag-assert #x2002f00368 ) -|# -#| (deftype task-manager-dark-punch-training (task-manager) - ((gui-id uint32 :offset-assert 240) + ((gui-id sound-id :offset-assert 240) ) :method-count-assert 33 :size-assert #xf4 :flag-assert #x21008000f4 (:methods - (task-manager-dark-punch-training-method-32 () none) ;; 32 - ) - (:state-methods - active ;; 15 + (print-text (_type_ text-id) none) ;; 32 ) ) -|# -#| (deftype grind-electricity (process-drawable) () :method-count-assert 21 @@ -62540,38 +62451,32 @@ idle ;; 20 ) ) -|# -;; (define-extern *initial-orb-pos* object) -;; (define-extern dark-eco-orb-event-handler function) -;; (define-extern spawn-shock-effect function) -;; (define-extern *dark-lightning-width* curve2d-fast) -;; (define-extern *dark-tower-lightning* object) -;; (define-extern dark-eco-orb-init-by-other function) -;; (define-extern dark-eco-orb-init-by-other-pos-scale function) -;; (define-extern *dark-eco-tower-waves* array) -;; (define-extern dark-eco-tower-callback function) -;; (define-extern dark-eco-tower-init-by-other function) +(define-extern *initial-orb-pos* vector) +(def-event-handler dark-eco-orb-event-handler dark-eco-orb) +(define-extern spawn-shock-effect (function dark-eco-orb vector lightning-spec (function lightning-tracker none) sparticle-launcher time-frame float none)) +(define-extern *dark-lightning-width* curve2d-fast) +(define-extern *dark-tower-lightning* lightning-appearance) +(define-extern dark-eco-orb-init-by-other (function entity-actor object :behavior dark-eco-orb)) +(define-extern dark-eco-orb-init-by-other-pos-scale (function vector float object :behavior dark-eco-orb)) +(define-extern *dark-eco-tower-waves* (array tower-wave)) +(define-extern dark-eco-tower-callback (function cspace transformq none)) +(define-extern dark-eco-tower-init-by-other (function entity-actor object :behavior dark-eco-tower)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comb-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| -(deftype comb-states (UNKNOWN) +(deftype comb-states (structure) () - :method-count-assert 0 - :size-assert #x0 - :flag-assert #x0 ) -|# -;; (define-extern init-mood-comb function) -;; (define-extern update-mood-comb function) -;; (define-extern *comb-field-texture-anim-array* texture-anim-array) -;; (define-extern set-comb-field-color! function) -;; (define-extern set-comb-field-flash! function) -;; (define-extern set-comb-field-texture-masks! function) +(define-extern init-mood-comb (function mood-context float)) +(define-extern update-mood-comb (function mood-context float int none :behavior time-of-day-proc)) +(define-extern *comb-field-texture-anim-array* (texture-anim-array texture-anim)) +(define-extern set-comb-field-color! (function vector none)) +(define-extern set-comb-field-flash! (function vector none)) +(define-extern set-comb-field-texture-masks! (function vector symbol)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comb-part ;; @@ -62582,21 +62487,18 @@ ;; comb-obs ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype comb-elevator (elevator) () :method-count-assert 52 :size-assert #x1a0 :flag-assert #x34012001a0 ) -|# -#| (deftype comb-pillar (process-focusable) ((center-pos vector :inline :offset-assert 208) (attack-vel vector :inline :offset-assert 224) - (exploder-params basic :offset-assert 240) - (exploder-skel basic :offset-assert 244) + (exploder-params joint-exploder-static-params :offset-assert 240) + (exploder-skel skeleton-group :offset-assert 244) (exploder-anim uint32 :offset-assert 248) (hit-points float :offset-assert 252) (incoming-attack-id int32 :offset-assert 256) @@ -62604,76 +62506,71 @@ :method-count-assert 36 :size-assert #x104 :flag-assert #x2400900104 - (:methods - (comb-pillar-method-30 () none) ;; 30 - (comb-pillar-method-31 () none) ;; 31 - (comb-pillar-method-32 () none) ;; 32 - (comb-pillar-method-33 () none) ;; 33 - (comb-pillar-method-34 () none) ;; 34 - (comb-pillar-method-35 () none) ;; 35 - ) (:state-methods - explode ;; 29 idle ;; 28 + explode ;; 29 + ) + (:methods + (update-fade (_type_) none) ;; 30 + (set-cspec! (_type_) none) ;; 31 + (go-explode (_type_) none) ;; 32 + (set-attack-vel! (_type_ vector) none) ;; 33 + (on-attack (_type_ process attack-info object) symbol) ;; 34 + (on-impulse (_type_ rigid-body-impact) symbol) ;; 35 ) ) -|# -#| (deftype comb-block (process-focusable) ((attack-vel vector :inline :offset-assert 208) - (exploder-params basic :offset-assert 224) - (exploder-skel basic :offset-assert 228) + (exploder-params joint-exploder-static-params :offset-assert 224) + (exploder-skel skeleton-group :offset-assert 228) (exploder-anim uint32 :offset-assert 232) (hit-points float :offset-assert 236) (incoming-attack-id int32 :offset-assert 240) - (parts UNKNOWN 4 :offset-assert 244) + (parts sparticle-launch-control 4 :offset-assert 244) ) :method-count-assert 36 :size-assert #x104 :flag-assert #x2400900104 - (:methods - (comb-block-method-30 () none) ;; 30 - (comb-block-method-31 () none) ;; 31 - (comb-block-method-32 () none) ;; 32 - (comb-block-method-33 () none) ;; 33 - (comb-block-method-34 () none) ;; 34 - (comb-block-method-35 () none) ;; 35 - ) (:state-methods - explode ;; 29 idle ;; 28 + explode ;; 29 + ) + (:methods + (spawn-parts (_type_) none) ;; 30 + (set-cspec! (_type_) none) ;; 31 + (go-explode (_type_) none) ;; 32 + (set-attack-vel! (_type_ vector) none) ;; 33 + (on-attack (_type_ process attack-info object) symbol) ;; 34 + (on-impact (_type_ rigid-body-impact) symbol) ;; 35 ) ) -|# -#| (deftype comb-energy-ring (process-focusable) ((speed float :offset-assert 208) - (hum-id uint32 :offset-assert 212) - (bolt basic :offset-assert 216) - (shocked-player basic :offset-assert 220) + (hum-id sound-id :offset-assert 212) + (bolt lightning-bolt :offset-assert 216) + (shocked-player symbol :offset-assert 220) ) :method-count-assert 34 :size-assert #xe0 :flag-assert #x22006000e0 - (:methods - (comb-energy-ring-method-29 () none) ;; 29 - (comb-energy-ring-method-30 () none) ;; 30 - (comb-energy-ring-method-31 () none) ;; 31 - (comb-energy-ring-method-32 () none) ;; 32 - (comb-energy-ring-method-33 () none) ;; 33 - ) (:state-methods idle ;; 28 ) + (:methods + (update-sound-and-bolt (_type_) none) ;; 29 + (set-cspec! (_type_) none) ;; 30 + (comb-energy-ring-method-31 (_type_) none) ;; 31 + (init-bolt! (_type_) none) ;; 32 + (update-bolt (_type_ vector vector) none) ;; 33 + ) ) -|# -#| (deftype comb-turbo (process-drawable) - ((touch-time uint64 :offset-assert 200) - (player-got basic :offset-assert 208) + ((root collide-shape :override) + (touch-time time-frame :offset-assert 200) + (player-got symbol :offset-assert 208) (boost float :offset-assert 212) (plane vector :inline :offset-assert 224) (mat matrix :inline :offset-assert 240) @@ -62681,59 +62578,53 @@ :method-count-assert 25 :size-assert #x130 :flag-assert #x1900b00130 - (:methods - (comb-turbo-method-22 () none) ;; 22 - (comb-turbo-method-23 () none) ;; 23 - (comb-turbo-method-24 () none) ;; 24 - ) (:state-methods - die ;; 21 idle ;; 20 + die ;; 21 + ) + (:methods + (init-collision! (_type_) none) ;; 22 + (init-fields! (_type_) none) ;; 23 + (comb-turbo-method-24 (_type_) none) ;; 24 ) ) -|# -#| (deftype task-manager-lightjak-training-shield (task-manager) - ((gui-id uint32 :offset-assert 240) + ((gui-id sound-id :offset-assert 240) ) :method-count-assert 33 :size-assert #xf4 :flag-assert #x21008000f4 - (:methods - (task-manager-lightjak-training-shield-method-32 () none) ;; 32 - ) (:state-methods active ;; 15 ) + (:methods + (print-text (_type_ text-id) none) ;; 32 + ) ) -|# -;; (define-extern *comb-pillar-explode-params* joint-exploder-static-params) -;; (define-extern *comb-block-explode-params* joint-exploder-static-params) -;; (define-extern *comb-energy-ring-lightning-width* curve2d-fast) -;; (define-extern *comb-energy-ring-lightning* object) +(define-extern *comb-pillar-explode-params* joint-exploder-static-params) +(define-extern *comb-block-explode-params* joint-exploder-static-params) +(define-extern *comb-energy-ring-lightning-width* curve2d-fast) +(define-extern *comb-energy-ring-lightning* lightning-appearance) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comb-sentry ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype comb-sentry-shot (guard-shot) () :method-count-assert 41 :size-assert #x220 :flag-assert #x2901a00220 ) -|# -#| (deftype comb-sentry (process-focusable) ((target-pos vector :inline :offset-assert 208) (up-dir vector :inline :offset-assert 224) (attack-vel vector :inline :offset-assert 240) - (exploder-params basic :offset-assert 256) - (exploder-skel basic :offset-assert 260) + (exploder-params joint-exploder-static-params :offset-assert 256) + (exploder-skel skeleton-group :offset-assert 260) (exploder-anim uint32 :offset-assert 264) (target-dist float :offset-assert 268) (path-t float :offset-assert 272) @@ -62742,124 +62633,129 @@ (incoming-attack-id int32 :offset-assert 284) (angle float :offset-assert 288) (spin float :offset-assert 292) - (shooting basic :offset-assert 296) - (should-attack basic :offset-assert 300) + (shooting symbol :offset-assert 296) + (should-attack symbol :offset-assert 300) (i-barrel int8 :offset-assert 304) - (hum-id uint32 :offset-assert 308) - (shot-time uint64 :offset-assert 312) - (attack-time uint64 :offset-assert 320) - (in-range-time uint64 :offset-assert 328) - (player-vehicle uint64 :offset-assert 336) + (hum-id sound-id :offset-assert 308) + (shot-time time-frame :offset-assert 312) + (attack-time time-frame :offset-assert 320) + (in-range-time time-frame :offset-assert 328) + (player-vehicle handle :offset-assert 336) ) :method-count-assert 40 :size-assert #x158 :flag-assert #x2800e00158 - (:methods - (comb-sentry-method-31 () none) ;; 31 - (comb-sentry-method-32 () none) ;; 32 - (comb-sentry-method-33 () none) ;; 33 - (comb-sentry-method-34 () none) ;; 34 - (comb-sentry-method-35 () none) ;; 35 - (comb-sentry-method-36 () none) ;; 36 - (comb-sentry-method-37 () none) ;; 37 - (comb-sentry-method-38 () none) ;; 38 - (comb-sentry-method-39 () none) ;; 39 - ) (:state-methods - explode ;; 30 - path-follow ;; 29 idle ;; 28 + path-follow ;; 29 + explode ;; 30 + ) + (:methods + (stop-hum (_type_) none) ;; 31 + (sentry-post (_type_) none) ;; 32 + (set-cspec! (_type_) none) ;; 33 + (go-explode (_type_) none) ;; 34 + (set-attack-vel! (_type_ vector) none) ;; 35 + (on-attack (_type_ process attack-info object) symbol) ;; 36 + (on-impact (_type_ rigid-body-impact) symbol) ;; 37 + (fire-shot (_type_) (pointer comb-sentry-shot)) ;; 38 + (draw-glow-sprites (_type_) none) ;; 39 ) ) -|# -#| +(deftype comb-sentry-stack-var0 (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (mat matrix :inline :offset 128) + (vec2 vector :inline :offset 192) + (vec3 vector :inline :offset 208) + (vec4 vector :inline :offset 224) + (byte0 int8 :offset 240) + ) + ) + +(deftype comb-sentry-stack-var1 (structure) + ((glow sprite-glow-data :inline :offset 0) + (mat matrix :inline :offset 64) + (vec vector :inline :offset 128) + ) + ) + (deftype comb-sentinel (comb-sentry) () :method-count-assert 40 :size-assert #x158 :flag-assert #x2800e00158 ) -|# -#| (deftype rail-sentinel (comb-sentry) () :method-count-assert 40 :size-assert #x158 :flag-assert #x2800e00158 ) -|# -;; (define-extern *comb-sentry-explode-params* joint-exploder-static-params) -;; (define-extern *comb-sentry-glow-template* object) -;; (define-extern *comb-sentry-glow-ring-template* object) +(define-extern *comb-sentry-explode-params* joint-exploder-static-params) +(define-extern *comb-sentry-glow-template* sprite-glow-data) +(define-extern *comb-sentry-glow-ring-template* sprite-glow-data) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comb-field ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype comb-field (process-drawable) - ((pass int32 :offset-assert 200) + ((root collide-shape :override) + (pass pickup-type :offset-assert 200) (incoming-attack-id uint32 :offset-assert 204) - (next-message-time uint64 :offset-assert 208) + (next-message-time time-frame :offset-assert 208) (message int32 :offset-assert 216) (plane plane :inline :offset-assert 224) (color vector :inline :offset-assert 240) (target-pos vector :inline :offset-assert 256) - (hum-sound-id uint32 :offset-assert 272) + (hum-sound-id sound-id :offset-assert 272) (flash float :offset-assert 276) (touch-count int32 :offset-assert 280) - (touch-time uint64 :offset-assert 288) - (breach basic :offset-assert 296) + (touch-time time-frame :offset-assert 288) + (breach symbol :offset-assert 296) ) :method-count-assert 24 :size-assert #x12c :flag-assert #x1800b0012c - (:methods - (comb-field-method-21 () none) ;; 21 - (comb-field-method-22 () none) ;; 22 - (comb-field-method-23 () none) ;; 23 - ) (:state-methods idle-close ;; 20 ) + (:methods + (init-collision! (_type_ path-control float) none) ;; 21 + (on-jak-touch (_type_) none) ;; 22 + (play-hum (_type_) none) ;; 23 + ) ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comb-scenes ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern comb-lightjak-do-effect function) -;; (define-extern death-precursor death-info) ;; death-info -;; (define-extern start-precursor-effect function) ;; (function manipy none) +(define-extern comb-lightjak-do-effect (function none :behavior process-drawable)) +(define-extern death-precursor death-info) +(define-extern start-precursor-effect (function manipy none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; h-sled ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype hud-sled-health (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# -#| (deftype pre-sled (process-drawable) () :method-count-assert 20 :size-assert #xc8 :flag-assert #x14005000c8 ) -|# -#| (deftype sled-shot (projectile) ((tail-pos vector :inline :offset-assert 512) ) @@ -62867,9 +62763,7 @@ :size-assert #x210 :flag-assert #x2901900210 ) -|# -#| (deftype h-sled-probe-work (structure) ((local-pos vector :inline :offset-assert 0) (local-normal vector :inline :offset-assert 16) @@ -62886,9 +62780,7 @@ :size-assert #x94 :flag-assert #x900000094 ) -|# -#| (deftype h-sled-physics-work (structure) ((mat matrix :inline :offset-assert 0) (force vector :inline :offset-assert 64) @@ -62904,8 +62796,8 @@ (axis vector :inline :offset-assert 224) (dir vector :inline :offset-assert 240) (ground-normal vector :inline :offset-assert 256) - (edges UNKNOWN 3 :offset-assert 272) - (edge-dirs UNKNOWN 3 :offset-assert 320) + (edges vector 3 :inline :offset-assert 272) + (edge-dirs vector 3 :inline :offset-assert 320) (impulse float :offset-assert 368) (vel-dot-norm float :offset-assert 372) (friction-coef float :offset-assert 376) @@ -62913,32 +62805,30 @@ (best-len float :offset-assert 384) (len float :offset-assert 388) (i-longest int8 :offset-assert 392) - (probe-work-array UNKNOWN 4 :offset-assert 400) + (probe-work-array h-sled-probe-work 4 :inline :offset-assert 400) ) :method-count-assert 9 :size-assert #x410 :flag-assert #x900000410 ) -|# -#| (deftype h-sled (vehicle) - ((health-hud uint64 :offset-assert 696) - (overturned-time uint64 :offset-assert 704) - (shoot-time uint64 :offset-assert 712) + ((health-hud handle :offset-assert 696) + (overturned-time time-frame :offset-assert 704) + (shoot-time time-frame :offset-assert 712) (shoot-delay uint16 :offset-assert 720) - (rider-hand-joint-array UNKNOWN 2 :offset-assert 722) + (rider-hand-joint-array int8 2 :offset-assert 722) (i-barrel int8 :offset-assert 724) (ai-target-speed float :offset-assert 728) (engine-thrust float :offset-assert 732) (engine-sound-envelope float :offset-assert 736) - (engine-sound-id uint32 :offset-assert 740) - (steer-sound-id uint32 :offset-assert 744) - (turbo-sound-id uint32 :offset-assert 748) - (engine-sound-envelope float :offset-assert 736) - (in-tunnel basic :offset-assert 756) - (whoosh-time uint64 :offset-assert 760) - (parts UNKNOWN 4 :offset-assert 768) + (engine-sound-id sound-id :offset-assert 740) + (steer-sound-id sound-id :offset-assert 744) + (turbo-sound-id sound-id :offset-assert 748) + ; (engine-sound-envelope float :offset-assert 736) + (in-tunnel symbol :offset 756) + (whoosh-time time-frame :offset-assert 760) + (parts sparticle-launch-control 4 :offset-assert 768) (gravity-dir vector :inline :offset-assert 784) (path-pos vector :inline :offset-assert 800) (path-dir vector :inline :offset-assert 816) @@ -62950,39 +62840,53 @@ (side-dir vector :inline :offset-assert 912) (ai-target-pos vector :inline :offset-assert 928) (whoosh-pos vector :inline :offset-assert 944) - (ground-pos-array UNKNOWN 4 :offset-assert 960) + (ground-pos-array vector 4 :inline :offset-assert 960) ) :method-count-assert 153 :size-assert #x400 :flag-assert #x9903800400 - (:methods - (h-sled-method-152 () none) ;; 152 - ) (:state-methods player-control ;; 58 explode ;; 60 ) + (:methods + (fire-shot (_type_) none) ;; 152 + ) ) -|# -;; (define-extern hud-sled-health-spawn function) -;; (define-extern sled-find-mesh-dir function) -;; (define-extern sled-shot-move function) -;; (define-extern sled-shot-reaction function) -;; (define-extern *h-sled-explosion-info* vehicle-explosion-info) -;; (define-extern *h-sled-constants* object) +(deftype h-sled-stack-var0 (structure) + ((vec vector 3 :inline :offset 0) + (vec1 vector 2 :inline :offset 64) + (byte0 int8 :offset 128) + (float0 float :offset 132) + (float1 float :offset 136) + ) + ) + +(deftype h-sled-stack-var1 (structure) + ((vec0 vector :inline :offset 0) + (mat matrix :inline :offset 16) + (glow sprite-glow-data :inline :offset 80) + ) + ) + +(define-extern hud-sled-health-spawn (function process process)) +(define-extern sled-find-mesh-dir (function vector vector collide-tri-result none)) +(define-extern sled-shot-move (function sled-shot none)) +(define-extern sled-shot-reaction (function control-info collide-query vector vector collide-status)) +(define-extern *h-sled-explosion-info* vehicle-explosion-info) +(define-extern *h-sled-constants* rigid-body-vehicle-constants) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comb-travel ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-tube-ride (task-manager) ((suck-factor float :offset-assert 240) (hp-scale float :offset-assert 244) (intro-sequence basic :offset-assert 248) (outro-sequence basic :offset-assert 252) - (no-shoot-time uint64 :offset-assert 256) + (no-shoot-time time-frame :offset-assert 256) (end-sphere sphere :inline :offset-assert 272) (end-plane vector :inline :offset-assert 288) (intro-sphere sphere :inline :offset-assert 304) @@ -62996,44 +62900,31 @@ :size-assert #x190 :flag-assert #x2101100190 (:methods - (task-manager-tube-ride-method-32 () none) ;; 32 - ) - (:state-methods - complete ;; 16 - active ;; 15 + (set-sbanks (_type_) none) ;; 32 ) ) -|# -#| (deftype task-manager-comb-travel (task-manager-tube-ride) () :method-count-assert 33 :size-assert #x190 :flag-assert #x2101100190 - (:state-methods - complete ;; 16 - ) ) -|# -#| (deftype task-manager-comb-wild-ride (task-manager-tube-ride) () :method-count-assert 33 :size-assert #x190 :flag-assert #x2101100190 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; comba-init ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern comba-login function) -;; (define-extern comba-activate function) -;; (define-extern comba-deactivate function) +(define-extern comba-login (function level none)) +(define-extern comba-activate (function level none)) +(define-extern comba-deactivate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desert-dust-storm ;; @@ -63234,8 +63125,8 @@ ;; lfaccar-init ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern lfaccar-activate function) -;; (define-extern lfaccar-deactivate function) +(define-extern lfaccar-activate (function level none)) +(define-extern lfaccar-deactivate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; wcar-faccar ;; @@ -63535,7 +63426,7 @@ ;; factoryb-init ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern factoryb-activate function) +(define-extern factoryb-activate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mhcitya-texture ;; @@ -67504,7 +67395,6 @@ ;; lfacrm1-mood ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype lfacrm1-states (structure) ((door-current-interp float :offset-assert 0) (door-target-interp float :offset-assert 4) @@ -67514,9 +67404,7 @@ :size-assert #xc :flag-assert #x90000000c ) -|# -#| (deftype lfac-hanger-door (process-drawable) () :method-count-assert 21 @@ -67526,12 +67414,11 @@ idle ;; 20 ) ) -|# -;; (define-extern update-lfacrm1-lights function) -;; (define-extern update-mood-lfacrm1 function) -;; (define-extern set-lfacrm1-door! function) -;; (define-extern lfac-hanger-door-init-by-other function) +(define-extern update-lfacrm1-lights (function mood-context none)) +(define-extern update-mood-lfacrm1 (function mood-context float int none :behavior time-of-day-proc)) +(define-extern set-lfacrm1-door! (function float none)) +(define-extern lfac-hanger-door-init-by-other (function vector entity-actor object :behavior lfac-hanger-door)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; gun-dummy-part ;; @@ -70843,114 +70730,130 @@ ;; mh-centipede-part ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern birth-func-ground-dirt-bounce function) -;; (define-extern spt-func-ground-dirt-bounce1 function) -;; (define-extern spt-func-ground-dirt-bounce2 function) -;; (define-extern spt-birth-func-brightness-mh-centipede-rocks function) -;; (define-extern spt-birth-func-brightness-mh-centipede-dirt function) -;; (define-extern spt-birth-func-brightness-mh-centipede-dust function) -;; (define-extern spt-birth-func-part-mh-centipede-before-breach-rocks function) -;; (define-extern spt-func-part-mh-centipede-before-breach-rocks function) -;; (define-extern spt-birth-func-part-mh-centipede-breach-dirt function) -;; (define-extern spt-birth-func-part-mh-centipede-breach-rocks function) -;; (define-extern spt-func-part-mh-centipede-breach-rocks function) -;; (define-extern spt-birth-func-part-mh-centipede-breach-rocks-bounce1 function) -;; (define-extern spt-func-part-mh-centipede-breach-rocks-bounce1 function) -;; (define-extern spt-func-ground-dirt-bounce3 function) -;; (define-extern spt-birth-func-part-mh-centipede-breach-rocks-bounce2 function) -;; (define-extern spt-birth-func-part-mh-centipede-impact-dirt function) -;; (define-extern spt-birth-func-part-mh-centipede-impact-rocks function) -;; (define-extern spt-func-part-mh-centipede-impact-rocks function) -;; (define-extern spt-birth-func-part-mh-centipede-impact-rocks-bounce1 function) -;; (define-extern spt-func-part-mh-centipede-impact-rocks-bounce1 function) -;; (define-extern spt-birth-func-brightness-mh-centipede-blood function) -;; (define-extern spt-birth-func-part-mh-centipede-explosion-lots function) -;; (define-extern spt-birth-func-part-mh-centipede-explosion function) -;; (define-extern *range-mhcent-splash-color* curve-color-fast) -;; (define-extern *range-mhcent-splash-alpha* curve2d-fast) -;; (define-extern *range-mhcent-splash-scale-x* curve2d-fast) -;; (define-extern *range-mhcent-splash-scale-y* curve2d-fast) -;; (define-extern *curve-mhcent-splash-alpha* curve2d-fast) -;; (define-extern *curve-mhcent-splash-scale-x* curve2d-fast) -;; (define-extern *curve-mhcent-splash-scale-y* curve2d-fast) -;; (define-extern *part-mh-centipede-splash-curve-settings* object) -;; (define-extern check-mh-centipede-explosion-level function) -;; (define-extern spt-birth-func-part-mh-centipede-shot-explosion-dirt function) -;; (define-extern spt-birth-func-part-mh-centipede-shot-explosion-dust function) -;; (define-extern spt-birth-func-part-mh-centipede-shot-explosion-bits function) -;; (define-extern *range-mh-centipede-shot-explo-color* curve-color-fast) -;; (define-extern *range-mh-centipede-shot-explo-alpha* curve2d-fast) -;; (define-extern *range-mh-centipede-shot-explo-scale-x* curve2d-fast) -;; (define-extern *range-mh-centipede-shot-explo-scale-y* curve2d-fast) -;; (define-extern *curve-mh-centipede-shot-explo-alpha* curve2d-fast) -;; (define-extern *curve-mh-centipede-shot-explo-scale-x* curve2d-fast) -;; (define-extern *curve-mh-centipede-shot-explo-scale-y* curve2d-fast) -;; (define-extern *part-mh-centipede-shot-explosion-texture-curve-settings* object) +(define-extern birth-func-ground-dirt-bounce (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-ground-dirt-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-ground-dirt-bounce2 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-brightness-mh-centipede-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-brightness-mh-centipede-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-brightness-mh-centipede-dust (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-before-breach-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-mh-centipede-before-breach-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-breach-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-breach-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-mh-centipede-breach-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-breach-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-mh-centipede-breach-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-ground-dirt-bounce3 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-breach-rocks-bounce2 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-impact-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-impact-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-mh-centipede-impact-rocks (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-impact-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-func-part-mh-centipede-impact-rocks-bounce1 (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-brightness-mh-centipede-blood (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-explosion-lots (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-explosion (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-mhcent-splash-color* curve-color-fast) +(define-extern *range-mhcent-splash-alpha* curve2d-fast) +(define-extern *range-mhcent-splash-scale-x* curve2d-fast) +(define-extern *range-mhcent-splash-scale-y* curve2d-fast) +(define-extern *curve-mhcent-splash-alpha* curve2d-fast) +(define-extern *curve-mhcent-splash-scale-x* curve2d-fast) +(define-extern *curve-mhcent-splash-scale-y* curve2d-fast) +(define-extern *part-mh-centipede-splash-curve-settings* particle-curve-settings) +(define-extern check-mh-centipede-explosion-level (function sparticle-system sparticle-cpuinfo vector none)) +(define-extern spt-birth-func-part-mh-centipede-shot-explosion-dirt (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-shot-explosion-dust (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern spt-birth-func-part-mh-centipede-shot-explosion-bits (function sparticle-system sparticle-cpuinfo sparticle-launchinfo object object none)) +(define-extern *range-mh-centipede-shot-explo-color* curve-color-fast) +(define-extern *range-mh-centipede-shot-explo-alpha* curve2d-fast) +(define-extern *range-mh-centipede-shot-explo-scale-x* curve2d-fast) +(define-extern *range-mh-centipede-shot-explo-scale-y* curve2d-fast) +(define-extern *curve-mh-centipede-shot-explo-alpha* curve2d-fast) +(define-extern *curve-mh-centipede-shot-explo-scale-x* curve2d-fast) +(define-extern *curve-mh-centipede-shot-explo-scale-y* curve2d-fast) +(define-extern *part-mh-centipede-shot-explosion-texture-curve-settings* particle-curve-settings) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mh-centipede ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++mh-centipede:nest-hunt-speech-instance-flag +(defenum nest-hunt-speech-instance-flag + :type uint64 + :bitfield #t + (nhs0 0) + (nhs1 1) + (nhs2 2) + (nhs3 3) + (nhs4 4) + (nhs5 5) + (nhs6 6) + (nhs7 7) + ) +;; ---mh-centipede:nest-hunt-speech-instance-flag + (deftype nest-hunt-speech-instance (structure) ((speech uint16 :offset-assert 0) (probability float :offset-assert 4) - (flags uint64 :offset-assert 8) + (flags nest-hunt-speech-instance-flag :offset-assert 8) (play-count uint32 :offset-assert 16) ) :method-count-assert 9 :size-assert #x14 :flag-assert #x900000014 ) -|# -#| +;; +++mh-centipede:nest-hunt-speech-info-flag +(defenum nest-hunt-speech-info-flag + :type uint8 + :bitfield #t + (nhs0 0) + (nhs1 1) + (nhs2 2) + ) +;; ---mh-centipede:nest-hunt-speech-info-flag + (deftype nest-hunt-speech-info (structure) - ((speeches basic :offset-assert 0) - (play-time uint64 :offset-assert 8) - (current-random uint64 :offset-assert 16) - (minimum-interval uint64 :offset-assert 24) - (random-interval uint64 :offset-assert 32) + ((speeches (array nest-hunt-speech-instance) :offset-assert 0) + (play-time time-frame :offset-assert 8) + (current-random time-frame :offset-assert 16) + (minimum-interval time-frame :offset-assert 24) + (random-interval time-frame :offset-assert 32) (last-played int8 :offset-assert 40) - (flags uint8 :offset-assert 41) + (flags nest-hunt-speech-info-flag :offset-assert 41) ) :method-count-assert 9 :size-assert #x2a :flag-assert #x90000002a ) -|# -#| (deftype nest-hunt-speech-group (structure) - ((play-time uint64 :offset-assert 0) + ((play-time time-frame :offset-assert 0) (game-counter-last float :offset-assert 8) - (info basic :offset-assert 12) + (info (array nest-hunt-speech-info) :offset-assert 12) ) :method-count-assert 9 :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype rod-spawner (process-drawable) - ((rod uint64 :offset-assert 200) + ((rod handle :offset-assert 200) (minimap connection-minimap :offset-assert 208) ) :method-count-assert 23 :size-assert #xd4 :flag-assert #x17006000d4 (:state-methods - hidden ;; 22 idle ;; 20 wait-for-children ;; 21 + hidden ;; 22 ) ) -|# -#| (deftype mh-centipede-shot (projectile) - ((trail-part basic :offset-assert 512) + ((trail-part sparticle-launch-control :offset-assert 512) ) :method-count-assert 41 :size-assert #x204 @@ -70960,24 +70863,20 @@ moving ;; 23 ) ) -|# -#| (deftype mh-centipede-crater-pt (structure) ((collision-pt vector :inline :offset-assert 0) (normal vector :inline :offset-assert 16) - (found? basic :offset-assert 32) + (found? symbol :offset-assert 32) (angle float :offset-assert 36) ) :method-count-assert 9 :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype mh-centipede-crater-pt-array (structure) - ((points UNKNOWN 20 :offset-assert 0) + ((points mh-centipede-crater-pt 20 :inline :offset-assert 0) (origin vector :inline :offset-assert 960) (radius float :offset-assert 976) (current-point int32 :offset-assert 980) @@ -70986,14 +70885,12 @@ :size-assert #x3d8 :flag-assert #xc000003d8 (:methods - (mh-centipede-crater-pt-array-method-9 () none) ;; 9 - (mh-centipede-crater-pt-array-method-10 () none) ;; 10 - (mh-centipede-crater-pt-array-method-11 () none) ;; 11 + (init! (_type_ vector float) none) ;; 9 + (mh-centipede-crater-pt-array-method-10 (_type_) none) ;; 10 + (mh-centipede-crater-pt-array-method-11 (_type_ process) none) ;; 11 ) ) -|# -#| (deftype mh-centipede-anim (structure) ((anim int32 :offset-assert 0) (speed float :offset-assert 4) @@ -71005,73 +70902,88 @@ :size-assert #x14 :flag-assert #x900000014 ) -|# -#| +;; +++mh-centipede:mh-centipede-flag +(defenum mh-centipede-flag + :type uint32 + :bitfield #t + (mc0 0) + (mc1 1) + (mc2 2) + (mc3 3) + (mc4 4) + (mc5 5) + (mc6 6) + (mc7 7) + (mc8 8) + (mc9 9) + ) +;; ---mh-centipede:mh-centipede-flag + (deftype mh-centipede (process-focusable) - ((launch-position vector :inline :offset-assert 208) + ((root collide-shape-moving :override) + (launch-position vector :inline :offset-assert 208) (landing-position vector :inline :offset-assert 224) - (flags uint32 :offset-assert 240) + (flags mh-centipede-flag :offset-assert 240) (incoming-attack-id uint32 :offset-assert 244) (hit-points float :offset-assert 248) (appearance-order int8 :offset-assert 252) - (before-breach-part basic :offset-assert 256) - (breach-part basic :offset-assert 260) - (dirt-fall-part basic :offset-assert 264) - (impact-part basic :offset-assert 268) - (impact-dust-part basic :offset-assert 272) + (before-breach-part sparticle-launch-control :offset-assert 256) + (breach-part sparticle-launch-control :offset-assert 260) + (dirt-fall-part sparticle-launch-control :offset-assert 264) + (impact-part sparticle-launch-control :offset-assert 268) + (impact-dust-part sparticle-launch-control :offset-assert 272) (out-of-ground-crater mh-centipede-crater-pt-array :inline :offset-assert 288) (into-ground-crater mh-centipede-crater-pt-array :inline :offset-assert 1280) - (wait-time uint64 :offset-assert 2264) - (pre-breach-time uint64 :offset-assert 2272) - (breach-anims basic :offset-assert 2280) - (shoot-anims basic :offset-assert 2284) + (wait-time time-frame :offset-assert 2264) + (pre-breach-time time-frame :offset-assert 2272) + (breach-anims (array mh-centipede-anim) :offset-assert 2280) + (shoot-anims (array mh-centipede-anim) :offset-assert 2284) (current-anim mh-centipede-anim :offset-assert 2288) - (nose-smack-time uint64 :offset-assert 2296) - (tail-smack-time uint64 :offset-assert 2304) - (timeout uint64 :offset-assert 2312) + (nose-smack-time time-frame :offset-assert 2296) + (tail-smack-time time-frame :offset-assert 2304) + (timeout time-frame :offset-assert 2312) (prev-anim-frame float :offset-assert 2320) (current-target-position vector :inline :offset-assert 2336) (prev-target-position vector :inline :offset-assert 2352) - (prev-time uint64 :offset-assert 2368) - (rumble-sound uint32 :offset-assert 2376) - (rumble-sound-playing basic :offset-assert 2380) - (ground-sound uint32 :offset-assert 2384) - (ground-sound-playing basic :offset-assert 2388) - (legs-sound uint32 :offset-assert 2392) - (legs-sound-playing basic :offset-assert 2396) + (prev-time time-frame :offset-assert 2368) + (rumble-sound sound-id :offset-assert 2376) + (rumble-sound-playing symbol :offset-assert 2380) + (ground-sound sound-id :offset-assert 2384) + (ground-sound-playing symbol :offset-assert 2388) + (legs-sound sound-id :offset-assert 2392) + (legs-sound-playing symbol :offset-assert 2396) (minimap connection-minimap :offset-assert 2400) - (mm-handle uint64 :offset-assert 2408) + (mm-handle handle :offset-assert 2408) (effect-sphere sphere :offset-assert 2416) ) :method-count-assert 43 :size-assert #x974 :flag-assert #x2b09000974 - (:methods - (mh-centipede-method-36 () none) ;; 36 - (mh-centipede-method-37 () none) ;; 37 - (mh-centipede-method-38 () none) ;; 38 - (mh-centipede-method-39 () none) ;; 39 - (mh-centipede-method-40 () none) ;; 40 - (mh-centipede-method-41 () none) ;; 41 - (mh-centipede-method-42 () none) ;; 42 - ) (:state-methods - test ;; 35 - die ;; 34 - shooting ;; 33 - breach ;; 32 - pre-breach ;; 31 - wait-off-minimap ;; 30 - wait-on-minimap ;; 29 hidden ;; 28 + wait-on-minimap ;; 29 + wait-off-minimap ;; 30 + pre-breach ;; 31 + breach ;; 32 + shooting ;; 33 + die ;; 34 + test ;; 35 + ) + (:methods + (mh-centipede-method-36 (_type_) none) ;; 36 + (probe-ground (_type_ vector) symbol) ;; 37 + (mh-centipede-method-38 (_type_ symbol) symbol) ;; 38 + (mh-centipede-method-39 (_type_) symbol) ;; 39 + (death-explosion (_type_ int) none) ;; 40 + (mh-centipede-method-41 (_type_) symbol) ;; 41 + (fire-shot (_type_) none) ;; 42 ) ) -|# -#| (deftype mh-centipede-minimap-dot (process-drawable) - ((minimap connection-minimap :offset-assert 200) + ((parent (pointer mh-centipede) :override) + (minimap connection-minimap :offset-assert 200) ) :method-count-assert 21 :size-assert #xcc @@ -71080,57 +70992,46 @@ idle ;; 20 ) ) -|# -#| (deftype task-manager-mh-centipede (task-manager) - ((vehicle-handle uint64 :offset-assert 236) - (manager-entity basic :offset-assert 244) - (check-timer uint64 :offset-assert 252) - (actor-group uint32 :offset-assert 260) - (actor-group-count int32 :offset-assert 264) - (last-centipede-position vector :inline :offset-assert 268) - (last-target-position vector :inline :offset-assert 284) + ((vehicle-handle handle :offset-assert 240) + (manager-entity entity-actor :offset-assert 248) + (check-timer time-frame :offset-assert 256) + (actor-group (pointer actor-group) :offset-assert 264) + (actor-group-count int32 :offset-assert 268) + (last-centipede-position vector :inline :offset-assert 272) + (last-target-position vector :inline :offset-assert 288) ) :method-count-assert 33 :size-assert #x130 :flag-assert #x2100b00130 (:methods - (task-manager-mh-centipede-method-32 () none) ;; 32 - ) - (:state-methods - active ;; 15 + (init-actor-group! (_type_) none) ;; 32 ) ) -|# -#| (deftype task-manager-nstb-crystal (task-manager) - ((vehicle-handle uint64 :offset-assert 240) + ((vehicle-handle handle :offset-assert 240) ) :method-count-assert 32 :size-assert #xf8 :flag-assert #x20008000f8 - (:state-methods - active ;; 15 - ) ) -|# -;; (define-extern *mh-centipede-sphere-1* object) -;; (define-extern *mh-centipede-sphere-2* object) -;; (define-extern nest-hunt-find-sphere function) -;; (define-extern nest-hunt-same-sphere function) -;; (define-extern nest-hunt-volume function) -;; (define-extern nest-hunt-shake-amp function) -;; (define-extern *nest-hunt-speech-list* object) -;; (define-extern *nest-hunt-speech* object) -;; (define-extern reset-nest-hunt-speeches function) -;; (define-extern nest-hunt-play-speech function) -;; (define-extern *mh-centipede-shadow-control* shadow-control) -;; (define-extern *mh-centipede-exploder-params* joint-exploder-static-params) -;; (define-extern mh-centipede-minimap-dot-init-by-other function) -;; (define-extern mh-centipede-active-handler function) +(define-extern *mh-centipede-sphere-1* sphere) +(define-extern *mh-centipede-sphere-2* sphere) +(define-extern nest-hunt-find-sphere (function vector sphere)) +(define-extern nest-hunt-same-sphere (function sphere vector object)) +(define-extern nest-hunt-volume (function sphere float)) +(define-extern nest-hunt-shake-amp (function vector float)) +(define-extern *nest-hunt-speech-list* (inline-array talker-speech-class)) +(define-extern *nest-hunt-speech* nest-hunt-speech-group) +(define-extern reset-nest-hunt-speeches (function float symbol)) +(define-extern nest-hunt-play-speech (function int sphere none)) +(define-extern *mh-centipede-shadow-control* shadow-control) +(define-extern *mh-centipede-exploder-params* joint-exploder-static-params) +(define-extern mh-centipede-minimap-dot-init-by-other (function object :behavior mh-centipede-minimap-dot)) +(def-event-handler mh-centipede-active-handler mh-centipede) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; desert-lizard-h ;; @@ -71706,54 +71607,60 @@ ;; factory-h ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fac-edge-list (basic) - ((edge UNKNOWN 4 :offset-assert 4) + ((edge int16 4 :offset-assert 4) ) :method-count-assert 9 :size-assert #xc :flag-assert #x90000000c ) -|# -#| +;; +++factory-h:factory-inout-flag +(defenum factory-inout-flag + :type uint8 + :bitfield #t + (fi0 0) + (fi1 1) + (fi2 2) + ) +;; ---factory-h:factory-inout-flag + (deftype factory-inout (structure) ((lpath int16 :offset-assert 0) (lpos float :offset-assert 4) - (flags uint8 :offset-assert 8) + (flags factory-inout-flag :offset-assert 8) ) + :allow-misaligned :method-count-assert 9 :size-assert #x9 :flag-assert #x900000009 ) -|# -#| (deftype factory-pathlist (structure) - ((path UNKNOWN 200 :offset-assert 0) - (inout UNKNOWN 200 :offset-assert 800) - (loops UNKNOWN 200 :offset-assert 4000) + ((path path-control 200 :offset-assert 0) + (inout factory-inout 200 :inline :offset-assert 800) + (loops int16 200 :offset-assert 4000) (npath int8 :offset-assert 4400) (nloop int8 :offset-assert 4401) (curidx int8 :offset-assert 4402) ) + :allow-misaligned :method-count-assert 9 :size-assert #x1133 :flag-assert #x900001133 ) -|# -#| (deftype factory-manager (process) - ((nfighters-spawned uint8 :offset-assert 128) + ((self factory-manager :override) + (nfighters-spawned uint8 :offset-assert 128) (nfighters-total uint8 :offset-assert 129) (ntanks-spawned uint8 :offset-assert 130) - (player-born uint64 :offset-assert 136) - (player-died uint64 :offset-assert 144) - (fighter-spawned uint64 :offset-assert 152) - (fighter-killed uint64 :offset-assert 160) - (tank-spawned uint64 :offset-assert 168) - (tank-killed uint64 :offset-assert 176) + (player-born time-frame :offset-assert 136) + (player-died time-frame :offset-assert 144) + (fighter-spawned time-frame :offset-assert 152) + (fighter-killed time-frame :offset-assert 160) + (tank-spawned time-frame :offset-assert 168) + (tank-killed time-frame :offset-assert 176) (fpath factory-pathlist :inline :offset-assert 184) (tpath factory-pathlist :inline :offset-assert 4588) (cur-wave uint8 :offset-assert 8991) @@ -71761,17 +71668,18 @@ :method-count-assert 17 :size-assert #x2320 :flag-assert #x1122a02320 + (:state-methods + idle ;; 14 + ) (:methods - (factory-manager-method-14 () none) ;; 14 - (factory-manager-method-15 () none) ;; 15 - (factory-manager-method-16 () none) ;; 16 + (factory-manager-method-15 (_type_) none) ;; 15 + (init-paths-for-list! (_type_ factory-pathlist string) symbol) ;; 16 ) ) -|# -#| (deftype factory-fighter (rigid-body-object) - ((first-time? basic :offset-assert 288) + ((parent (pointer factory-manager) :override) + (first-time? symbol :offset-assert 288) (path-pos float :offset-assert 292) (forw vector :inline :offset-assert 304) (upvc vector :inline :offset-assert 320) @@ -71781,56 +71689,56 @@ (blendpath float :offset-assert 384) (newpath int8 :offset-assert 388) (path-idx int8 :offset-assert 389) - (last-hit-time uint64 :offset-assert 392) - (disappear basic :offset-assert 400) - (last-fire uint64 :offset-assert 408) + (last-hit-time time-frame :offset-assert 392) + (disappear symbol :offset-assert 400) + (last-fire time-frame :offset-assert 408) (turret-gun int8 :offset-assert 416) - (light-trail uint64 :offset-assert 424) + (light-trail handle :offset-assert 424) (rot-vel float :offset-assert 432) (rot-acc float :offset-assert 436) - (engine-sound uint32 :offset-assert 440) - (engine-sound-playing? basic :offset-assert 444) - (last-snd-cmd uint64 :offset-assert 448) - (red-tip-change-time uint64 :offset-assert 456) - (red-tip-on basic :offset-assert 464) + (engine-sound sound-id :offset-assert 440) + (engine-sound-playing? symbol :offset-assert 444) + (last-snd-cmd time-frame :offset-assert 448) + (red-tip-change-time time-frame :offset-assert 456) + (red-tip-on symbol :offset-assert 464) ) :method-count-assert 63 :size-assert #x1d4 :flag-assert #x3f016001d4 + (:state-methods + flying ;; 56 + explode ;; 57 + dive ;; 58 + die ;; 59 + ) (:methods - (factory-fighter-method-56 () none) ;; 56 - (factory-fighter-method-57 () none) ;; 57 - (factory-fighter-method-58 () none) ;; 58 - (factory-fighter-method-59 () none) ;; 59 - (factory-fighter-method-60 () none) ;; 60 - (factory-fighter-method-61 () none) ;; 61 - (factory-fighter-method-62 () none) ;; 62 + (fire-shot (_type_) projectile) ;; 60 + (factory-fighter-method-61 (_type_) none) ;; 61 + (factory-fighter-method-62 (_type_ symbol) none) ;; 62 ) ) -|# -#| (deftype fac-target (process-focusable) ((sync sync-paused :inline :offset-assert 208) (minimap connection-minimap :offset-assert 232) - (light-jm basic :offset-assert 236) + (light-jm joint-mod :offset-assert 236) ) :method-count-assert 35 :size-assert #xf0 :flag-assert #x23007000f0 + (:state-methods + idle ;; 28 + die-fast ;; 29 + retract ;; 30 + retracted ;; 31 + explode ;; 32 + ) (:methods - (fac-target-method-28 () none) ;; 28 - (fac-target-method-29 () none) ;; 29 - (fac-target-method-30 () none) ;; 30 - (fac-target-method-31 () none) ;; 31 - (fac-target-method-32 () none) ;; 32 - (fac-target-method-33 () none) ;; 33 - (fac-target-method-34 () none) ;; 34 + (fac-target-method-33 (_type_) none) ;; 33 + (fac-target-method-34 (_type_) none) ;; 34 ) ) -|# -#| (deftype fac-gun-tower (process-focusable) ((yaw float :offset-assert 208) (yawvel float :offset-assert 212) @@ -71838,82 +71746,75 @@ (pitchvel float :offset-assert 220) (dyaw float :offset-assert 224) (dpitch float :offset-assert 228) - (last-fire uint64 :offset-assert 232) - (last-hit-time uint64 :offset-assert 240) + (last-fire time-frame :offset-assert 232) + (last-hit-time time-frame :offset-assert 240) (gunrot int8 :offset-assert 248) (muzzle int8 :offset-assert 249) (gun-idx int8 :offset-assert 250) (attack-id int32 :offset-assert 252) - (gun-tilt-jm basic :offset-assert 256) + (gun-tilt-jm joint-mod :offset-assert 256) (hit-points float :offset-assert 260) - (invincable basic :offset-assert 264) - (rotate-sound uint32 :offset-assert 268) - (rotate-sound-playing basic :offset-assert 272) - (blade-sound uint32 :offset-assert 276) - (blade-sound-playing basic :offset-assert 280) - (snd-cmd-time uint64 :offset-assert 288) + (invincable symbol :offset-assert 264) + (rotate-sound sound-id :offset-assert 268) + (rotate-sound-playing symbol :offset-assert 272) + (blade-sound sound-id :offset-assert 276) + (blade-sound-playing symbol :offset-assert 280) + (snd-cmd-time time-frame :offset-assert 288) (minimap connection-minimap :offset-assert 296) ) :method-count-assert 38 :size-assert #x12c :flag-assert #x2600b0012c + (:state-methods + open ;; 28 + idle ;; 29 + die ;; 30 + die-fast ;; 31 + ) (:methods - (fac-gun-tower-method-28 () none) ;; 28 - (fac-gun-tower-method-29 () none) ;; 29 - (fac-gun-tower-method-30 () none) ;; 30 - (fac-gun-tower-method-31 () none) ;; 31 - (fac-gun-tower-method-32 () none) ;; 32 - (fac-gun-tower-method-33 () none) ;; 33 - (fac-gun-tower-method-34 () none) ;; 34 - (fac-gun-tower-method-35 () none) ;; 35 - (fac-gun-tower-method-36 () none) ;; 36 - (fac-gun-tower-method-37 () none) ;; 37 + (fac-gun-tower-method-32 (_type_) none) ;; 32 + (fac-gun-tower-method-33 (_type_) none) ;; 33 + (fac-gun-tower-method-34 (_type_) none) ;; 34 + (fire-shot (_type_) projectile) ;; 35 + (fac-gun-tower-method-36 (_type_) none) ;; 36 + (send-attack (_type_ process-focusable) none) ;; 37 ) ) -|# -#| (deftype fac-gun-tower-break (process-drawable) () :method-count-assert 22 :size-assert #xc8 :flag-assert #x16005000c8 - (:methods - (fac-gun-tower-break-method-20 () none) ;; 20 - (fac-gun-tower-break-method-21 () none) ;; 21 + (:state-methods + idle ;; 20 + idle-stick ;; 21 ) ) -|# -#| (deftype fac-gun-tower-base-broken (process-drawable) () :method-count-assert 21 :size-assert #xc8 :flag-assert #x15005000c8 - (:methods - (fac-gun-tower-base-broken-method-20 () none) ;; 20 + (:state-methods + idle ;; 20 ) ) -|# -#| (deftype hud-factory-damage (hud) () :method-count-assert 27 :size-assert #xac4 :flag-assert #x1b0a500ac4 ) -|# - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ffight-projectile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ffight-shot (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) ) :method-count-assert 41 @@ -71923,18 +71824,16 @@ impact ;; 22 ) ) -|# -;; (define-extern ffight-shot-move function) -;; (define-extern spawn-ffight-projectile function) +(define-extern ffight-shot-move (function ffight-shot none)) +(define-extern spawn-ffight-projectile (function process vector vector float symbol projectile)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; ftank-projectile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype ftank-shot (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) ) :method-count-assert 41 @@ -71944,52 +71843,46 @@ impact ;; 22 ) ) -|# -;; (define-extern ftank-shot-move function) -;; (define-extern spawn-ftank-projectile function) +(define-extern ftank-shot-move (function ftank-shot none)) +(define-extern spawn-ftank-projectile (function process vector vector float vector projectile)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fturret-projectile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fturret-shot (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) ) :method-count-assert 41 :size-assert #x220 :flag-assert #x2901a00220 ) -|# -;; (define-extern fturret-shot-move function) -;; (define-extern spawn-fturret-projectile function) +(define-extern fturret-shot-move (function fturret-shot none)) +(define-extern spawn-fturret-projectile (function process vector vector float vector projectile)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; warf-projectile ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype warf-explosion-sphere (process-drawable) ((current-alpha float :offset-assert 200) - (expanding? basic :offset-assert 216) + (expanding? symbol :offset 216) ) :method-count-assert 23 :size-assert #xdc :flag-assert #x17006000dc - (:methods - (warf-explosion-sphere-method-21 () none) ;; 21 - (warf-explosion-sphere-method-22 () none) ;; 22 - ) (:state-methods active ;; 20 ) + (:methods + (warf-explosion-sphere-method-21 (_type_) none) ;; 21 + (warf-explosion-sphere-method-22 (_type_) none) ;; 22 + ) ) -|# -#| (deftype warf-explosion-sphere-init-params (structure) ((pos vector :inline :offset-assert 0) ) @@ -71997,36 +71890,29 @@ :size-assert #x10 :flag-assert #x900000010 ) -|# -#| (deftype warf-projectile (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) (hit-pos vector :inline :offset-assert 544) - (last-hit-time uint64 :offset-assert 560) - (snd-whoosh uint32 :offset-assert 568) - (muzzle-flash-part basic :offset-assert 576) + (last-hit-time time-frame :offset-assert 560) + (snd-whoosh sound-id :offset-assert 568) + (muzzle-flash-part sparticle-launch-control :offset 576) ) :method-count-assert 46 :size-assert #x244 :flag-assert #x2e01d00244 (:methods - (warf-projectile-method-41 () none) ;; 41 - (warf-projectile-method-42 () none) ;; 42 - (warf-projectile-method-43 () none) ;; 43 - (warf-projectile-method-44 () none) ;; 44 - (warf-projectile-method-45 () none) ;; 45 - ) - (:state-methods - impact ;; 22 + (warf-projectile-method-41 (_type_) none) ;; 41 + (warf-projectile-method-42 (_type_ vector) none) ;; 42 + (warf-projectile-method-43 (_type_) none) ;; 43 + (send-attack (_type_ process-focusable) none) ;; 44 + (warf-projectile-method-45 (_type_) none) ;; 45 ) ) -|# -#| (deftype fac-gun-tower-projectile (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) ) :method-count-assert 41 @@ -72036,46 +71922,42 @@ impact ;; 22 ) ) -|# -#| (deftype gun-warf-shot (projectile) - ((hit-actor? basic :offset-assert 512) + ((hit-actor? symbol :offset-assert 512) (tail-pos vector :inline :offset-assert 528) (hit-pos vector :inline :offset-assert 544) - (last-hit-time uint64 :offset-assert 560) - (snd-whoosh uint32 :offset-assert 568) - (muzzle-flash-part basic :offset-assert 572) - (main-shot-part basic :offset-assert 576) - (shot-aim-part basic :offset-assert 580) + (last-hit-time time-frame :offset-assert 560) + (snd-whoosh sound-id :offset-assert 568) + (muzzle-flash-part sparticle-launch-control :offset-assert 572) + (main-shot-part sparticle-launch-control :offset-assert 576) + (shot-aim-part sparticle-launch-control :offset-assert 580) ) :method-count-assert 44 :size-assert #x248 :flag-assert #x2c01d00248 (:methods - (gun-warf-shot-method-41 () none) ;; 41 - (gun-warf-shot-method-42 () none) ;; 42 - (gun-warf-shot-method-43 () none) ;; 43 + (gun-warf-shot-method-41 (_type_ vector vector) none) ;; 41 + (gun-warf-shot-method-42 (_type_ float float matrix) none) ;; 42 + (launch-part (_type_ vector) none) ;; 43 ) ) -|# -;; (define-extern warf-explosion-sphere-init-by-other function) -;; (define-extern warf-explosion-sphere-event-handler function) -;; (define-extern spawn-warf-projectile function) -;; (define-extern spawn-fac-gun-tower-projectile function) -;; (define-extern warf-projectile-move function) -;; (define-extern spt-func-factory-move function) -;; (define-extern spt-func-part-crystal-torpedo-in function) -;; (define-extern spt-func-part-crystal-torpedo-out function) -;; (define-extern fac-gun-tower-projectile-move function) -;; (define-extern gun-warf-shot-move function) +(define-extern warf-explosion-sphere-init-by-other (function warf-explosion-sphere-init-params object :behavior warf-explosion-sphere)) +(def-event-handler warf-explosion-sphere-event-handler warf-explosion-sphere) +(define-extern spawn-warf-projectile (function process vector vector float projectile)) +(define-extern spawn-fac-gun-tower-projectile (function process vector vector float projectile)) +(define-extern warf-projectile-move (function warf-projectile none)) +(define-extern spt-func-factory-move (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern spt-func-part-crystal-torpedo-in (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern spt-func-part-crystal-torpedo-out (function sparticle-system sparticle-cpuinfo sprite-vec-data-2d none)) +(define-extern fac-gun-tower-projectile-move (function fac-gun-tower-projectile none)) +(define-extern gun-warf-shot-move (function gun-warf-shot none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; h-warf ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype h-warf (hvehicle) ((minalt float :offset-assert 944) (curalt float :offset-assert 948) @@ -72086,30 +71968,30 @@ (pitcherr float :offset-assert 996) (straighterr float :offset-assert 1000) (alterr float :offset-assert 1004) - (rolling basic :offset-assert 1008) + (rolling symbol :offset-assert 1008) (speed float :offset-assert 1012) (poierr float :offset-assert 1016) (poipos float :offset-assert 1020) (poivel float :offset-assert 1024) (bigshotcount int8 :offset-assert 1028) - (deathspin basic :offset-assert 1032) + (deathspin symbol :offset-assert 1032) (deathrot vector :inline :offset-assert 1040) - (birth uint64 :offset-assert 1056) - (stop-time uint64 :offset-assert 1064) - (bounce-state? basic :offset-assert 1072) + (birth time-frame :offset-assert 1056) + (stop-time time-frame :offset-assert 1064) + (bounce-state? symbol :offset-assert 1072) (bounce-angle float :offset-assert 1076) - (fire-time UNKNOWN 4 :offset-assert 1080) - (l1-fire-time uint64 :offset-assert 1112) - (l1-recharge-time uint64 :offset-assert 1120) - (snd-cmd-time uint64 :offset-assert 1128) - (damage-loop uint32 :offset-assert 1136) - (damage-loop-playing? basic :offset-assert 1140) + (fire-time time-frame 4 :offset-assert 1080) + (l1-fire-time time-frame :offset-assert 1112) + (l1-recharge-time time-frame :offset-assert 1120) + (snd-cmd-time time-frame :offset-assert 1128) + (damage-loop sound-id :offset-assert 1136) + (damage-loop-playing? symbol :offset-assert 1140) (damage-loop-index uint8 :offset-assert 1144) - (engine-sound uint32 :offset-assert 1148) - (engine-boost-sound uint32 :offset-assert 1152) - (wind-noise-sound uint32 :offset-assert 1156) - (wind-noise-playing? basic :offset-assert 1160) - (track-obj uint64 :offset-assert 1168) + (engine-sound sound-id :offset-assert 1148) + (engine-boost-sound sound-id :offset-assert 1152) + (wind-noise-sound sound-id :offset-assert 1156) + (wind-noise-playing? symbol :offset-assert 1160) + (track-obj handle :offset-assert 1168) (track-joint int8 :offset-assert 1176) (wind float :offset-assert 1180) ) @@ -72117,14 +71999,19 @@ :size-assert #x4a0 :flag-assert #xa5042004a0 (:methods - (h-warf-method-162 () none) ;; 162 - (h-warf-method-163 () none) ;; 163 - (h-warf-method-164 () none) ;; 164 + (h-warf-method-162 (_type_ time-frame) symbol) ;; 162 + (h-warf-method-163 (_type_ vector) float) ;; 163 + (draw-thrusters (_type_ float vector vector) none) ;; 164 ) ) -|# -#| +(deftype h-warf-stack-var0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (mat matrix :inline :offset 32) + ) + ) + (deftype warf-asc (structure) ((asc float :offset-assert 0) (des float :offset-assert 4) @@ -72133,24 +72020,22 @@ :size-assert #x8 :flag-assert #x900000008 ) -|# -;; (define-extern *h-warf-center-of-level* object) -;; (define-extern *h-warf-constants* object) -;; (define-extern impact-reduction function) -;; (define-extern steer-attenuation function) -;; (define-extern ascention-atten! function) -;; (define-extern world-to-local-vec! function) +(define-extern *h-warf-center-of-level* vector) +(define-extern *h-warf-constants* rigid-body-vehicle-constants) +(define-extern impact-reduction (function int float)) +(define-extern steer-attenuation (function int float)) +(define-extern ascention-atten! (function float vector)) +(define-extern world-to-local-vec! (function vector vector matrix vector)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fac-gunturret ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fac-gun-tower-turret-params (structure) - ((normal-sg basic :offset-assert 0) - (explode-sg basic :offset-assert 4) - (enemy-info basic :offset-assert 8) + ((normal-sg skeleton-group :offset-assert 0) + (explode-sg skeleton-group :offset-assert 4) + (enemy-info enemy-info :offset-assert 8) (idle-anim int32 :offset-assert 12) (shoot-anim int32 :offset-assert 16) (track-joint int32 :offset-assert 20) @@ -72163,62 +72048,57 @@ :size-assert #x28 :flag-assert #x900000028 ) -|# -#| (deftype fac-gunturret (enemy) - ((left-gun-tilt-jm basic :offset-assert 552) - (right-gun-tilt-jm basic :offset-assert 556) + ((left-gun-tilt-jm joint-mod :offset-assert 552) + (right-gun-tilt-jm joint-mod :offset-assert 556) (params fac-gun-tower-turret-params :offset-assert 560) (aim-pos vector :inline :offset-assert 576) (gun-twist float :offset-assert 592) (gun-tilt float :offset-assert 596) (desired-twist float :offset-assert 600) (desired-tilt float :offset-assert 604) - (los-clear basic :offset-assert 608) - (smoke-part basic :offset-assert 612) - (casing-part basic :offset-assert 616) - (flash-state basic :offset-assert 620) - (can-shoot basic :offset-assert 624) - (last-hit-time uint64 :offset-assert 632) + (los-clear symbol :offset-assert 608) + (smoke-part sparticle-launch-control :offset-assert 612) + (casing-part sparticle-launch-control :offset-assert 616) + (flash-state symbol :offset-assert 620) + (can-shoot symbol :offset-assert 624) + (last-hit-time time-frame :offset-assert 632) (init-mat matrix :inline :offset-assert 640) (activate-distance float :offset-assert 704) (aim-offset vector :inline :offset-assert 720) - (use-alt-barrel basic :offset-assert 736) - (rotate-sound uint32 :offset-assert 740) - (rotate-sound-playing basic :offset-assert 744) - (snd-cmd-time uint64 :offset-assert 752) + (use-alt-barrel symbol :offset-assert 736) + (rotate-sound sound-id :offset-assert 740) + (rotate-sound-playing symbol :offset-assert 744) + (snd-cmd-time time-frame :offset-assert 752) ) :method-count-assert 161 :size-assert #x2f8 :flag-assert #xa1028002f8 - (:methods - (fac-gunturret-method-155 () none) ;; 155 - (fac-gunturret-method-156 () none) ;; 156 - (fac-gunturret-method-157 () none) ;; 157 - (fac-gunturret-method-158 () none) ;; 158 - (fac-gunturret-method-159 () none) ;; 159 - (fac-gunturret-method-160 () none) ;; 160 - ) (:state-methods - die ;; 40 stare ;; 37 hostile ;; 38 + die ;; 40 + ) + (:methods + (track-target (_type_ symbol) none) ;; 155 + (check-los (_type_) none) ;; 156 + (reset-aim (_type_) none) ;; 157 + (fire-shot (_type_ symbol) none) ;; 158 + (init-turret-params! (_type_) none) ;; 159 + (go-explode (_type_) (pointer joint-exploder)) ;; 160 ) ) -|# -#| (deftype fac-gun-tower-turret (fac-gunturret) () :method-count-assert 161 :size-assert #x2f8 :flag-assert #xa1028002f8 ) -|# -;; (define-extern *fac-gunturret-exploder-params* joint-exploder-static-params) -;; (define-extern *fac-gunturret-enemy-info* enemy-info) +(define-extern *fac-gunturret-exploder-params* joint-exploder-static-params) +(define-extern *fac-gunturret-enemy-info* enemy-info) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fac-robotank-h ;; @@ -72229,7 +72109,24 @@ ;; fac-robotank-turret ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +;; +++fac-robotank-turret:fac-robotank-turret-flag +(defenum fac-robotank-turret-flag + :type uint16 + :bitfield #t + (frt0 0) + (frt1 1) + (frt2 2) + (frt3 3) + (frt4 4) + (frt5 5) + (frt6 6) + (frt7 7) + (frt8 8) + (frt9 9) + (frt10 10) + ) +;; ---fac-robotank-turret:fac-robotank-turret-flag + (deftype fac-robotank-turret (process-focusable) ((los los-control :inline :offset-assert 208) (tank-quat quaternion :inline :offset-assert 384) @@ -72242,96 +72139,99 @@ (offset vector :inline :offset-assert 448) (sight-pos vector :inline :offset-assert 464) (firing-sight-pos vector :inline :offset-assert 480) - (aim-pos UNKNOWN 3 :offset-assert 496) - (gun-timer uint64 :offset-assert 544) - (gun-elev-jmod basic :offset-assert 552) + (aim-pos vector 3 :inline :offset-assert 496) + (gun-timer time-frame :offset-assert 544) + (gun-elev-jmod joint-mod :offset-assert 552) (gun-elev float :offset-assert 556) (gun-elev-cam float :offset-assert 560) - (gun-joint-l UNKNOWN 2 :offset-assert 564) - (gun-joint-r UNKNOWN 2 :offset-assert 572) + (gun-joint-l int32 2 :offset-assert 564) + (gun-joint-r int32 2 :offset-assert 572) (gun-spread float :offset-assert 580) (gun-index int32 :offset-assert 584) - (flags uint16 :offset-assert 588) - (turn-sound-id uint32 :offset-assert 592) + (flags fac-robotank-turret-flag :offset-assert 588) + (turn-sound-id sound-id :offset-assert 592) ) :method-count-assert 35 :size-assert #x254 :flag-assert #x2301e00254 - (:methods - (fac-robotank-turret-method-31 () none) ;; 31 - (fac-robotank-turret-method-32 () none) ;; 32 - (fac-robotank-turret-method-33 () none) ;; 33 - (fac-robotank-turret-method-34 () none) ;; 34 - ) (:state-methods - die ;; 30 - fire ;; 29 ready ;; 28 + fire ;; 29 + die ;; 30 + ) + (:methods + (fac-robotank-turret-method-31 (_type_ vector vector) object) ;; 31 + (fac-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer ftank-shot)) ;; 32 + (fac-robotank-turret-method-33 (_type_) none) ;; 33 + (fac-robotank-turret-method-34 (_type_ vector float) symbol) ;; 34 ) ) -|# -#| (deftype fac-robotank-reticle (process-drawable) ((shadow-jmod joint-mod-set-local :offset-assert 200) (sight-jmod joint-mod-set-local :offset-assert 204) - (ring-jmod UNKNOWN 3 :offset-assert 208) - (ring-timer uint64 :offset-assert 224) + (ring-jmod joint-mod 3 :offset-assert 208) + (ring-timer time-frame :offset-assert 224) (sight-scale vector :inline :offset-assert 240) (collide-dist float :offset-assert 256) ) :method-count-assert 22 :size-assert #x104 :flag-assert #x1600900104 - (:methods - (fac-robotank-reticle-method-20 () none) ;; 20 - (fac-robotank-reticle-method-21 () none) ;; 21 + (:state-methods + unlock ;; 20, not defined + lock ;; 21, not defined ) ) -|# -;; (define-extern fac-robotank-reticle-post function) -;; (define-extern fac-robotank-reticle-handler function) -;; (define-extern draw-2d-hud function) ;; (function vector symbol) -;; (define-extern turret-post function) ;; (function none :behavior fort-robotank-turret) -;; (define-extern robotank-turret-handler function) ;; (function process int symbol event-message-block object :behavior fort-robotank-turret) -;; (define-extern fac-robotank-turret-init-by-other function) +(define-extern fac-robotank-reticle-post (function none :behavior fac-robotank-reticle)) +(def-event-handler fac-robotank-reticle-handler fac-robotank-reticle) +(define-extern draw-2d-hud (function vector symbol)) +(define-extern turret-post (function none :behavior fac-robotank-turret)) +(def-event-handler robotank-turret-handler fac-robotank-turret) +(define-extern fac-robotank-turret-init-by-other (function vector quaternion vector float object :behavior fac-robotank-turret)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fac-robotank ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| +(declare-type fort-robotank process-drawable) (deftype fac-robotank-segment-event (structure) ((source uint64 :offset-assert 0) - (event-type basic :offset-assert 8) - (actor basic :offset-assert 12) + (event-type symbol :offset-assert 8) + (actor string :offset-assert 12) (pos-norm float :offset-assert 16) (param basic :offset-assert 20) + (param-obj object :offset 20) + (param-func (function fort-robotank none) :offset 20) + (param-sym symbol :offset 20) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ;; field param uses ~A with a signed load. ) -|# -#| +;; +++fac-robotank:robotank-segment-flag +(defenum robotank-segment-flag + :type uint16 + :bitfield #t + ) +;; ---fac-robotank:robotank-segment-flag + (deftype fac-robotank-segment (structure) - ((flags uint16 :offset-assert 0) + ((flags robotank-segment-flag :offset-assert 0) (max-speed float :offset-assert 4) (next-segment int32 :offset-assert 8) (next-segment-start float :offset-assert 12) (event-count int32 :offset-assert 16) - (event-tbl uint32 :offset-assert 20) + (event-tbl (inline-array fac-robotank-segment-event) :offset-assert 20) ) :method-count-assert 9 :size-assert #x18 :flag-assert #x900000018 ) -|# -#| (deftype fac-robotank-path-info (structure) ((dir vector :inline :offset-assert 0) (u float :offset-assert 16) @@ -72347,55 +72247,65 @@ :size-assert #x30 :flag-assert #x900000030 ) -|# -#| (deftype fac-robotank-path-info-array (inline-array-class) - ((data UNKNOWN :dynamic :offset-assert 16) + ((data fac-robotank-path-info :dynamic :inline :offset-assert 16) ) :method-count-assert 14 :size-assert #x10 :flag-assert #xe00000010 ) -|# -#| (deftype fac-robotank-wheel-info (structure) - ((jmod basic :offset-assert 0) + ((jmod joint-mod-spinner :offset-assert 0) (radius float :offset-assert 4) ) :method-count-assert 9 :size-assert #x8 :flag-assert #x900000008 ) -|# -#| (deftype fac-robotank-tread-info (structure) - ((wheel UNKNOWN 7 :offset-assert 0) - (texture texture-anim :offset-assert 112) - (locator-joint int32 :offset-assert 116) - (pos vector :inline :offset-assert 128) + ((wheel fac-robotank-wheel-info 7 :inline :offset-assert 0) + (texture texture-anim :offset-assert 112) + (locator-joint int32 :offset-assert 116) + (pos vector :inline :offset-assert 128) ) :method-count-assert 9 :size-assert #x90 :flag-assert #x900000090 ) -|# -#| +;; +++fac-robotank:robotank-flag +(defenum robotank-flag + :type uint16 + :bitfield #t + (r0 0) + (r1 1) + (r2 2) + (r3 3) + (r4 4) + (r5 5) + (r6 6) + (r7 7) + ) +;; ---fac-robotank:robotank-flag + (deftype fac-robotank (process-focusable) - ((barrel-part basic :offset-assert 208) + ((parent (pointer factory-manager) :override) + (self fac-robotank :override) + (ppointer (pointer fac-robotank) :override) + (barrel-part sparticle-launch-control :offset-assert 208) (vibe-jmod joint-mod-blend-local :inline :offset-assert 224) - (tread UNKNOWN 2 :offset-assert 352) - (path-info basic :offset-assert 640) - (flags uint16 :offset-assert 644) - (mgr uint64 :offset-assert 648) - (pov-cam-offset UNKNOWN 2 :offset-assert 656) - (explode-sg basic :offset-assert 688) - (turret uint64 :offset-assert 696) - (no-collision-timer uint64 :offset-assert 704) - (buzz-timer uint64 :offset-assert 712) + (tread fac-robotank-tread-info 2 :inline :offset-assert 352) + (path-info fac-robotank-path-info-array :offset-assert 640) + (flags robotank-flag :offset-assert 644) + (mgr handle :offset-assert 648) + (pov-cam-offset vector 2 :inline :offset-assert 656) + (explode-sg skeleton-group :offset-assert 688) + (turret handle :offset-assert 696) + (no-collision-timer time-frame :offset-assert 704) + (buzz-timer time-frame :offset-assert 712) (engine-vibe-rate float :offset-assert 720) (engine-vibe-amp float :offset-assert 724) (attack-id uint32 :offset-assert 728) @@ -72403,39 +72313,37 @@ (path-count int32 :offset-assert 736) (continue-index int32 :offset-assert 740) (hit-points float :offset-assert 744) - (engine-sound uint32 :offset-assert 748) - (engine-sound-playing basic :offset-assert 752) - (snd-cmd-time uint64 :offset-assert 760) + (engine-sound sound-id :offset-assert 748) + (engine-sound-playing symbol :offset-assert 752) + (snd-cmd-time time-frame :offset-assert 760) ) :method-count-assert 35 :size-assert #x300 :flag-assert #x2302800300 - (:methods - (fac-robotank-method-32 () none) ;; 32 - (fac-robotank-method-33 () none) ;; 33 - (fac-robotank-method-34 () none) ;; 34 - ) (:state-methods - die ;; 31 - pause ;; 30 - moving ;; 29 turning ;; 28 + moving ;; 29 + pause ;; 30 + die ;; 31 + ) + (:methods + (fac-robotank-method-32 (_type_) none) ;; 32 + (fac-robotank-method-33 (_type_) none) ;; 33 + (go-explode (_type_) (pointer joint-exploder)) ;; 34 ) ) -|# -;; (define-extern *fac-robotank-exploder-params* joint-exploder-static-params) -;; (define-extern fac-robotank-post function) -;; (define-extern fac-robotank-handler function) -;; (define-extern fac-robotank-birth-path function) -;; (define-extern fac-robotank-init-by-other function) -;; (define-extern fac-robotank-spawn function) +(define-extern *fac-robotank-exploder-params* joint-exploder-static-params) +(define-extern fac-robotank-post (function none :behavior fac-robotank)) +(def-event-handler fac-robotank-handler fac-robotank) +(define-extern fac-robotank-birth-path (function factory-manager int :behavior fac-robotank)) +(define-extern fac-robotank-init-by-other (function object :behavior fac-robotank)) +(define-extern fac-robotank-spawn (function process fac-robotank)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; fac-tower ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype fac-gun-tower-base (process-focusable) () :method-count-assert 30 @@ -72446,103 +72354,89 @@ explode ;; 29 ) ) -|# -#| (deftype gun-tower-base (fac-gun-tower-base) () :method-count-assert 30 :size-assert #xd0 :flag-assert #x1e005000d0 ) -|# -;; (define-extern *fac-tower-impact-pos* object) -;; (define-extern *fac-gun-tower-break-anim-idx* object) -;; (define-extern fac-gun-tower-base-broken-init-by-other function) -;; (define-extern fac-gun-tower-break-init-by-other function) -;; (define-extern start-destroyed-fac-gun-tower-base function) -;; (define-extern start-destroyed-fac-gun-tower function) -;; (define-extern fac-gun-tower-standard-event-handler function) -;; (define-extern fac-deg-delta function) +(define-extern *fac-tower-impact-pos* vector) +(define-extern *fac-gun-tower-break-anim-idx* int) +(define-extern fac-gun-tower-base-broken-init-by-other (function vector quaternion object :behavior fac-gun-tower-base-broken)) +(define-extern fac-gun-tower-break-init-by-other (function int vector quaternion object :behavior fac-gun-tower-break)) +(define-extern start-destroyed-fac-gun-tower-base (function vector quaternion process int)) +(define-extern start-destroyed-fac-gun-tower (function vector quaternion process (pointer fac-gun-tower-break))) +(def-event-handler fac-gun-tower-standard-event-handler fac-gun-tower) +(define-extern fac-deg-delta (function float float float)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-manager ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -#| (deftype task-manager-factory-sky-battle (task-manager) - ((factory-sky-battle-entity basic :offset-assert 236) - (check-timer uint64 :offset-assert 244) - (ended-timer uint64 :offset-assert 252) - (mission-complete-time uint64 :offset-assert 260) - (actor-group uint32 :offset-assert 268) - (actor-group-count int32 :offset-assert 272) - (cur-group int8 :offset-assert 276) - (hud-delay uint64 :offset-assert 284) - (sound-id uint32 :offset-assert 292) - (hud-damage uint64 :offset-assert 300) - (hint-given basic :offset-assert 308) + ((factory-sky-battle-entity entity-actor :offset-assert 240) + (check-timer time-frame :offset-assert 248) + (ended-timer time-frame :offset-assert 256) + (mission-complete-time time-frame :offset-assert 264) + (actor-group (pointer actor-group) :offset-assert 272) + (actor-group-count int32 :offset-assert 276) + (cur-group int8 :offset-assert 280) + (hud-delay handle :offset-assert 288) + (sound-id sound-id :offset-assert 296) + (hud-damage handle :offset-assert 304) + (hint-given symbol :offset-assert 312) ) :method-count-assert 33 :size-assert #x13c :flag-assert #x2100c0013c (:methods - (task-manager-factory-sky-battle-method-32 () none) ;; 32 - ) - (:state-methods - resolution ;; 17 + (task-manager-factory-sky-battle-method-32 (_type_) none) ;; 32 ) ) -|# -#| (deftype light-trail-tracker-vehicle (light-trail-tracker) () :method-count-assert 21 :size-assert #xac :flag-assert #x15003000ac ) -|# -#| (deftype factory-fighter-path (process-drawable) () :method-count-assert 20 :size-assert #xc8 :flag-assert #x14005000c8 ) -|# -#| (deftype factory-tanks-path (process-drawable) () :method-count-assert 20 :size-assert #xc8 :flag-assert #x14005000c8 ) -|# -;; (define-extern *fac-task-manager* object) -;; (define-extern *fac-fighter-fired* object) -;; (define-extern *fac-wave* object) -;; (define-extern *fac-shotsleft* object) -;; (define-extern *factory-fighter-trail* object) -;; (define-extern fac-count-curves function) -;; (define-extern *fac-tmp-str* object) -;; (define-extern factory-manager-init-by-other function) -;; (define-extern factory-manager-start function) -;; (define-extern *fac-fighter-rigid-body-constants* object) -;; (define-extern *fac-fighter-exploder-params* joint-exploder-static-params) -;; (define-extern fighter-best-birth-path function) -;; (define-extern fighter-birth-path function) -;; (define-extern factory-fighter-standard-event-handler function) -;; (define-extern factory-fighter-init-by-other function) -;; (define-extern factory-fighter-spawn function) -;; (define-extern *fac-target-exploder-params* joint-exploder-static-params) -;; (define-extern hack-wave function) -;; (define-extern fac-target-standard-event-handler function) -;; (define-extern factory-shotsleft function) +(define-extern *fac-task-manager* task-manager-factory-sky-battle) +(define-extern *fac-fighter-fired* time-frame) +(define-extern *fac-wave* int) +(define-extern *fac-shotsleft* int) +(define-extern *factory-fighter-trail* light-trail-composition) +(define-extern fac-count-curves (function entity-actor int)) +(define-extern *fac-tmp-str* string) +(define-extern factory-manager-init-by-other (function level object :behavior factory-manager)) +(define-extern factory-manager-start (function level none)) +(define-extern *fac-fighter-rigid-body-constants* rigid-body-object-constants) +(define-extern *fac-fighter-exploder-params* joint-exploder-static-params) +(define-extern fighter-best-birth-path (function factory-manager int)) +(define-extern fighter-birth-path (function factory-manager int)) +(def-event-handler factory-fighter-standard-event-handler factory-fighter) +(define-extern factory-fighter-init-by-other (function object :behavior factory-fighter)) +(define-extern factory-fighter-spawn (function process factory-fighter)) +(define-extern *fac-target-exploder-params* joint-exploder-static-params) +(define-extern hack-wave (function symbol)) +(def-event-handler fac-target-standard-event-handler fac-target) +(define-extern factory-shotsleft (function int none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; factory-hud ;; @@ -72553,9 +72447,9 @@ ;; factorya-init ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (define-extern factorya-login function) -;; (define-extern factorya-activate function) -;; (define-extern factorya-deactivate function) +(define-extern factorya-login (function level none)) +(define-extern factorya-activate (function level none)) +(define-extern factorya-deactivate (function level none)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; mined-mood ;; diff --git a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc index dea6a94f5e..3a1e09120b 100644 --- a/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/anonymous_function_types.jsonc @@ -777,5 +777,86 @@ [7, "(function process-tree object)"], [8, "(function process-tree object)"], [9, "(function process-tree object)"] + ], + "des-burning-bush": [[37, "(function symbol)"]], + "mh-wasp": [ + [9, "(function mh-wasp cspace float float vector vector int none)"] + ], + "mh-bat": [ + [1, "(function cspace transformq none)"], + [21, "(function object :behavior mh-bat)"], + [26, "(function object :behavior mh-bat)"], + [30, "(function object :behavior mh-bat)"], + [34, "(function object :behavior mh-bat)"], + [39, "(function object :behavior mh-bat)"] + ], + "factoryc-obs2": [ + [67, "(function (pointer joint-exploder) :behavior fac-break-floor)"] + ], + "factory-scenes": [ + [0, "(function none :behavior scene-player)"], + [1, "(function none :behavior scene-player)"], + [2, "(function none :behavior scene-player)"], + [3, "(function none :behavior scene-player)"], + [4, "(function none :behavior scene-player)"], + [5, "(function none :behavior scene-player)"], + [6, "(function none :behavior scene-player)"], + [7, "(function none :behavior scene-player)"], + [8, "(function none :behavior scene-player)"], + [9, "(function none :behavior scene-player)"], + [10, "(function process-drawable none :behavior scene-player)"], + [11, "(function none :behavior scene-player)"], + [12, "(function none :behavior scene-player)"], + [13, "(function none :behavior scene-player)"], + [14, "(function none :behavior scene-player)"], + [15, "(function none :behavior scene-player)"] + ], + "factory-boss-setup": [[37, "(function object :behavior manipy)"]], + "factory-boss-scenes": [ + [1, "(function none :behavior scene-player)"], + [2, "(function none :behavior scene-player)"] + ], + "bot": [[25, "(function gui-connection symbol :behavior bot)"]], + "oasis-defense": [ + [4, "(function collide-shape-prim none)"], + [11, "(function collide-shape-prim none)"] + ], + "ash-oasis-course": [ + [0, "(function ashelin-oasis object)"], + [1, "(function ashelin-oasis object)"], + [2, "(function asht-wait-spot ashelin-oasis object)"], + [3, "(function ashelin-oasis symbol)"] + ], + "comb-obs": [ + [16, "(function collide-shape-prim none)"], + [33, "(function collide-shape-prim none)"], + [49, "(function collide-shape-prim none)"] + ], + "comb-sentry": [[19, "(function collide-shape-prim none)"]], + "comb-field": [[5, "(function symbol)"]], + "comb-scenes": [ + [0, "(function none :behavior scene-player)"], + [1, "(function none :behavior scene-player)"], + [2, "(function none :behavior scene-player)"], + [3, "(function none :behavior scene-player)"], + [4, "(function none :behavior scene-player)"], + [5, "(function none :behavior scene-player)"], + [6, "(function none :behavior scene-player)"], + [7, "(function none :behavior scene-player)"], + [8, "(function none :behavior scene-player)"] + ], + "railx-scenes": [ + [0, "(function none :behavior scene-player)"], + [1, "(function none :behavior scene-player)"], + [2, "(function none :behavior scene-player)"], + [3, "(function none :behavior scene-player)"], + [4, "(function none :behavior scene-player)"], + [5, "(function none :behavior scene-player)"], + [6, "(function none :behavior scene-player)"], + [7, "(function none :behavior scene-player)"], + [8, "(function none :behavior scene-player)"], + [9, "(function none :behavior scene-player)"], + [10, "(function none :behavior scene-player)"], + [11, "(function none :behavior scene-player)"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/art_info.jsonc b/decompiler/config/jak3/ntsc_v1/art_info.jsonc index 71f670a5d4..35b9be11c6 100644 --- a/decompiler/config/jak3/ntsc_v1/art_info.jsonc +++ b/decompiler/config/jak3/ntsc_v1/art_info.jsonc @@ -22,7 +22,10 @@ "was-pre-heart": "neo-satellite-heart-ag", "was-pre-beam": "neo-satellite-game-ring-ag", "was-pre-bubble": "neo-satellite-ps-symbols-ag", - "maker": "dm-robot-ag" + "maker": "dm-robot-ag", + "mh-wasp": "neo-wasp-ag", + "factory-boss": "errol-lowres-ag", + "fac-robotank-turret": "fac-robotank-ag" }, // remap names for types in an entire file (higher priority) diff --git a/decompiler/config/jak3/ntsc_v1/hacks.jsonc b/decompiler/config/jak3/ntsc_v1/hacks.jsonc index 7a63c11b4a..7f776aebff 100644 --- a/decompiler/config/jak3/ntsc_v1/hacks.jsonc +++ b/decompiler/config/jak3/ntsc_v1/hacks.jsonc @@ -441,7 +441,12 @@ "(method 37 task-manager-desert-glide)": [11, 12, 23, 29, 31], "(method 34 task-manager-desert-glide)": [3], "(anon-function 20 target-flut)": [0, 38, 39], - "(anon-function 14 flut-racer)": [7, 17, 19] + "(anon-function 14 flut-racer)": [7, 17, 19], + "(method 28 conveyor)": [22], + "generic-merc-execute-all": [7, 15], + "check-enemy": [0, 1], + "(method 91 h-warf)": [0], + "(method 51 h-warf)": [5] }, // Sometimes the game might use format strings that are fetched dynamically, @@ -515,7 +520,27 @@ [184, 0], [276, 0] ], - "(method 32 task-manager-throne-gun-training)": [[53, 0]] + "(method 32 task-manager-throne-gun-training)": [[53, 0]], + "(method 17 hud-spider-killed)": [[71, 0]], + "(trans idle des-burning-bush)": [ + [226, 1], + [257, 0] + ], + "(method 37 des-burning-bush)": [ + [278, 0], + [336, 0] + ], + "(method 38 des-burning-bush)": [ + [109, 0], + [153, 0], + [196, 0] + ], + "(method 15 freeze-time-hud)": [[108, 0]], + "(method 17 freeze-time-hud)": [[97, 0]], + "(method 15 hud-wasbbv-score)": [[61, 0]], + "(method 15 hud-wasbbv-goal)": [[64, 0]], + "(method 32 task-manager-dark-punch-training)": [[53, 0]], + "(method 32 task-manager-lightjak-training-shield)": [[53, 0]] }, "mips2c_functions_by_name": [ diff --git a/decompiler/config/jak3/ntsc_v1/inputs.jsonc b/decompiler/config/jak3/ntsc_v1/inputs.jsonc index 360e027ec3..7f872f5267 100644 --- a/decompiler/config/jak3/ntsc_v1/inputs.jsonc +++ b/decompiler/config/jak3/ntsc_v1/inputs.jsonc @@ -53,7 +53,7 @@ "DGO/DESINTER.DGO", // "DGO/DESJUMP.DGO", "DGO/DESLIZ.DGO", - // "DGO/DESOASIS.DGO", + "DGO/DESOASIS.DGO", "DGO/DESRACE1.DGO", "DGO/DESRACE2.DGO", "DGO/DESRALLY.DGO", @@ -63,7 +63,7 @@ "DGO/DESTRACK.DGO", "DGO/DESW.DGO", "DGO/DST.DGO", - // "DGO/OASISCST.DGO", + "DGO/OASISCST.DGO", // "DGO/WARPCAST.DGO", // air train // nest "DGO/NSA.DGO", @@ -145,11 +145,11 @@ "DGO/FRSTA.DGO", "DGO/FRSTB.DGO", "DGO/FRSTX.DGO", - // // factory - // "DGO/FACTORYA.DGO", - // "DGO/FACB.DGO", - // "DGO/FACC.DGO", - // "DGO/FACD.DGO", + // factory + "DGO/FACTORYA.DGO", + "DGO/FACB.DGO", + "DGO/FACC.DGO", + "DGO/FACD.DGO", // tower "DGO/TOWB.DGO", "DGO/TOWERA.DGO", @@ -165,15 +165,15 @@ // "DGO/RUBB.DGO", // "DGO/RUBC.DGO", // "DGO/RBCT.DGO", - // // comb - // "DGO/COMBA.DGO", + // comb + "DGO/COMBA.DGO", // "DGO/COMBB.DGO", // "DGO/COMBC.DGO", // "DGO/COMBD.DGO", // "DGO/COMBE.DGO", // "DGO/COMBN.DGO", - // "DGO/COMBX.DGO", - // "DGO/RAILA.DGO", + "DGO/COMBX.DGO", + "DGO/RAILA.DGO", // "DGO/RAILB.DGO", // "DGO/RAILB2.DGO", // "DGO/RAILC.DGO", @@ -181,7 +181,7 @@ // "DGO/RAILD.DGO", // "DGO/RAILE.DGO", // "DGO/RAILF.DGO", - // "DGO/RAILX.DGO", + "DGO/RAILX.DGO", // // precursor // "DGO/PRECA.DGO", // "DGO/PRECB.DGO", @@ -206,24 +206,24 @@ // "DGO/MUSEUM4B.DGO", // test "DGO/HALFPIPE.DGO", - // // borrow + // borrow // "DGO/LASHELIN.DGO", - // "DGO/LBBRING1.DGO", - // "DGO/LBBRING2.DGO", - // "DGO/LBBRING3.DGO", - // "DGO/LBBRING4.DGO", - // "DGO/LBBRING5.DGO", - // "DGO/LBBRING6.DGO", - // "DGO/LBBSDRP1.DGO", - // "DGO/LBBSDRP2.DGO", - // "DGO/LBBSDRP3.DGO", - // "DGO/LBBSPID.DGO", - // "DGO/LBBSPIRT.DGO", - // "DGO/LBBSPRT2.DGO", - // "DGO/LBBSPRT3.DGO", - // "DGO/LBBTCHA1.DGO", - // "DGO/LBBTCHA2.DGO", - // "DGO/LBBTCHA3.DGO", + "DGO/LBBRING1.DGO", + "DGO/LBBRING2.DGO", + "DGO/LBBRING3.DGO", + "DGO/LBBRING4.DGO", + "DGO/LBBRING5.DGO", + "DGO/LBBRING6.DGO", + "DGO/LBBSDRP1.DGO", + "DGO/LBBSDRP2.DGO", + "DGO/LBBSDRP3.DGO", + "DGO/LBBSPID.DGO", + "DGO/LBBSPIRT.DGO", + "DGO/LBBSPRT2.DGO", + "DGO/LBBSPRT3.DGO", + "DGO/LBBTCHA1.DGO", + "DGO/LBBTCHA2.DGO", + "DGO/LBBTCHA3.DGO", // "DGO/LBIPED.DGO", // "DGO/LBLOWCST.DGO", // "DGO/LBLOWTKG.DGO", @@ -232,7 +232,7 @@ // "DGO/LCITYSML.DGO", // "DGO/LCTYASS.DGO", // "DGO/LCTYBLOW.DGO", - // "DGO/LCTYDEST.DGO", + "DGO/LCTYDEST.DGO", // "DGO/LCTYHIJK.DGO", // "DGO/LCTYPALT.DGO", // "DGO/LCTYPATK.DGO", @@ -246,13 +246,13 @@ // "DGO/LDESGCST.DGO", // "DGO/LDMPCKGN.DGO", // "DGO/LERROL.DGO", - // "DGO/LFACB.DGO", + "DGO/LFACB.DGO", "DGO/LFACCAR.DGO", "DGO/LFACCITY.DGO", "DGO/LFACO.DGO", - // "DGO/LFACRM1.DGO", - // "DGO/LFACRM2.DGO", - // "DGO/LFACTORY.DGO", + "DGO/LFACRM1.DGO", + "DGO/LFACRM2.DGO", + "DGO/LFACTORY.DGO", "DGO/LFORM.DGO", "DGO/LFORP.DGO", // "DGO/LFORRING.DGO", @@ -276,10 +276,10 @@ "DGO/LMECH.DGO", // "DGO/LMHCA.DGO", // "DGO/LMHCB.DGO", - // "DGO/LNSTCST.DGO", - // "DGO/LNSTOA.DGO", - // "DGO/LNSTOBB.DGO", - // "DGO/LNSTOBC.DGO", + "DGO/LNSTCST.DGO", + "DGO/LNSTOA.DGO", + "DGO/LNSTOBB.DGO", + "DGO/LNSTOBC.DGO", // "DGO/LONINSIM.DGO", // "DGO/LOUTRO.DGO", // "DGO/LOUTRO2.DGO", @@ -300,12 +300,12 @@ // "DGO/LTORN.DGO", // "DGO/LTORNJNX.DGO", // "DGO/LTORNSAM.DGO", - // "DGO/LTOWA.DGO", - // "DGO/LTOWB.DGO", + "DGO/LTOWA.DGO", + "DGO/LTOWB.DGO", // "DGO/LTOWCITY.DGO", // "DGO/LTRTWHLS.DGO", // "DGO/LVINCST.DGO", - // "DGO/LWASBBV.DGO", + "DGO/LWASBBV.DGO", "DGO/LWASSIG.DGO", // "DGO/LWLANDM.DGO", "DGO/LWSTDPCK.DGO" diff --git a/decompiler/config/jak3/ntsc_v1/label_types.jsonc b/decompiler/config/jak3/ntsc_v1/label_types.jsonc index 75908da03d..e5f34070f0 100644 --- a/decompiler/config/jak3/ntsc_v1/label_types.jsonc +++ b/decompiler/config/jak3/ntsc_v1/label_types.jsonc @@ -1390,5 +1390,165 @@ ["L624", "uint64", true], ["L613", "uint64", true], ["L621", "uint64", true] + ], + "des-bush": [ + ["L873", "uint64", true], + ["L878", "uint64", true], + ["L872", "uint64", true], + ["L880", "uint64", true], + ["L879", "uint64", true], + ["L877", "uint64", true], + ["L875", "uint64", true], + ["L876", "uint64", true], + ["L874", "uint64", true], + ["L585", "uint64", true], + ["L587", "uint64", true], + ["L586", "uint64", true], + ["L588", "uint64", true], + ["L584", "uint64", true], + ["L591", "uint64", true], + ["L590", "uint64", true], + ["L592", "uint64", true], + ["L589", "uint64", true], + ["L583", "uint64", true] + ], + "des-burning-bush": [ + ["L182", "vector"], + ["L219", "vector"] + ], + "mh-wasp": [ + ["L128", "vector"], + ["L127", "vector"], + ["L126", "vector"] + ], + "mh-centipede": [ + ["L740", "uint64", true], + ["L741", "uint64", true], + ["L731", "uint64", true], + ["L732", "uint64", true], + ["L737", "uint64", true], + ["L733", "uint64", true], + ["L735", "uint64", true], + ["L734", "uint64", true], + ["L739", "uint64", true], + ["L736", "uint64", true], + ["L738", "uint64", true], + ["L571", "(inline-array talker-speech-class)", 36], + ["L615", "uint64", true], + ["L614", "uint64", true], + ["L613", "uint64", true], + ["L617", "uint64", true], + ["L616", "uint64", true], + ["L611", "uint64", true], + ["L618", "uint64", true], + ["L610", "uint64", true], + ["L482", "attack-info"], + ["L481", "attack-info"], + ["L612", "uint64", true] + ], + "mh-bat": [["L124", "(pointer int32)", 4]], + "factoryc-obs": [ + ["L202", "(inline-array vector)", 2], + ["L256", "attack-info"], + ["L252", "vector"], + ["L247", "attack-info"] + ], + "factoryc-obs2": [["L229", "attack-info"]], + "factory-boss-setup": [["L345", "(inline-array vector)", 2]], + "missile-bot": [ + ["L186", "attack-info"], + ["L205", "vector"], + ["L204", "vector"], + ["L203", "vector"], + ["L202", "vector"], + ["L201", "vector"] + ], + "factoryc-manager": [ + ["L46", "attack-info"], + ["L47", "vector"], + ["L50", "attack-info"], + ["L48", "attack-info"] + ], + "generic-merc": [["L175", "(inline-array invinitdata)", 8]], + "bot": [ + ["L391", "attack-info"], + ["L390", "attack-info"] + ], + "oasis-defense": [ + ["L196", "attack-info"], + ["L195", "vector"] + ], + "ash-oasis-course": [["L124", "uint64", true]], + "destroy-dark-eco": [["L197", "vector"]], + "comb-obs": [ + ["L136", "attack-info"], + ["L139", "vector"], + ["L138", "vector"] + ], + "comb-sentry": [ + ["L93", "vector"], + ["L91", "vector"], + ["L87", "(inline-array vector)", 1], + ["L88", "(inline-array vector)", 3] + ], + "comb-field": [["L43", "vector"]], + "h-sled": [ + ["L175", "vector"], + ["L174", "vector"], + ["L173", "vector"], + ["L172", "vector"], + ["L171", "vector"], + ["L170", "vector"], + ["L169", "vector"], + ["L167", "vector"], + ["L166", "vector"], + ["L177", "(inline-array vector)", 2], + ["L176", "(inline-array vector)", 2], + ["L162", "(inline-array vector)", 8] + ], + "comb-travel": [ + ["L122", "vector"], + ["L121", "vector"], + ["L129", "vector"], + ["L128", "vector"], + ["L127", "vector"], + ["L126", "vector"], + ["L125", "vector"], + ["L124", "vector"] + ], + "warf-projectile": [["L163", "attack-info"]], + "h-warf": [["L187", "attack-info"]], + "fac-gunturret": [ + ["L91", "fac-gun-tower-turret-params"], + ["L94", "attack-info"] + ], + "fac-robotank-turret": [ + ["L178", "uint64", true], + ["L177", "uint64", true], + ["L135", "uint64", true], + ["L138", "uint64", true], + ["L137", "uint64", true], + ["L136", "uint64", true], + ["L139", "uint64", true] + ], + "fac-tower": [["L137", "attack-info"]], + "fac-robotank": [ + ["L255", "uint64", true], + ["L256", "uint64", true], + ["L253", "uint64", true], + ["L257", "uint64", true], + ["L252", "uint64", true], + ["L254", "uint64", true], + ["L176", "uint64", true], + ["L175", "uint64", true] + ], + "factory-manager": [ + ["L306", "vector"], + ["L305", "vector"], + ["L304", "vector"], + ["L303", "vector"], + ["L302", "vector"], + ["L345", "vector"], + ["L346", "vector"] ] } diff --git a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc index 90efb50fcf..b122996163 100644 --- a/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc +++ b/decompiler/config/jak3/ntsc_v1/stack_structures.jsonc @@ -968,11 +968,11 @@ ], "(method 162 sew-laser-turret)": [ [32, ["array", "collide-shape", 384]], - [16, "bounding-box"] + [16, "vector"] ], "(trans alert sew-laser-turret)": [ [32, ["array", "collide-shape", 384]], - [16, "bounding-box"] + [16, "vector"] ], "(method 161 sew-laser-turret)": [[64, "rgbaf"]], "(method 159 sew-laser-turret)": [[32, "vector"]], @@ -1734,5 +1734,209 @@ [336, "vector"] ], "(method 41 maker)": [[560, "vector"]], - "maker-init-by-other": [[32, "light-trail-tracker-spawn-params"]] + "maker-init-by-other": [[32, "light-trail-tracker-spawn-params"]], + "(trans active task-manager-bbush-spirit-chase)": [ + [80, "vector"], + [96, "vector"], + [128, "vector"] + ], + "(trans idle desert-chase-ring)": [[16, "vector"]], + "(trans active task-manager-bbush-spirit-drop)": [ + [80, "vector"], + [96, "vector"], + [128, "vector"] + ], + "(code active task-manager-desert-bbush-get-to)": [ + [160, "vector"], + [176, "matrix"] + ], + "(trans menu des-burning-bush)": [ + [16, "vector"], + [32, "vector"] + ], + "(trans talking des-burning-bush)": [[16, "des-burning-bush-stack-var0"]], + "(method 37 des-burning-bush)": [[16, "bbush-menu-state"]], + "(method 38 des-burning-bush)": [[112, "des-burning-bush-stack-var1"]], + "trail-effect-init-by-other": [[16, "light-trail-tracker-spawn-params"]], + "(trans active task-manager-bbush-timer-chase)": [[80, "vector"]], + "(event attack mh-wasp)": [[16, "projectile-init-by-other-params"]], + "(anon-function 9 mh-wasp)": [[112, "vector"]], + "check-mh-centipede-explosion-level": [[16, "vector"]], + "spt-func-ground-dirt-bounce2": [[16, "vector"]], + "spt-func-ground-dirt-bounce1": [[16, "vector"]], + "(method 42 mh-centipede)": [ + [144, "vector"], + [160, "vector"], + [176, "vector"], + [16, "projectile-init-by-other-params"] + ], + "(method 38 mh-centipede)": [[16, "matrix"]], + "(method 39 mh-centipede)": [[16, "matrix"]], + "(method 40 mh-centipede)": [ + [16, "matrix"], + [816, "vector"], + [832, "vector"] + ], + "(trans die mh-centipede)": [[96, "vector"]], + "(method 10 mh-centipede-crater-pt-array)": [ + [592, ["inline-array", "vector", 4]], + [1216, "bounding-box"] + ], + "(method 161 mh-bat)": [ + [16, "vector"], + [32, "vector"] + ], + "mh-bat-fly-post": [ + [16, "vector"], + [32, "vector"] + ], + "(post idle fac-fire-torch)": [[16, "matrix"]], + "fac-robopod-add-hoverbot": [[32, "enemy-init-by-other-params"]], + "(enter impact factory-boss-shockwave-bomb)": [[176, "vector"]], + "(method 9 factory-boss-lightning-gate)": [ + [16, "vector"], + [32, "vector"] + ], + "(method 59 missile-bot)": [[80, "vector"]], + "factory-boss-launch-critter": [ + [32, "enemy-init-by-other-params"], + [160, "matrix"] + ], + "factory-boss-launch-critter-handler": [ + [96, "vector"], + [112, "vector"], + [128, "matrix"] + ], + "factory-boss-always": [ + [224, "vector"], + [16, "vector"], + [240, "vector"], + [80, "matrix"] + ], + "(method 201 bot)": [[16, "enemy-best-focus"]], + "(method 202 bot)": [[16, "connection-pers"]], + "(method 25 ashelin-shot)": [[32, "vector"]], + "(method 248 ashelin)": [ + [16, "nav-avoid-spheres-params"], + [112, "clamp-travel-vector-to-mesh-return-info"] + ], + "(code active task-manager-desert-oasis-defense)": [ + [112, "mystery-traffic-object-spawn-params0"] + ], + "(method 32 task-manager-desert-oasis-defense)": [ + [16, "mystery-traffic-object-spawn-params0"] + ], + "(method 33 task-manager-desert-oasis-defense)": [ + [16, "marauder-init-by-other-params"] + ], + "(method 26 task-manager-desert-oasis-defense)": [ + [96, "wvehicle-ai-drop-off-params"] + ], + "(trans active dark-eco-orb)": [ + [16, "vector"], + [32, "vector"], + [48, "vector"], + [64, "vector"], + [80, "collide-query"], + [624, "vector"], + [640, "vector"], + [656, "vector"], + [672, "vector"] + ], + "(method 26 task-manager-destroy-darkeco)": [[16, ["array", "symbol", 10]]], + "(trans idle grind-electricity)": [ + [16, "vector"], + [32, "vector"] + ], + "dark-eco-tower-init-by-other": [ + [16, "vector"], + [16, "vector"], + [32, "vector"], + [48, "puffer-init-by-other-params"] + ], + "spawn-shock-effect": [ + [80, "collide-query"], + [16, "matrix"], + [624, "vector"] + ], + "(method 34 comb-block)": [[16, "vector"]], + "(method 11 comb-pillar)": [[16, ["inline-array", "vector", 1]]], + "(method 25 comb-sentry-shot)": [[32, "vector"]], + "(method 32 comb-sentry)": [ + [16, "matrix"], + [80, ["inline-array", "vector", 5]] + ], + "(method 38 comb-sentry)": [[16, "comb-sentry-stack-var0"]], + "(method 39 comb-sentry)": [[16, "comb-sentry-stack-var1"]], + "sled-shot-reaction": [[16, ["inline-array", "vector", 1]]], + "(method 33 h-sled)": [[16, ["inline-array", "vector", 2]]], + "(method 90 h-sled)": [[16, "h-sled-physics-work"]], + "(method 93 h-sled)": [[16, "matrix"]], + "(method 38 h-sled)": [ + [16, "matrix"], + [64, ["inline-array", "vector", 2]] + ], + "(method 31 h-sled)": [ + [1056, "matrix"], + [1104, "matrix"], + [1168, "matrix"], + [16, "h-sled-physics-work"] + ], + "(method 97 h-sled)": [ + [16, "collide-query"], + [560, ["inline-array", "vector", 1]], + [624, "vector"] + ], + "(method 152 h-sled)": [[16, "comb-sentry-stack-var0"]], + "(method 25 sled-shot)": [[32, "vector"]], + "sled-find-mesh-dir": [[16, "h-sled-stack-var0"]], + "(method 78 h-sled)": [[16, "h-sled-stack-var1"]], + "(method 25 ffight-shot)": [[32, "vector"]], + "(enter impact ftank-shot)": [[16, "traffic-danger-info"]], + "(method 25 ftank-shot)": [[32, "vector"]], + "(method 25 fturret-shot)": [[32, "vector"]], + "(method 25 gun-warf-shot)": [[32, "vector"]], + "(enter impact warf-projectile)": [[16, "warf-explosion-sphere-init-params"]], + "(method 43 warf-projectile)": [[16, ["array", "collide-shape", 384]]], + "(method 91 h-warf)": [ + [112, "projectile-init-by-other-params"], + [80, "vector"], + [96, "vector"], + [864, "vector"] + ], + "(method 31 h-warf)": [[48, "vehicle-physics-work"]], + "(method 51 h-warf)": [[16, "rigid-body-impact"]], + "(method 54 h-warf)": [[16, "vehicle-physics-work"]], + "(method 78 h-warf)": [[16, "h-warf-stack-var0"]], + "(method 164 h-warf)": [[16, "vector"]], + "(code hostile fac-gunturret)": [[16, "vector"]], + "fac-robotank-turret-init-by-other": [[16, "vector"]], + "(method 31 fac-robotank-turret)": [[16, "collide-query"]], + "(method 33 fac-robotank-turret)": [ + [16, ["inline-array", "vector", 2]], + [48, ["inline-array", "vector", 2]] + ], + "robotank-turret-handler": [ + [16, "vector"], + [32, "quaternion"] + ], + "draw-2d-hud": [ + [16, ["inline-array", "vector4w", 4]], + [80, "vector4w"] + ], + "(method 36 fac-gun-tower)": [ + [16, "vector"], + [32, ["array", "collide-shape", 384]] + ], + "(method 35 fac-gun-tower)": [[32, "vector"]], + "fac-robotank-init-by-other": [[32, "vector"]], + "(trans flying factory-fighter)": [[16, "vector"]], + "(method 16 factory-manager)": [ + [48, "vector"], + [64, "vector"], + [80, "vector"], + [128, "vector"] + ], + "factory-fighter-init-by-other": [[16, "light-trail-tracker-spawn-params"]], + "(code explode factory-fighter)": [[112, "vector"]] } diff --git a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc index d89669e171..d1d03c52d6 100644 --- a/decompiler/config/jak3/ntsc_v1/type_casts.jsonc +++ b/decompiler/config/jak3/ntsc_v1/type_casts.jsonc @@ -8695,5 +8695,575 @@ [332, "gp", "attack-info"], [379, "gp", "attack-info"] ], - "maker-init-by-other": [[237, "v1", "vector"]] + "maker-init-by-other": [[237, "v1", "vector"]], + "(code resolution task-manager-bbush-spirit-drop)": [[40, "gp", "handle"]], + "(event dormant score-drop)": [[5, "a0", "vector"]], + "(code resolution task-manager-desert-bbush-ring)": [[40, "gp", "handle"]], + "(trans idle desert-chase-ring)": [[20, "a2", "vehicle"]], + "(event dormant spirit)": [[6, "v1", "vector"]], + "(event idle spirit)": [[6, "v1", "vector"]], + "(code resolution task-manager-bbush-egg-spider)": [[40, "gp", "handle"]], + "(trans active task-manager-bbush-egg-spider)": [[18, "v1", "int"]], + "(code resolution task-manager-bbush-spirit-chase)": [[40, "gp", "handle"]], + "(method 36 task-manager-bbush-spirit-drop)": [[23, "s4", "spirit"]], + "(method 21 task-manager-bbush-spirit-drop)": [["_stack_", 16, "res-tag"]], + "(trans idle des-burning-bush)": [ + [179, "v1", "vehicle"], + [151, "a1", "int"] + ], + "(method 35 des-burning-bush)": [[48, "v1", "float"]], + "(code menu des-burning-bush)": [[[29, 54], "v1", "game-task-event"]], + "(event dormant trail-effect)": [[6, "v1", "vector"]], + "(event idle trail-effect)": [[6, "v1", "vector"]], + "(code resolution task-manager-bbush-timer-chase)": [[40, "gp", "handle"]], + "(event active task-manager-bbush-timer-chase)": [ + [4, "v1", "float"], + [[30, 33], "a0", "freeze-time-hud"], + [[43, 46], "a0", "freeze-time-hud"], + [[56, 59], "a0", "freeze-time-hud"], + [[69, 72], "a0", "freeze-time-hud"], + [[85, 88], "a0", "freeze-time-hud"], + [[98, 101], "a0", "freeze-time-hud"], + [[111, 114], "a0", "freeze-time-hud"], + [[124, 127], "a0", "freeze-time-hud"], + [[140, 143], "a0", "freeze-time-hud"], + [[166, 169], "a0", "freeze-time-hud"], + [[179, 182], "a0", "freeze-time-hud"], + [[153, 156], "a0", "freeze-time-hud"] + ], + "(trans active task-manager-bbush-timer-chase)": [ + [[25, 28], "a0", "freeze-time-hud"], + [[38, 41], "a0", "freeze-time-hud"], + [[51, 54], "a0", "freeze-time-hud"], + [[64, 67], "a0", "freeze-time-hud"] + ], + "(method 26 task-manager-bbush-roll-count)": [[17, "v1", "vehicle"]], + "(method 26 task-manager-vehicle-bbush)": [ + [37, "v1", "process-focusable"], + [[83, 134], "v1", "vehicle"] + ], + "(method 21 task-manager-bbush-timer-chase)": [["_stack_", 96, "res-tag"]], + "(method 21 task-manager-bbush-egg-spider)": [["_stack_", 16, "res-tag"]], + "(method 21 task-manager-bbush-spirit-chase)": [["_stack_", 16, "res-tag"]], + "(method 21 task-manager-desert-bbush-ring)": [["_stack_", 16, "res-tag"]], + "(code attack needle-fish)": [ + [14, "v1", "art-joint-anim"], + [66, "v1", "art-joint-anim"] + ], + "(code stare needle-fish)": [[14, "v1", "art-joint-anim"]], + "needle-fish-joint-mod-tail": [[[8, 42], "s4", "needle-fish"]], + "(method 28 needle-fish-shot)": [ + [10, "v0", "sound-rpc-set-param"], + [29, "s5", "process-drawable"], + [32, "s5", "process-drawable"] + ], + "(enter explode needle-fish)": [[95, "a0", "process"]], + "(method 59 needle-fish)": [ + [30, "a0", "process-focusable"], + [33, "a0", "process-focusable"] + ], + "(method 56 mh-wasp)": [[21, "a1", "process-drawable"]], + "(post notice mh-wasp)": [[4, "t9", "(function none)"]], + "(trans hostile mh-wasp)": [[36, "v1", "art-joint-anim"]], + "(code attack mh-wasp)": [[38, "v1", "art-joint-anim"]], + "(code knocked-recover mh-wasp)": [[20, "v1", "art-joint-anim"]], + "(method 86 mh-wasp)": [[11, "v1", "art-joint-anim"]], + "(method 113 mh-wasp)": [[[11, 89], "s5", "process-focusable"]], + "(method 85 mh-wasp)": [[32, "a1", "art-joint-anim"]], + "(method 121 mh-wasp)": [ + [116, "v0", "(pointer float)"], + [181, "v0", "(pointer float)"], + ["_stack_", 16, "res-tag"], + ["_stack_", 32, "res-tag"], + ["_stack_", 48, "res-tag"], + ["_stack_", 64, "res-tag"] + ], + "(method 11 mh-centipede)": [ + [433, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "(method 26 task-manager-mh-centipede)": [[[113, 118], "a0", "vehicle"]], + "(method 30 task-manager-mh-centipede)": [[5, "a1", "vector"]], + "(method 26 task-manager-nstb-crystal)": [[[31, 36], "a0", "vehicle"]], + "(method 42 mh-centipede)": [ + [70, "v1", "float"], + [93, "v1", "float"] + ], + "(method 38 mh-centipede)": [[171, "v1", "float"]], + "(method 39 mh-centipede)": [ + [70, "v1", "float"], + [185, "v1", "float"], + [208, "v1", "float"] + ], + "(trans die mh-centipede)": [[16, "v0", "vehicle"]], + "mh-centipede-active-handler": [ + [[5, 119], "s4", "touching-shapes-entry"], + [91, "gp", "vehicle"], + [[208, 227], "v1", "attack-info"] + ], + "(enter impact mh-centipede-shot)": [[71, "a0", "process"]], + "(event hidden rod-spawner)": [ + [[13, 21], "a1", "vector"], + [[27, 35], "a0", "vector"] + ], + "(method 32 task-manager-mh-centipede)": [["_stack_", 16, "res-tag"]], + "(method 59 mh-bat)": [[[26, 43], "s5", "process-focusable"]], + "(method 126 mh-bat)": [[[20, 24], "v1", "ragdoll-proc"]], + "(method 50 mh-bat)": [ + [8, "v1", "collide-shape-prim-group"], + [18, "v1", "collide-shape-prim-group"] + ], + "(code knocked-recover mh-bat)": [ + [26, "v1", "art-joint-anim"], + [55, "v1", "ragdoll-proc"], + [108, "v1", "art-joint-anim"] + ], + "(code attack-1 mh-bat)": [ + [14, "v1", "art-joint-anim"], + [160, "v1", "art-joint-anim"] + ], + "mh-bat-fly-code": [[15, "v1", "art-joint-anim"]], + "set-factoryc-light!": [[[12, 14], "v1", "factoryc-states"]], + "(method 24 conveyor)": [ + ["_stack_", 16, "res-tag"], + [23, "v0", "(pointer float)"] + ], + "(method 21 conveyor)": [["_stack_", 32, "conveyor-section"]], + "(method 28 conveyor)": [ + [23, "a0", "connection"], + [24, "a0", "collide-shape"], + [71, "a0", "connection"], + [72, "a0", "collide-shape"] + ], + "fac-robopod-base-handler": [[6, "v1", "rigid-body-impact"]], + "(method 11 fac-zapper)": [ + [[183, 213], "s4", "(pointer generic-spot-shadow-effect)"] + ], + "(method 11 fac-fire-torch)": [[99, "v0", "particle-local-space-info"]], + "(code generate fac-robopod)": [ + [28, "v1", "art-joint-anim"], + [95, "v1", "art-joint-anim"] + ], + "(code die fac-punch-wall)": [ + [17, "v1", "collide-shape-prim-group"], + [89, "v1", "art-joint-anim"], + [112, "v0", "sound-rpc-set-param"] + ], + "(method 24 factory-conveyor)": [ + [40, "v0", "float"], + [39, "t0", "float"], + ["_stack_", 16, "res-tag"] + ], + "(enter perish-immediately)": [ + [13, "v1", "art-joint-anim"], + [29, "v1", "collide-shape-prim-group"] + ], + "(code plat-idle fac-move-plat-a)": [[6, "t9", "(function none)"]], + "(event idle fac-switch)": [[[5, 15], "gp", "attack-info"]], + "(event idle fac-break-floor)": [[4, "v1", "attack-info"]], + "(event idle fac-break-fence)": [[[7, 13], "gp", "rigid-body-impact"]], + "(code plat-idle fac-move-plat-b)": [[6, "t9", "(function none)"]], + "(event idle fac-rotfan)": [[87, "gp", "process-focusable"]], + "(enter out fac-rotfan)": [ + [2, "v1", "collide-shape-prim-group"], + [6, "v1", "collide-shape-prim-group"], + [10, "v1", "collide-shape-prim-group"] + ], + "(code spindown fac-rotfan)": [ + [201, "v1", "collide-shape-prim-group"], + [205, "v1", "collide-shape-prim-group"], + [209, "v1", "collide-shape-prim-group"], + [147, "v0", "sound-rpc-set-param"] + ], + "(method 22 fac-switch)": [[16, "v0", "string"]], + "(anon-function 1 mh-bat)": [[1, "v1", "float"]], + "(code flickering factory-elec-gate)": [[83, "s5", "int"]], + "(anon-function 0 factory-scenes)": [[13, "t9", "(function level none)"]], + "(anon-function 1 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 2 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 3 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 4 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 5 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 7 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 8 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 9 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 6 factory-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "update-mood-lfacrm1": [[[24, 105], "gp", "lfacrm1-states"]], + "update-lfacrm1-lights": [[81, "v1", "lfacrm1-states"]], + "(code dormant fac-elevator-a)": [[19, "v1", "art-joint-anim"]], + "(code waiting fac-elevator-a)": [[44, "v1", "art-joint-anim"]], + "(code running fac-elevator-a)": [ + [23, "v1", "art-joint-anim"], + [71, "t9", "(function none)"] + ], + "(trans running fac-elevator-a)": [[4, "v0", "sound-rpc-set-param"]], + "set-lfacrm1-door!": [[[26, 32], "v1", "lfacrm1-states"]], + "(method 11 fac-switch)": [["_stack_", 16, "res-tag"]], + "(method 11 factory-elec-gate)": [ + ["_stack_", 16, "res-tag"], + [88, "v0", "(pointer actor-group)"] + ], + "(enter impact factory-boss-shot)": [[60, "a0", "process"]], + "(event idle fac-drop-plat)": [ + [10, "s5", "factory-boss-floorbuster-bomb"], + [18, "s5", "floorbuster-bomb-explosion"] + ], + "(method 11 fac-drop-plat)": [ + [100, "v0", "(pointer actor-group)"], + ["_stack_", 16, "res-tag"] + ], + "fac-drop-plat-rot-once": [ + ["_stack_", 48, "float"], + ["_stack_", 64, "float"] + ], + "(enter impact factory-boss-floorbuster-bomb)": [ + [60, "a0", "process"], + [84, "v1", "floorbuster-bomb-explosion"] + ], + "(enter impact factory-boss-shockwave-bomb)": [ + [59, "a0", "process"], + [213, "s4", "(pointer manipy)"], + [332, "s4", "(pointer manipy)"] + ], + "(method 9 factory-boss-lightning-gate)": [[173, "a3", "float"]], + "update-mood-factory": [[[30, 102], "gp", "factory-states"]], + "set-factoryd-light!": [[10, "v1", "factoryd-states"]], + "(code notice missile-bot)": [[10, "v1", "art-joint-anim"]], + "(trans knocked missile-bot)": [[44, "v1", "float"]], + "(post knocked missile-bot)": [[12, "t9", "(function none)"]], + "(trans fizzle missile-bot)": [ + [53, "v1", "float"], + [92, "v1", "float"] + ], + "factory-boss-launch-critter-pick-anim": [[10, "v1", "float"]], + "(method 50 missile-bot)": [ + [2, "v1", "collide-shape-prim-group"], + [6, "a0", "collide-shape-prim-group"] + ], + "(enter knocked missile-bot)": [[9, "v1", "float"]], + "(anon-function 1 factory-boss-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "(anon-function 2 factory-boss-scenes)": [ + [13, "t9", "(function mood-context none)"] + ], + "factory-boss-check-launch-script": [[100, "v1", "float"]], + "(enter beaten factory-boss)": [[44, "gp", "(pointer process)"]], + "factory-boss-handler": [[[12, 15], "v1", "nav-enemy"]], + "factory-boss-drop-bomb": [[75, "v1", "factory-boss-floorbuster-bomb"]], + "(method 11 factory-boss)": [["_stack_", 16, "res-tag"]], + "(method 26 factory-boss)": [[16, "v1", "float"]], + "factory-boss-always": [ + [632, "s4", "process-drawable"], + [663, "s4", "process-drawable"], + [741, "s4", "process-drawable"], + [268, "v1", "float"], + [308, "v1", "float"], + [362, "v1", "float"], + [406, "v1", "float"], + [456, "v1", "float"], + [496, "v1", "float"], + [693, "v1", "float"], + ["_stack_", 272, "float"], + ["_stack_", 288, "float"], + ["_stack_", 320, "float"], + ["_stack_", 336, "float"], + ["_stack_", 352, "float"], + ["_stack_", 368, "float"], + ["_stack_", 384, "float"], + ["_stack_", 400, "float"] + ], + "(method 26 task-manager-factory-assault)": [ + [[21, 34], "s5", "process-focusable"], + [114, "v0", "vehicle"] + ], + "generic-merc-execute-all": [ + [145, "v1", "generic-work"], + [147, "v1", "generic-work"], + [149, "v1", "generic-work"], + [78, "v1", "generic-work"], + [80, "v1", "generic-work"], + [82, "v1", "generic-work"], + [97, "a0", "generic-work"] + ], + "(event idle simple-focus)": [[6, "v1", "vector"]], + "(code die-falling bot)": [[32, "gp", "art-joint-anim"]], + "(code failed bot)": [ + [23, "gp", "art-joint-anim"], + [70, "v0", "string"] + ], + "(code hit bot)": [[30, "v1", "art-joint-anim"]], + "(method 201 bot)": [ + [41, "a0", "connection"], + [42, "a0", "collide-shape"], + [90, "a0", "connection"], + [91, "a0", "collide-shape"], + [153, "a1", "process-focusable"] + ], + "(method 140 bot)": [ + [70, "s5", "process-focusable"], + [[34, 74], "s5", "process-focusable"] + ], + "(method 82 bot)": [ + [105, "a0", "bot"], + [107, "v1", "process"], + [222, "a0", "vector"] + ], + "(method 236 bot)": [ + [28, "t9", "(function bot int)"], + [46, "t9", "(function bot int)"] + ], + "(method 84 bot)": [[45, "v1", "process-focusable"]], + "(method 235 bot)": [[[15, 39], "s3", "process-focusable"]], + "(method 202 bot)": [ + [10, "v1", "sphere"], + [40, "a0", "connection"], + [41, "a0", "collide-shape"], + [49, "a3", "sphere"], + [58, "f2", "float"], + [89, "a0", "connection"], + [90, "a0", "collide-shape"], + [98, "a3", "sphere"], + [107, "f2", "float"] + ], + "(code standing-turn ashelin)": [[47, "s4", "art-joint-anim"]], + "(code tumble-right ashelin)": [ + [35, "v1", "art-joint-anim"], + [168, "v1", "art-joint-anim"], + [280, "v1", "art-joint-anim"] + ], + "(code cartwheel-left ashelin)": [ + [35, "v1", "art-joint-anim"], + [168, "v1", "art-joint-anim"], + [280, "v1", "art-joint-anim"] + ], + "(code back-spring ashelin)": [ + [30, "v1", "art-joint-anim"], + [309, "v1", "art-joint-anim"], + [171, "v1", "art-joint-anim"] + ], + "(post chase ashelin)": [ + [14, "a0", "process-focusable"], + [17, "a0", "process-focusable"] + ], + "(code standing-blast ashelin)": [[68, "v1", "art-joint-anim"]], + "(code standing-idle ashelin)": [ + [189, "v1", "art-joint-anim"], + [126, "v1", "art-joint-anim"] + ], + "(code waiting-idle ashelin)": [ + [204, "v1", "art-joint-anim"], + [95, "v1", "art-joint-anim"] + ], + "(code die-falling ashelin)": [[85, "gp", "art-joint-anim"]], + "(method 55 ashelin)": [ + [[19, 23], "a0", "process-focusable"], + [25, "a0", "process-focusable"] + ], + "(method 85 ashelin)": [[129, "s5", "art-joint-anim"]], + "(method 86 ashelin)": [ + [22, "s5", "art-joint-anim"], + [77, "v1", "art-joint-anim"], + [111, "v1", "art-joint-anim"], + [165, "v1", "art-joint-anim"], + [199, "v1", "art-joint-anim"] + ], + "(method 87 ashelin)": [[67, "v1", "art-joint-anim"]], + "(code active task-manager-desert-oasis-defense)": [ + [363, "a0", "collide-shape-moving"], + [426, "v1", "float"], + [366, "a0", "collide-shape-moving"], + [685, "v1", "float"] + ], + "(method 32 task-manager-desert-oasis-defense)": [ + [98, "a0", "collide-shape-moving"], + [116, "v1", "float"], + [130, "v1", "float"], + [101, "a0", "collide-shape-moving"] + ], + "(method 33 task-manager-desert-oasis-defense)": [ + [[107, 168], "s1", "marauder"] + ], + "(method 26 task-manager-desert-oasis-defense)": [ + [298, "s4", "process-drawable"], + [308, "s4", "process-drawable"], + [331, "s4", "process-drawable"], + [55, "s3", "process-drawable"], + [106, "v1", "float"], + [146, "v1", "float"], + [163, "v1", "float"] + ], + "(method 82 ashelin-oasis)": [[11, "v1", "rigid-body-impact"]], + "(method 263 ashelin-oasis)": [ + [85, "gp", "process-drawable"], + [88, "gp", "process-drawable"], + [67, "v0", "sound-rpc-set-param"] + ], + "(anon-function 1 ash-oasis-course)": [[82, "v1", "asht-wait-spot"]], + "(method 198 bot)": [ + [18, "a0", "uint"], + [8, "v1", "uint"] + ], + "(code active dark-eco-orb)": [ + [33, "v1", "art-joint-anim"], + [17, "v1", "float"] + ], + "dark-eco-tower-init-by-other": [[93, "v1", "vector"]], + "(code hit dark-eco-orb)": [[14, "v1", "art-joint-anim"]], + "(trans idle grind-electricity)": [ + ["_stack_", 48, "(pointer lightning-tracker)"] + ], + "dark-eco-orb-init-by-other": [[100, "v1", "vector"]], + "dark-eco-orb-event-handler": [[[29, 71], "gp", "attack-info"]], + "spawn-shock-effect": [["_stack_", 640, "(pointer lightning-tracker)"]], + "(method 21 task-manager-destroy-darkeco)": [["_stack_", 16, "res-tag"]], + "(code explode comb-block)": [[50, "a0", "process"]], + "(method 29 comb-energy-ring)": [ + [52, "v1", "collide-shape-prim-group"], + [54, "v1", "collide-shape-prim-group"] + ], + "(method 30 comb-energy-ring)": [ + [10, "s5", "collide-shape-prim-group"], + [16, "s5", "collide-shape-prim-group"] + ], + "(event idle comb-block)": [ + [20, "s4", "attack-info"], + [22, "s4", "attack-info"] + ], + "(event idle comb-pillar)": [[[20, 30], "s4", "attack-info"]], + "(event path-follow comb-sentry)": [[[13, 30], "s4", "attack-info"]], + "(method 33 comb-sentry)": [[10, "v1", "collide-shape-prim-group"]], + "(method 32 comb-sentry)": [[[28, 75], "s5", "process-focusable"]], + "(event idle-close comb-field)": [ + [[22, 27], "v1", "attack-info"], + [55, "s4", "process-drawable"], + [132, "v1", "process-drawable"], + [148, "v1", "process-drawable"], + [155, "v1", "process-drawable"], + [158, "a0", "process-drawable"], + [172, "v1", "process-drawable"], + [179, "v1", "process-drawable"], + [182, "a0", "process-drawable"], + [195, "v1", "process-drawable"], + [198, "a0", "process-drawable"], + [267, "v1", "process-drawable"], + [275, "gp", "collide-shape"], + [284, "gp", "collide-shape"], + [[203, 207], "a2", "float"] + ], + "(method 62 h-sled)": [[[4, 41], "s5", "collide-shape-prim-group"]], + "(method 33 h-sled)": [[1, "a1", "rigid-body-vehicle-constants"]], + "(method 49 h-sled)": [ + [72, "v1", "vector"], + [64, "v1", "float"], + [41, "v1", "float"] + ], + "(enter explode h-sled)": [ + [107, "a0", "process"], + [202, "v1", "joint-exploder"] + ], + "(method 97 h-sled)": [[2, "a2", "h-sled-physics-work"]], + "(method 26 task-manager-tube-ride)": [[[21, 51], "s5", "process-focusable"]], + "(code complete task-manager-tube-ride)": [[23, "t9", "(function none)"]], + "(code active task-manager-tube-ride)": [ + [[244, 259], "gp", "process-focusable"], + [418, "v1", "process-focusable"], + [494, "v1", "process-focusable"], + [[569, 584], "gp", "process-focusable"], + [611, "t9", "(function none)"] + ], + "(code complete task-manager-comb-travel)": [[51, "t9", "(function none)"]], + "(method 15 hud-factory-damage)": [[26, "v1", "float"]], + "(method 43 warf-projectile)": [[35, "a1", "process-focusable"]], + "(method 91 h-warf)": [ + [126, "v0", "vehicle"], + [354, "v0", "vehicle"] + ], + "(method 54 h-warf)": [[[15, 21], "a0", "process-focusable"]], + "(method 97 h-warf)": [[159, "a0", "vector"]], + "(method 156 fac-gunturret)": [[[11, 19], "a0", "process-focusable"]], + "(method 155 fac-gunturret)": [[[15, 23], "a0", "process-focusable"]], + "(code fire fac-robotank-turret)": [ + [65, "v1", "art-joint-anim"], + [122, "v1", "art-joint-anim"] + ], + "(code ready fac-robotank-turret)": [[10, "v1", "art-joint-anim"]], + "(method 31 fac-robotank-turret)": [[76, "s3", "collide-shape-prim"]], + "fac-robotank-reticle-handler": [ + [6, "v1", "vector"], + [[11, 34], "s5", "vector"], + [[12, 34], "gp", "vector"], + [56, "v1", "float"] + ], + "robotank-turret-handler": [ + [52, "v1", "collide-shape-prim-group"], + [66, "v1", "collide-shape-prim-group"], + [[96, 106], "s4", "cspace"], + [18, "v1", "float"] + ], + "(enter die fac-gun-tower)": [[13, "v1", "art-joint-anim"]], + "(event idle fac-gun-tower)": [ + [19, "gp", "projectile"], + [24, "gp", "projectile"], + [35, "gp", "projectile"], + [83, "gp", "projectile"] + ], + "fac-gun-tower-standard-event-handler": [ + [[3, 11], "gp", "attack-info"], + [[4, 22], "a2", "touching-shapes-entry"] + ], + "(event idle fac-gun-tower-base)": [[[18, 86], "s4", "projectile"]], + "(code idle fac-gun-tower-base)": [[10, "v1", "art-joint-anim"]], + "(method 36 fac-gun-tower)": [[46, "s2", "process-focusable"]], + "(method 35 fac-gun-tower)": [[79, "v0", "vehicle"]], + "fac-robotank-init-by-other": [ + [182, "gp", "factory-manager"], + [208, "gp", "factory-manager"], + [224, "gp", "factory-manager"], + [293, "t1", "float"], + [[346, 518], "gp", "fac-robotank-tread-info"] + ], + "(method 7 fac-robotank)": [ + [21, "a1", "fac-robotank"], + [28, "a1", "fac-robotank"], + [35, "a2", "fac-robotank"] + ], + "(post moving fac-robotank)": [[[33, 87], "s5", "factory-manager"]], + "fac-robotank-handler": [[[98, 105], "v1", "attack-info"]], + "fac-robotank-post": [ + [[365, 368], "v1", "fac-robotank-turret"], + [394, "v1", "float"] + ], + "(code idle factory-fighter)": [[10, "v1", "art-joint-anim"]], + "fac-target-standard-event-handler": [[[48, 54], "v1", "attack-info"]], + "(enter idle fac-target)": [[63, "v1", "art-joint-anim"]], + "(enter retracted fac-target)": [[33, "v1", "art-joint-anim"]], + "(method 60 factory-fighter)": [[52, "v0", "vehicle"]], + "(code die factory-fighter)": [[11, "v1", "art-joint-anim"]], + "(method 32 task-manager-factory-sky-battle)": [["_stack_", 16, "res-tag"]], + "update-railx-lights": [[[33, 88], "s3", "railx-states"]], + "update-mood-railx": [[[64, 109], "gp", "railx-states"]], + "set-railx-light-brightness!": [ + [[30, 36], "v1", "railx-states"], + [[13, 19], "v1", "railx-states"] + ], + "(code idle rail-warp-gate)": [[10, "v1", "art-joint-anim"]] } diff --git a/decompiler/config/jak3/ntsc_v1/var_names.jsonc b/decompiler/config/jak3/ntsc_v1/var_names.jsonc index d967549873..6e620655ae 100644 --- a/decompiler/config/jak3/ntsc_v1/var_names.jsonc +++ b/decompiler/config/jak3/ntsc_v1/var_names.jsonc @@ -2056,5 +2056,23 @@ "vars": { "v0-1": ["hand", "handle"] } + }, + "(method 42 mh-centipede)": { + "vars": { + "s0-0": ["sname", "sound-name"] + } + }, + "check-enemy": { + "args": ["turret", "radius", "pfoc"] + }, + "(method 202 bot)": { + "vars": { + "s4-0": ["cspec", "collide-spec"] + } + }, + "(enter impact warf-projectile)": { + "vars": { + "s4-0": ["sname", "sound-name"] + } } } diff --git a/decompiler/util/DecompilerTypeSystem.cpp b/decompiler/util/DecompilerTypeSystem.cpp index 0b9a701199..d576201623 100644 --- a/decompiler/util/DecompilerTypeSystem.cpp +++ b/decompiler/util/DecompilerTypeSystem.cpp @@ -2,12 +2,12 @@ #include "TP_Type.h" +#include "common/goos/Printer.h" #include "common/goos/Reader.h" #include "common/log/log.h" #include "common/type_system/defenum.h" #include "common/type_system/deftype.h" #include "common/util/string_util.h" -#include #include "decompiler/Disasm/Register.h" diff --git a/decompiler/util/data_decompile.cpp b/decompiler/util/data_decompile.cpp index a44d719392..d02b2b4c41 100644 --- a/decompiler/util/data_decompile.cpp +++ b/decompiler/util/data_decompile.cpp @@ -1020,6 +1020,17 @@ const std::unordered_map< {"terraformer-graph", {{"node", ArrayFieldDecompMeta(TypeSpec("terraformer-node"), 32)}, {"edge", ArrayFieldDecompMeta(TypeSpec("terraformer-edge"), 16)}}}, + {"bombbot-path", {{"node", ArrayFieldDecompMeta(TypeSpec("bombbot-node"), 32)}}}, + {"ai-task-pool", + {{"tasks", ArrayFieldDecompMeta(TypeSpec("uint32"), + 4, + ArrayFieldDecompMeta::Kind::REF_TO_INTEGER_ARR)}}}, + {"bot-course", {{"spots", ArrayFieldDecompMeta(TypeSpec("bot-spot"), 32)}}}, + {"ashelin-course", + {{"spots", ArrayFieldDecompMeta(TypeSpec("bot-spot"), 32)}, + {"speeches", ArrayFieldDecompMeta(TypeSpec("bot-speech-info"), 16)}, + {"dirs", ArrayFieldDecompMeta(TypeSpec("vector"), 16)}, + {"speech-tunings", ArrayFieldDecompMeta(TypeSpec("bot-speech-tuning"), 16)}}}, }}}; goos::Object decompile_structure(const TypeSpec& type, diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt index acef47b4c9..9359212c43 100644 --- a/game/CMakeLists.txt +++ b/game/CMakeLists.txt @@ -213,6 +213,7 @@ set(RUNTIME_SOURCE mips2c/jak3_functions/ripple.cpp mips2c/jak3_functions/ocean.cpp mips2c/jak3_functions/ocean_vu0.cpp + mips2c/jak3_functions/generic_merc.cpp mips2c/mips2c_table.cpp overlord/common/dma.cpp overlord/common/fake_iso.cpp diff --git a/game/graphics/opengl_renderer/OpenGLRenderer.cpp b/game/graphics/opengl_renderer/OpenGLRenderer.cpp index 527500cfcd..d004c9d6e0 100644 --- a/game/graphics/opengl_renderer/OpenGLRenderer.cpp +++ b/game/graphics/opengl_renderer/OpenGLRenderer.cpp @@ -169,6 +169,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("merc-l{}-tfrag", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_TFRAG, BucketId::MERC_L1_TFRAG, i), m_merc2); + init_bucket_renderer( + fmt::format("gmerc-l{}-tfrag", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_TFRAG, BucketId::GMERC_L1_TFRAG, i), m_generic2, + Generic2::Mode::NORMAL); init_bucket_renderer( fmt::format("tex-l{}-shrub", i), BucketCategory::TEX, @@ -180,6 +184,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("merc-l{}-shrub", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_SHRUB, BucketId::MERC_L1_SHRUB, i), m_merc2); + init_bucket_renderer( + fmt::format("gmerc-l{}-shrub", i), BucketCategory::MERC, + GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_SHRUB, BucketId::GMERC_L1_SHRUB, i), m_generic2, + Generic2::Mode::NORMAL); // 230 init_bucket_renderer( @@ -201,6 +209,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("merc-l{}-alpha", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_ALPHA, BucketId::MERC_L1_ALPHA, i), m_merc2); + init_bucket_renderer( + fmt::format("gmerc-l{}-alpha", i), BucketCategory::GENERIC, + GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_ALPHA, BucketId::GMERC_L1_ALPHA, i), m_generic2, + Generic2::Mode::NORMAL); init_bucket_renderer( fmt::format("tie-w-l{}-water", i), BucketCategory::TIE, GET_BUCKET_ID_FOR_LIST(BucketId::TIE_L0_WATER, BucketId::TIE_L1_WATER, i), tie, @@ -216,6 +228,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { BucketId::TEX_LCOM_TFRAG, texture_animator); init_bucket_renderer("merc-lcom-tfrag", BucketCategory::MERC, BucketId::MERC_LCOM_TFRAG, m_merc2); + init_bucket_renderer("gmerc-lcom-tfrag", BucketCategory::GENERIC, + BucketId::GMERC_LCOM_TFRAG, m_generic2, + Generic2::Mode::NORMAL); // 345 init_bucket_renderer("tex-lcom-shrub", BucketCategory::TEX, BucketId::TEX_LCOM_SHRUB, texture_animator); @@ -236,10 +251,18 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("merc-l{}-pris", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_PRIS, BucketId::MERC_L1_PRIS, i), m_merc2); + init_bucket_renderer( + fmt::format("gmerc-l{}-pris", i), BucketCategory::GENERIC, + GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_PRIS, BucketId::GMERC_L1_PRIS, i), m_generic2, + Generic2::Mode::NORMAL); init_bucket_renderer( fmt::format("merc-l{}-pris2", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_PRIS2, BucketId::MERC_L1_PRIS2, i), m_merc2); + init_bucket_renderer( + fmt::format("gmerc-l{}-pris2", i), BucketCategory::GENERIC, + GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_PRIS, BucketId::GMERC_L1_PRIS, i), m_generic2, + Generic2::Mode::NORMAL); } // 401 @@ -247,6 +270,9 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { BucketId::TEX_LCOM_PRIS, texture_animator); init_bucket_renderer("merc-lcom-pris", BucketCategory::MERC, BucketId::MERC_LCOM_PRIS, m_merc2); + init_bucket_renderer("gmerc-lcom-pris", BucketCategory::GENERIC, + BucketId::GMERC_LCOM_PRIS, m_generic2, + Generic2::Mode::NORMAL); // 461 init_bucket_renderer("tex-lcom-sky-post", BucketCategory::TEX, @@ -264,6 +290,10 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { init_bucket_renderer( fmt::format("merc-l{}-water", i), BucketCategory::MERC, GET_BUCKET_ID_FOR_LIST(BucketId::MERC_L0_WATER, BucketId::MERC_L1_WATER, i), m_merc2); + init_bucket_renderer( + fmt::format("gmerc-l{}-water", i), BucketCategory::GENERIC, + GET_BUCKET_ID_FOR_LIST(BucketId::GMERC_L0_WATER, BucketId::GMERC_L1_WATER, i), m_generic2, + Generic2::Mode::NORMAL); // 466 init_bucket_renderer( fmt::format("tfrag-l{}-water", i), BucketCategory::TFRAG, @@ -287,6 +317,8 @@ void OpenGLRenderer::init_bucket_renderers_jak3() { // 575 init_bucket_renderer("tex-warp", BucketCategory::TEX, BucketId::TEX_WARP, texture_animator); + init_bucket_renderer("generic-warp", BucketCategory::GENERIC, BucketId::GENERIC_WARP, + m_generic2); init_bucket_renderer("debug-no-zbuf1", BucketCategory::OTHER, BucketId::DEBUG_NO_ZBUF1, m_texture_animator, true); diff --git a/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp b/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp index 7a4b60a5d3..c90f0dd3c8 100644 --- a/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp +++ b/game/graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp @@ -250,7 +250,7 @@ void Generic2::setup_opengl_tex(u16 unit, glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); } - if (render_state->version == GameVersion::Jak2 && tbp_to_lookup == 1216) { + if (render_state->version >= GameVersion::Jak2 && tbp_to_lookup == 1216) { glUniform1ui(m_ogl.warp_sample_mode, 1); // warp shader uses region clamp, which isn't supported by DrawMode. glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); diff --git a/game/mips2c/jak3_functions/font.cpp b/game/mips2c/jak3_functions/font.cpp index c4a3e4506f..96e724fc31 100644 --- a/game/mips2c/jak3_functions/font.cpp +++ b/game/mips2c/jak3_functions/font.cpp @@ -175,8 +175,10 @@ u64 execute(void* ctxt) { c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7) c->lqc2(vf26, 812, v1); // lqc2 vf26, 812(v1) c->lqc2(vf27, 812, v1); // lqc2 vf27, 812(v1) - c->vadd_bc(DEST::xy, BC::w, vf26, vf26, vf0); // vaddw.xy vf26, vf26, vf0 - c->vadd_bc(DEST::x, BC::w, vf26, vf26, vf0); // vaddw.x vf26, vf26, vf0 + // shadow hack begin + // c->vadd_bc(DEST::xy, BC::w, vf26, vf26, vf0); // vaddw.xy vf26, vf26, vf0 + // c->vadd_bc(DEST::x, BC::w, vf26, vf26, vf0); // vaddw.x vf26, vf26, vf0 + // shadow hack end c->lw(v1, 68, a2); // lw v1, 68(a2) c->lqc2(vf25, 44, a2); // lqc2 vf25, 44(a2) c->lqc2(vf23, 12, a2); // lqc2 vf23, 12(a2) @@ -187,12 +189,29 @@ u64 execute(void* ctxt) { c->lqc2(vf31, 48, v1); // lqc2 vf31, 48(v1) c->load_symbol2(v1, cache.video_params); // lw v1, *video-params*(s7) c->mov64(v1, v1); // or v1, v1, r0 + // shadow hack begin + c->lw(t0, 16, v1); // lw t0, 16(v1) + // multiply shadow offset by font scale and screen x scale + c->vfs[vf26].f[0] += c->gprs[t0].f[0] * 2; + c->vfs[vf26].f[1] += 1; + // shadow hack end c->lqc2(vf1, 32, v1); // lqc2 vf1, 32(v1) c->vdiv(vf0, BC::w, vf25, BC::w); // vdiv Q, vf0.w, vf25.w c->lqc2(vf2, 16, v1); // lqc2 vf2, 16(v1) c->vmul(DEST::x, vf25, vf25, vf1); // vmul.x vf25, vf25, vf1 c->vmul(DEST::x, vf23, vf23, vf1); // vmul.x vf23, vf23, vf1 - c->vmul(DEST::x, vf24, vf24, vf1); // vmul.x vf24, vf24, vf1 + // pc-hack + c->lw(v1, 64, a2); // lw v1, 64(a2) + if (!(c->gprs[v1].du32[0] & (1 << 6))) { + // pc-hack flag + c->vmul(DEST::x, vf24, vf24, vf1); // vmul.x vf24, vf24, vf1 + } + if (!(c->gprs[v1].du32[0] & (1 << 5))) { + // small font, readjust shadow + c->vfs[vf26].f[0] -= (c->gprs[t0].f[0] * 2) - (c->vfs[vf25].f[3] * c->gprs[t0].f[0] * 2); + c->vfs[vf26].f[1] -= 1 - (c->vfs[vf25].f[3] * 1); + } + // pc-hack end c->vwaitq(); // vwaitq c->vmulq(DEST::xy, vf25, vf25); // vmulq.xy vf25, vf25, Q c->vmulq(DEST::xy, vf23, vf23); // vmulq.xy vf23, vf23, Q @@ -2739,10 +2758,16 @@ block_59: block_60: c->vsub(DEST::xyzw, vf23, vf23, vf24); // vsub.xyzw vf23, vf23, vf24 - c->load_symbol2(v1, cache.video_params); // lw v1, *video-params*(s7) - c->mov64(v1, v1); // or v1, v1, r0 - c->lqc2(vf1, 16, v1); // lqc2 vf1, 16(v1) - c->vmul(DEST::x, vf23, vf23, vf1); // vmul.x vf23, vf23, vf1 + // pc-hack + c->lw(v1, 64, a1); // lw v1, 64(a1) + if (!(c->gprs[v1].du32[0] & 1 << 6)) { + // pc-hack flag + c->load_symbol2(v1, cache.video_params); // lw v1, *video-params*(s7) + c->mov64(v1, v1); // or v1, v1, r0 + c->lqc2(vf1, 16, v1); // lqc2 vf1, 16(v1) + c->vmul(DEST::x, vf23, vf23, vf1); // vmul.x vf23, vf23, vf1 + } + // pc-hack end c->lqc2(vf1, 44, a1); // lqc2 vf1, 44(a1) c->vmul_bc(DEST::x, BC::w, vf23, vf23, vf1); // vmulw.x vf23, vf23, vf1 c->mov128_gpr_vf(v0, vf23); // qmfc2.i v0, vf23 @@ -2761,7 +2786,8 @@ void link() { cache.font12_table = intern_from_c(-1, 0, "*font12-table*").c(); cache.font24_table = intern_from_c(-1, 0, "*font24-table*").c(); cache.video_params = intern_from_c(-1, 0, "*video-params*").c(); - gLinkedFunctionTable.reg("get-string-length", execute, 512); + // gLinkedFunctionTable.reg("get-string-length", execute, 512); + gLinkedFunctionTable.reg("get-string-length-asm", execute, 512); } } // namespace get_string_length diff --git a/game/mips2c/jak3_functions/generic_merc.cpp b/game/mips2c/jak3_functions/generic_merc.cpp new file mode 100644 index 0000000000..a2efa16ab5 --- /dev/null +++ b/game/mips2c/jak3_functions/generic_merc.cpp @@ -0,0 +1,3588 @@ +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" + +namespace Mips2C::jak3 { +namespace generic_warp_dest { +u64 execute(void* c); +} +namespace generic_prepare_dma_single { +u64 execute_real(void* c); +} +namespace generic_prepare_dma_double { +u64 execute(void* c); +} + +namespace generic_light_proc { +u64 execute(void* c); +} + +namespace generic_envmap_proc { +u64 execute(void* c); +} +} + +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace generic_merc_init_asm { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* gsf_buffer; // *gsf-buffer* + void* inv_init_table; // *inv-init-table* + void* math_camera; // *math-camera* + void* generic_envmap_proc; // generic-envmap-proc + void* generic_light_proc; // generic-light-proc + void* generic_prepare_dma_double; // generic-prepare-dma-double + void* generic_prepare_dma_single; // generic-prepare-dma-single + void* high_speed_reject; // high-speed-reject + void* mercneric_convert; // mercneric-convert + void* mercneric_vu0_block; // mercneric-vu0-block + void* upload_vu0_program; // upload-vu0-program +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -16); // daddiu sp, sp, -16 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->load_symbol2(t9, cache.upload_vu0_program); // lw t9, upload-vu0-program(s7) + c->load_symbol2(a0, cache.mercneric_vu0_block); // lw a0, mercneric-vu0-block(s7) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->ori(a1, v1, 84); // ori a1, v1, 84 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(v1, cache.math_camera); // lw v1, *math-camera*(s7) + c->addiu(a0, r0, 7136); // addiu a0, r0, 7136 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + c->load_symbol2(a1, cache.mercneric_convert); // lw a1, mercneric-convert(s7) + c->sw(a1, 324, a0); // sw a1, 324(a0) + c->load_symbol2(a1, cache.generic_prepare_dma_single);// lw a1, generic-prepare-dma-single(s7) + c->sw(a1, 328, a0); // sw a1, 328(a0) + c->load_symbol2(a1, cache.generic_prepare_dma_double);// lw a1, generic-prepare-dma-double(s7) + c->sw(a1, 332, a0); // sw a1, 332(a0) + c->load_symbol2(a1, cache.generic_light_proc); // lw a1, generic-light-proc(s7) + c->sw(a1, 336, a0); // sw a1, 336(a0) + c->load_symbol2(a1, cache.generic_envmap_proc); // lw a1, generic-envmap-proc(s7) + c->sw(a1, 340, a0); // sw a1, 340(a0) + c->load_symbol2(a1, cache.high_speed_reject); // lw a1, high-speed-reject(s7) + c->sw(a1, 344, a0); // sw a1, 344(a0) + c->sw(r0, 320, a0); // sw r0, 320(a0) + c->daddu(t0, r0, a0); // daddu t0, r0, a0 + c->daddiu(t1, v1, 156); // daddiu t1, v1, 156 + c->lq(a1, 0, t1); // lq a1, 0(t1) + c->lq(a2, 16, t1); // lq a2, 16(t1) + c->lq(a3, 32, t1); // lq a3, 32(t1) + c->lq(t1, 48, t1); // lq t1, 48(t1) + c->sq(a1, 0, t0); // sq a1, 0(t0) + c->sq(a2, 16, t0); // sq a2, 16(t0) + c->sq(a3, 32, t0); // sq a3, 32(t0) + c->sq(t1, 48, t0); // sq t1, 48(t0) + c->daddiu(t0, a0, 64); // daddiu t0, a0, 64 + c->daddiu(t1, v1, 220); // daddiu t1, v1, 220 + c->lq(a1, 0, t1); // lq a1, 0(t1) + c->lq(a2, 16, t1); // lq a2, 16(t1) + c->lq(a3, 32, t1); // lq a3, 32(t1) + c->lq(t1, 48, t1); // lq t1, 48(t1) + c->sq(a1, 0, t0); // sq a1, 0(t0) + c->sq(a2, 16, t0); // sq a2, 16(t0) + c->sq(a3, 32, t0); // sq a3, 32(t0) + c->sq(t1, 48, t0); // sq t1, 48(t0) + c->daddiu(t0, a0, 128); // daddiu t0, a0, 128 + c->daddiu(t1, v1, 428); // daddiu t1, v1, 428 + c->lq(a1, 0, t1); // lq a1, 0(t1) + c->lq(a2, 16, t1); // lq a2, 16(t1) + c->lq(a3, 32, t1); // lq a3, 32(t1) + c->lq(t1, 48, t1); // lq t1, 48(t1) + c->sq(a1, 0, t0); // sq a1, 0(t0) + c->sq(a2, 16, t0); // sq a2, 16(t0) + c->sq(a3, 32, t0); // sq a3, 32(t0) + c->sq(t1, 48, t0); // sq t1, 48(t0) + c->lui(a1, 16256); // lui a1, 16256 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->lwc1(f1, 12, v1); // lwc1 f1, 12(v1) + c->divs(f1, f0, f1); // div.s f1, f0, f1 + c->lui(a1, 16256); // lui a1, 16256 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->lwc1(f2, 16, v1); // lwc1 f2, 16(v1) + c->divs(f0, f0, f2); // div.s f0, f0, f2 + c->daddiu(a2, a0, 352); // daddiu a2, a0, 352 + c->daddiu(a1, a0, 368); // daddiu a1, a0, 368 + c->daddiu(a0, a0, 384); // daddiu a0, a0, 384 + c->swc1(f1, 0, a2); // swc1 f1, 0(a2) + c->negs(f1, f1); // neg.s f1, f1 + c->swc1(f1, 4, a2); // swc1 f1, 4(a2) + c->mtc1(f1, r0); // mtc1 f1, r0 + c->swc1(f1, 8, a2); // swc1 f1, 8(a2) + c->mtc1(f1, r0); // mtc1 f1, r0 + c->swc1(f1, 12, a2); // swc1 f1, 12(a2) + c->mtc1(f1, r0); // mtc1 f1, r0 + c->swc1(f1, 0, a1); // swc1 f1, 0(a1) + c->mtc1(f1, r0); // mtc1 f1, r0 + c->swc1(f1, 4, a1); // swc1 f1, 4(a1) + c->swc1(f0, 8, a1); // swc1 f0, 8(a1) + c->negs(f0, f0); // neg.s f0, f0 + c->swc1(f0, 12, a1); // swc1 f0, 12(a1) + c->lui(a1, 15104); // lui a1, 15104 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->swc1(f0, 0, a0); // swc1 f0, 0(a0) + c->lui(a1, 15104); // lui a1, 15104 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->swc1(f0, 4, a0); // swc1 f0, 4(a0) + c->lui(a1, 16128); // lui a1, 16128 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->swc1(f0, 8, a0); // swc1 f0, 8(a0) + c->lwc1(f0, 908, v1); // lwc1 f0, 908(v1) + c->swc1(f0, 12, a0); // swc1 f0, 12(a0) + c->load_symbol2(v1, cache.gsf_buffer); // lw v1, *gsf-buffer*(s7) + c->daddiu(a0, v1, 32); // daddiu a0, v1, 32 + c->sw(a0, 0, v1); // sw a0, 0(v1) + c->daddiu(a0, v1, 448); // daddiu a0, v1, 448 + c->sw(a0, 4, v1); // sw a0, 4(v1) + c->daddiu(a0, v1, 6608); // daddiu a0, v1, 6608 + c->sw(a0, 8, v1); // sw a0, 8(v1) + c->daddiu(a0, v1, 2784); // daddiu a0, v1, 2784 + c->sw(a0, 2752, v1); // sw a0, 2752(v1) + c->daddiu(a0, v1, 3200); // daddiu a0, v1, 3200 + c->sw(a0, 2756, v1); // sw a0, 2756(v1) + c->daddiu(a0, v1, 6608); // daddiu a0, v1, 6608 + c->sw(a0, 2760, v1); // sw a0, 2760(v1) + c->load_symbol2(v1, cache.gsf_buffer); // lw v1, *gsf-buffer*(s7) + c->daddiu(a0, v1, 5504); // daddiu a0, v1, 5504 + c->mov64(a0, a0); // or a0, a0, r0 + c->load_symbol2(a1, cache.inv_init_table); // lw a1, *inv-init-table*(s7) + c->mov64(a1, a1); // or a1, a1, r0 + c->sq(r0, 0, a0); // sq r0, 0(a0) + c->sq(r0, 544, a0); // sq r0, 544(a0) + c->sq(r0, 16, a0); // sq r0, 16(a0) + c->sq(r0, 560, a0); // sq r0, 560(a0) + c->sq(r0, 208, a0); // sq r0, 208(a0) + c->sq(r0, 752, a0); // sq r0, 752(a0) + c->sq(r0, 224, a0); // sq r0, 224(a0) + c->sq(r0, 768, a0); // sq r0, 768(a0) + c->sq(r0, 240, a0); // sq r0, 240(a0) + c->sq(r0, 784, a0); // sq r0, 784(a0) + c->sq(r0, 384, a0); // sq r0, 384(a0) + c->sq(r0, 800, a0); // sq r0, 800(a0) + c->sq(r0, 400, a0); // sq r0, 400(a0) + c->sq(r0, 944, a0); // sq r0, 944(a0) + c->sq(r0, 416, a0); // sq r0, 416(a0) + c->sq(r0, 960, a0); // sq r0, 960(a0) + c->sq(r0, 432, a0); // sq r0, 432(a0) + c->sq(r0, 976, a0); // sq r0, 976(a0) + c->sq(r0, 448, a0); // sq r0, 448(a0) + c->sq(r0, 992, a0); // sq r0, 992(a0) + c->sq(r0, 464, a0); // sq r0, 464(a0) + c->sq(r0, 1008, a0); // sq r0, 1008(a0) + c->sq(r0, 480, a0); // sq r0, 480(a0) + c->sq(r0, 1024, a0); // sq r0, 1024(a0) + c->sq(r0, 496, a0); // sq r0, 496(a0) + c->sq(r0, 1040, a0); // sq r0, 1040(a0) + c->sq(r0, 512, a0); // sq r0, 512(a0) + c->sq(r0, 1056, a0); // sq r0, 1056(a0) + c->sq(r0, 528, a0); // sq r0, 528(a0) + c->sq(r0, 1072, a0); // sq r0, 1072(a0) + c->addiu(a2, r0, 8); // addiu a2, r0, 8 + // nop // sll r0, r0, 0 + +block_1: + c->lhu(t1, 2, a1); // lhu t1, 2(a1) + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->lbu(a3, 0, a1); // lbu a3, 0(a1) + // nop // sll r0, r0, 0 + c->lbu(t0, 1, a1); // lbu t0, 1(a1) + // nop // sll r0, r0, 0 + c->daddu(t1, t1, a0); // daddu t1, t1, a0 + c->daddiu(a1, a1, 4); // daddiu a1, a1, 4 + +block_2: + c->sb(t0, 0, t1); // sb t0, 0(t1) + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + c->sb(t0, 550, t1); // sb t0, 550(t1) + c->daddiu(t0, t0, 2); // daddiu t0, t0, 2 + c->daddiu(t1, t1, 3); // daddiu t1, t1, 3 + // nop // sll r0, r0, 0 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L170 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + bc = c->sgpr64(a2) != 0; // bne a2, r0, L169 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->daddu(a0, r0, v1); // daddu a0, r0, v1 + c->mov64(a0, a0); // or a0, a0, r0 + c->sq(r0, 416, a0); // sq r0, 416(a0) + c->sq(r0, 432, a0); // sq r0, 432(a0) + c->daddiu(v1, v1, 2752); // daddiu v1, v1, 2752 + c->mov64(v1, v1); // or v1, v1, r0 + c->sq(r0, 416, v1); // sq r0, 416(v1) + c->sq(r0, 432, v1); // sq r0, 432(v1) + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lui(v1, 4096); // lui v1, 4096 + c->ori(v1, v1, 32768); // ori v1, v1, 32768 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->ori(a0, a0, 84); // ori a0, a0, 84 + +// dma sync +// c->lw(a1, 0, v1); // lw a1, 0(v1) +// c->andi(a1, a1, 256); // andi a1, a1, 256 +// bc = c->sgpr64(a1) == 0; // beq a1, r0, L172 +// DANGER jump to delay slot, this MUST be fixed manually! +// c->lw(a1, 0, a0); // lw a1, 0(a0) +// if (bc) {goto block_-1;} // branch non-likely +// +// +// block_5: +// c->lw(a1, 0, a0); // lw a1, 0(a0) +// // nop // sll r0, r0, 0 +// c->lw(a2, 0, v1); // lw a2, 0(v1) +// // nop // sll r0, r0, 0 +// c->andi(a2, a2, 256); // andi a2, a2, 256 +// c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 +// bc = c->sgpr64(a2) != 0; // bne a2, r0, L171 +// c->sw(a1, 0, a0); // sw a1, 0(a0) +// if (bc) {goto block_5;} // branch non-likely + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + goto end_of_function; // return + +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.gsf_buffer = intern_from_c(-1, 0, "*gsf-buffer*").c(); + cache.inv_init_table = intern_from_c(-1, 0, "*inv-init-table*").c(); + cache.math_camera = intern_from_c(-1, 0, "*math-camera*").c(); + cache.generic_envmap_proc = intern_from_c(-1, 0, "generic-envmap-proc").c(); + cache.generic_light_proc = intern_from_c(-1, 0, "generic-light-proc").c(); + cache.generic_prepare_dma_double = intern_from_c(-1, 0, "generic-prepare-dma-double").c(); + cache.generic_prepare_dma_single = intern_from_c(-1, 0, "generic-prepare-dma-single").c(); + cache.high_speed_reject = intern_from_c(-1, 0, "high-speed-reject").c(); + cache.mercneric_convert = intern_from_c(-1, 0, "mercneric-convert").c(); + cache.mercneric_vu0_block = intern_from_c(-1, 0, "mercneric-vu0-block").c(); + cache.upload_vu0_program = intern_from_c(-1, 0, "upload-vu0-program").c(); + gLinkedFunctionTable.reg("generic-merc-init-asm", execute, 128); +} + +} // namespace generic_merc_init_asm +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace mercneric_convert { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u8 vu0_data_mem[1024 * 4]; + +void sq_buffer(Mask mask, const Vf& data, u32 qw) { + ASSERT(qw * 16 < sizeof(vu0_data_mem)); + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + memcpy(vu0_data_mem + qw * 16 + i * 4, data.data + i, 4); + } + } +} + +void sq_xyzw(const Vf& data, u32 qw) { + memcpy(vu0_data_mem + qw * 16, data.data, 16); +} + +void lq_buffer(Mask mask, Vf& data, u32 qw) { + ASSERT(qw * 16 < sizeof(vu0_data_mem)); + for (int i = 0; i < 4; i++) { + if ((u64)mask & (1 << i)) { + memcpy(data.data + i, vu0_data_mem + qw * 16 + i * 4, 4); + } + } +} + +void lq_xyzw(Vf& data, u32 qw) { + memcpy(data.data, vu0_data_mem + qw * 16, 16); +} + +void vcallms_280(ExecutionContext* c, u16* vis) { + bool bc; + // 0.003921569 | maxw.x vf17, vf00, vf00 :i + c->vfs[vf17].vf.max(Mask::x, c->vf_src(vf00).vf, c->vf_src(vf00).vf.w()); c->I = 0.003921569; + // -65537.0 | maxi.y vf17, vf00, I :i + c->vfs[vf17].vf.maxi(Mask::y, c->vf_src(vf00).vf, c->I); c->I = -65537.0; + // iaddiu vi10, vi10, 0x88 | minii.z vf05, vf00, I + c->vfs[vf05].vf.minii(Mask::z, c->vf_src(vf00).vf, c->I); vis[vi10] = vis[vi10] + 0x88; /* 136 */ + // iaddiu vi08, vi00, 0x8c | minii.z vf06, vf00, I + c->vfs[vf06].vf.minii(Mask::z, c->vf_src(vf00).vf, c->I); vis[vi08] = 0x8c; /* 140 */ + // sqi.xyzw vf01, vi08 | minii.z vf07, vf00, I + + c->vfs[vf07].vf.minii(Mask::z, c->vf_src(vf00).vf, c->I); sq_xyzw(c->vf_src(vf01).vf, vis[vi08]++); + // sqi.xyzw vf02, vi08 | minix.w vf05, vf00, vf27 + c->vfs[vf05].vf.mini(Mask::w, c->vf_src(vf00).vf, c->vf_src(vf27).vf.x()); sq_xyzw(c->vf_src(vf02).vf, vis[vi08]++); + // sqi.xyzw vf03, vi08 | miniy.w vf06, vf00, vf27 + c->vfs[vf06].vf.mini(Mask::w, c->vf_src(vf00).vf, c->vf_src(vf27).vf.y()); sq_xyzw(c->vf_src(vf03).vf, vis[vi08]++); + // sqi.xyzw vf04, vi08 | miniz.w vf07, vf00, vf27 + c->vfs[vf07].vf.mini(Mask::w, c->vf_src(vf00).vf, c->vf_src(vf27).vf.z()); sq_xyzw(c->vf_src(vf04).vf, vis[vi08]++); + + // BRANCH! + // ibne vi00, vi13, L1 | nop + bc = (vis[vi13] != 0); + // iaddiu vi05, vi00, 0x182 | nop + vis[vi05] = 0x182; /* 386 */ + if (bc) { goto L1; } + + // iaddiu vi05, vi00, 0x1ab | nop + vis[vi05] = 0x1ab; /* 427 */ + L1: + // BRANCH! + // ibne vi00, vi12, L2 | nop + bc = (vis[vi12] != 0); + // iaddiu vi03, vi00, 0x146 | nop + vis[vi03] = 0x146; /* 326 */ + if (bc) { goto L2; } + + // ior vi03, vi05, vi00 | nop + vis[vi03] = vis[vi05]; + L2: + // BRANCH! + // ibne vi00, vi11, L3 | nop + bc = (vis[vi11] != 0); + // iaddiu vi01, vi00, 0x13a | nop + vis[vi01] = 0x13a; /* 314 */ + if (bc) { goto L3; } + + // ior vi01, vi03, vi00 | nop + vis[vi01] = vis[vi03]; + L3: + // lqi.xyzw vf29, vi10 | nop + lq_xyzw(c->vfs[vf29].vf, vis[vi10]++); + // iadd vi02, vi08, vi11 | nop + vis[vi02] = vis[vi08] + vis[vi11]; + // iadd vi04, vi02, vi12 | nop + vis[vi04] = vis[vi02] + vis[vi12]; + // iadd vi06, vi04, vi13 | nop + vis[vi06] = vis[vi04] + vis[vi13]; + // mtir vi13, vf29.w | itof0.xyzw vf18, vf29 :e + c->vfs[vf18].vf.itof0(Mask::xyzw, c->vf_src(vf29).vf); vis[vi13] = c->vf_src(vf29).vf.w_as_u16(); + // iaddiu vi09, vi00, 0x7f | nop + vis[vi09] = 0x7f; /* 127 */ + + +} + +void vcallms_303(ExecutionContext* c, u16* vis) { + // vf21.x coming into here is bad (should be < 1, I think) + // sq.xyzw vf23, 3(vi14) | mulx.xyzw vf11, vf20, vf19 + c->vfs[vf11].vf.mul_xyzw(c->vf_src(vf20).vf, c->vf_src(vf19).vf.x()); sq_xyzw(c->vf_src(vf23).vf, vis[vi14] + 3); + // sq.xyzw vf24, 4(vi14) | mulx.xyzw vf12, vf21, vf19 + c->vfs[vf12].vf.mul_xyzw(c->vf_src(vf21).vf, c->vf_src(vf19).vf.x()); sq_xyzw(c->vf_src(vf24).vf, vis[vi14] + 4); + // sq.xyzw vf25, 5(vi14) | mulx.xyzw vf13, vf22, vf19 + c->vfs[vf13].vf.mul_xyzw(c->vf_src(vf22).vf, c->vf_src(vf19).vf.x()); sq_xyzw(c->vf_src(vf25).vf, vis[vi14] + 5); + + // sq.xyzw vf26, 6(vi14) | nop + sq_xyzw(c->vf_src(vf26).vf, vis[vi14] + 6); + // sq.xyzw vf11, 0(vi14) | nop + sq_xyzw(c->vf_src(vf11).vf, vis[vi14]); + // sq.xyzw vf12, 1(vi14) | nop + sq_xyzw(c->vf_src(vf12).vf, vis[vi14] + 1); + // sq.xyzw vf13, 2(vi14) | nop :e + sq_xyzw(c->vf_src(vf13).vf, vis[vi14] + 2); + // nop | nop + +} + +void vcallms_311_case_314(ExecutionContext* c, u16* vis) { + // this is one of the most expensive operations. + + // 00 mtir vi11, vf01.x | maddz.xyzw vf11, vf26, vf10 + // 01 jr vi01 | mul.xyzw vf14, vf13, Q + // 02 sqi.xyzw vf04, vi08 | mulaw.xyzw ACC, vf20, vf08 + // 03 rsqrt Q, vf00.w, vf16.x | maddaw.xyzw ACC, vf21, vf09 + // 04 lq.xyzw vf24, -124(vi11) | maddaw.xyzw ACC, vf22, vf10 + // 05 lq.xyzw vf25, -123(vi11) | maddw.xyzw vf15, vf23, vf00 + // 06 lq.xyzw vf26, -122(vi11) | mul.xyzw vf16, vf11, vf11 + // 07 lq.xyzw vf20, -128(vi11) | add.xyzw vf08, vf01, vf05 + // 08 lq.xyzw vf21, -127(vi11) | add.xyzw vf09, vf02, vf06 + // 09 lq.xyzw vf22, -126(vi11) | add.xyzw vf10, vf03, vf07 + // 10 ibne vi08, vi02, L4 | adday.xyzw vf16, vf16 + // 11 lq.xyzw vf23, -125(vi11) | maddz.xyzw vf16, vf17, vf16 + // 12 ior vi01, vi03, vi00 | nop + // L4: + // 13 move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + // 14 move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + + // we've got: + // - mul by Q + // - calculate next Q + // - accumulated multiply part + // - lots of loading + // - adding part + + c->acc.vf.madd_xyzw(c->vfs[vf11].vf, c->vf_src(vf26).vf, c->vf_src(vf10).vf.z()); + vis[vi11] = c->vf_src(vf01).vf.x_as_u16(); + c->vfs[vf14].vf.mul_xyzw(c->vf_src(vf13).vf, c->Q); + sq_xyzw(c->vf_src(vf04).vf, vis[vi08]++); + c->Q = 1.f / std::sqrt(c->vf_src(vf16).vf.x()); + + + + // c->acc.vf.mula_xyzw(c->vf_src(vf20).vf, c->vf_src(vf08).vf.w()); + // c->acc.vf.madda_xyzw(c->vfs[vf21].vf, c->vfs[vf09].vf.w()); + // c->acc.vf.madda_xyzw(c->vfs[vf22].vf, c->vfs[vf10].vf.w()); + // c->acc.vf.madd_xyzw(c->vfs[vf15].vf, c->vf_src(vf23).vf, c->vf_src(vf00).vf.w()); + + __m128 acc = _mm_mul_ps(_mm_load_ps(c->vf_src(vf20).vf.data), _mm_set1_ps(c->vf_src(vf08).vf.w())); + acc = _mm_add_ps(_mm_mul_ps(_mm_load_ps(c->vf_src(vf21).vf.data), _mm_set1_ps(c->vf_src(vf09).vf.w())), acc); + acc = _mm_add_ps(_mm_mul_ps(_mm_load_ps(c->vf_src(vf22).vf.data), _mm_set1_ps(c->vf_src(vf10).vf.w())), acc); + acc = _mm_add_ps(_mm_load_ps(c->vf_src(vf23).vf.data), acc); + _mm_store_ps(c->vfs[vf15].vf.data, acc); + + + // lq_xyzw(c->vfs[vf20].vf, vis[vi11] + -128); + // lq_xyzw(c->vfs[vf21].vf, vis[vi11] + -127); + // lq_xyzw(c->vfs[vf22].vf, vis[vi11] + -126); + // lq_xyzw(c->vfs[vf23].vf, vis[vi11] + -125); + // lq_xyzw(c->vfs[vf24].vf, vis[vi11] + -124); + // lq_xyzw(c->vfs[vf25].vf, vis[vi11] + -123); + // lq_xyzw(c->vfs[vf26].vf, vis[vi11] + -122); + memcpy(c->vfs[vf20].vf.data, vu0_data_mem + (vis[vi11] - 128) * 16, 7 * 16); + + + c->vfs[vf16].vf.mul_xyzw(c->vf_src(vf11).vf, c->vf_src(vf11).vf); + c->vfs[vf08].vf.add_xyzw(c->vf_src(vf01).vf, c->vf_src(vf05).vf); + c->vfs[vf09].vf.add_xyzw(c->vf_src(vf02).vf, c->vf_src(vf06).vf); + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); + + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); + + c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + + // end integer thing. + if (vis[vi08] == vis[vi02]) { + vis[vi01] = vis[vi03]; + } +} + +void vcallms_311_case_326(ExecutionContext* c, u16* vis) { + bool bc; + // mtir vi11, vf01.x | maddz.xyzw vf11, vf26, vf10 + c->acc.vf.madd_xyzw(c->vfs[vf11].vf, c->vf_src(vf26).vf, c->vf_src(vf10).vf.z()); vis[vi11] = c->vf_src(vf01).vf.x_as_u16(); + // jr vi01 | mul.xyzw vf14, vf13, Q + c->vfs[vf14].vf.mul_xyzw(c->vf_src(vf13).vf, c->Q); + // sqi.xyzw vf04, vi08 | mulaw.xyzw ACC, vf20, vf08 + c->acc.vf.mula_xyzw(c->vf_src(vf20).vf, c->vf_src(vf08).vf.w()); sq_xyzw(c->vf_src(vf04).vf, vis[vi08]++); +// rsqrt Q, vf00.w, vf16.x | maddaw.xyzw ACC, vf21, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf21].vf, c->vfs[vf09].vf.w()); c->Q = c->vf_src(vf00).vf.w() / std::sqrt(c->vf_src(vf16).vf.x()); + // mtir vi12, vf01.y | maddaw.xyzw ACC, vf22, vf10 + c->acc.vf.madda_xyzw(c->vfs[vf22].vf, c->vfs[vf10].vf.w()); vis[vi12] = c->vf_src(vf01).vf.y_as_u16(); + // iand vi11, vi11, vi09 | maddw.xyzw vf15, vf23, vf00 + c->acc.vf.madd_xyzw(c->vfs[vf15].vf, c->vf_src(vf23).vf, c->vf_src(vf00).vf.w()); vis[vi11] = vis[vi11] & vis[vi09]; + // lq.xyzw vf19, 4(vi11) | mul.xyzw vf16, vf11, vf11 + c->vfs[vf16].vf.mul_xyzw(c->vf_src(vf11).vf, c->vf_src(vf11).vf); lq_xyzw(c->vfs[vf19].vf, vis[vi11] + 4); + // BRANCH! + // ibeq vi09, vi11, L7 | add.xyzw vf08, vf01, vf05 + c->vfs[vf08].vf.add_xyzw(c->vf_src(vf01).vf, c->vf_src(vf05).vf); bc = (vis[vi09] == vis[vi11]); + // iand vi12, vi12, vi09 | add.xyzw vf09, vf02, vf06 + c->vfs[vf09].vf.add_xyzw(c->vf_src(vf02).vf, c->vf_src(vf06).vf); vis[vi12] = vis[vi12] & vis[vi09]; + if (bc) { goto L7; } + + // nop | muly.xyzw vf18, vf18, vf17 + c->vfs[vf18].vf.mul_xyzw(c->vf_src(vf18).vf, c->vf_src(vf17).vf.y()); + // lq.xyzw vf24, 4(vi12) | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); lq_xyzw(c->vfs[vf24].vf, vis[vi12] + 4); + // lq.xyzw vf27, 5(vi11) | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); lq_xyzw(c->vfs[vf27].vf, vis[vi11] + 5); + // lq.xyzw vf25, 5(vi12) | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); lq_xyzw(c->vfs[vf25].vf, vis[vi12] + 5); + // lq.xyzw vf28, 6(vi11) | mulax.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf28].vf, vis[vi11] + 6); + // lq.xyzw vf26, 6(vi12) | maddy.xyzw vf24, vf24, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf24].vf, c->vf_src(vf24).vf, c->vf_src(vf18).vf.y()); lq_xyzw(c->vfs[vf26].vf, vis[vi12] + 6); + // lq.xyzw vf29, 0(vi11) | mulax.xyzw ACC, vf27, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf27).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf29].vf, vis[vi11]); + // lq.xyzw vf20, 0(vi12) | maddy.xyzw vf25, vf25, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf25].vf, c->vf_src(vf25).vf, c->vf_src(vf18).vf.y()); lq_xyzw(c->vfs[vf20].vf, vis[vi12]); + // lq.xyzw vf19, 1(vi11) | mulax.xyzw ACC, vf28, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf28).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf19].vf, vis[vi11] + 1); + // lq.xyzw vf21, 1(vi12) | maddy.xyzw vf26, vf26, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf26].vf, c->vf_src(vf26).vf, c->vf_src(vf18).vf.y()); lq_xyzw(c->vfs[vf21].vf, vis[vi12] + 1); + // lq.xyzw vf27, 2(vi11) | mulax.xyzw ACC, vf29, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf29).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf27].vf, vis[vi11] + 2); + // lq.xyzw vf22, 2(vi12) | maddy.xyzw vf20, vf20, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf20].vf, c->vf_src(vf20).vf, c->vf_src(vf18).vf.y()); lq_xyzw(c->vfs[vf22].vf, vis[vi12] + 2); + // lq.xyzw vf28, 3(vi11) | mulax.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf28].vf, vis[vi11] + 3); + // lq.xyzw vf23, 3(vi12) | maddy.xyzw vf21, vf21, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf21].vf, c->vf_src(vf21).vf, c->vf_src(vf18).vf.y()); lq_xyzw(c->vfs[vf23].vf, vis[vi12] + 3); + // nop | mulax.xyzw ACC, vf27, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf27).vf, c->vf_src(vf18).vf.x()); + // iaddiu vi01, vi00, 0x161 | maddy.xyzw vf22, vf22, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf22].vf, c->vf_src(vf22).vf, c->vf_src(vf18).vf.y()); vis[vi01] = 0x161; /* 353 */ + // BRANCH! + // ibne vi08, vi04, L5 | mulax.xyzw ACC, vf28, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf28).vf, c->vf_src(vf18).vf.x()); bc = (vis[vi08] != vis[vi04]); + // nop | maddy.xyzw vf23, vf23, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf23].vf, c->vf_src(vf23).vf, c->vf_src(vf18).vf.y()); + if (bc) { goto L5; } + + // ior vi01, vi05, vi00 | nop + vis[vi01] = vis[vi05]; + L5: + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; + L7: + // nop | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); + // BRANCH! + // ibne vi08, vi04, L8 | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); bc = (vis[vi08] != vis[vi04]); + // nop | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); + if (bc) { goto L8; } + + // ior vi01, vi05, vi00 | nop + vis[vi01] = vis[vi05]; + L8: + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; +} + +void vcallms_311_case_353(ExecutionContext* c, u16* vis) { + bool bc; + // mtir vi11, vf01.x | maddz.xyzw vf11, vf26, vf10 + c->acc.vf.madd_xyzw(c->vfs[vf11].vf, c->vf_src(vf26).vf, c->vf_src(vf10).vf.z()); vis[vi11] = c->vf_src(vf01).vf.x_as_u16(); + // jr vi01 | mul.xyzw vf14, vf13, Q + c->vfs[vf14].vf.mul_xyzw(c->vf_src(vf13).vf, c->Q); + // sqi.xyzw vf04, vi08 | mulaw.xyzw ACC, vf20, vf08 + c->acc.vf.mula_xyzw(c->vf_src(vf20).vf, c->vf_src(vf08).vf.w()); sq_xyzw(c->vf_src(vf04).vf, vis[vi08]++); + // rsqrt Q, vf00.w, vf16.x | maddaw.xyzw ACC, vf21, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf21].vf, c->vfs[vf09].vf.w()); c->Q = c->vf_src(vf00).vf.w() / std::sqrt(c->vf_src(vf16).vf.x()); + // mtir vi12, vf01.y | maddaw.xyzw ACC, vf22, vf10 + c->acc.vf.madda_xyzw(c->vfs[vf22].vf, c->vfs[vf10].vf.w()); vis[vi12] = c->vf_src(vf01).vf.y_as_u16(); + // iand vi11, vi11, vi09 | maddw.xyzw vf15, vf23, vf00 + c->acc.vf.madd_xyzw(c->vfs[vf15].vf, c->vf_src(vf23).vf, c->vf_src(vf00).vf.w()); vis[vi11] = vis[vi11] & vis[vi09]; + // lq.xyzw vf19, 4(vi11) | mul.xyzw vf16, vf11, vf11 + c->vfs[vf16].vf.mul_xyzw(c->vf_src(vf11).vf, c->vf_src(vf11).vf); lq_xyzw(c->vfs[vf19].vf, vis[vi11] + 4); + // BRANCH! + // ibeq vi09, vi11, L7 | add.xyzw vf08, vf01, vf05 + c->vfs[vf08].vf.add_xyzw(c->vf_src(vf01).vf, c->vf_src(vf05).vf); bc = (vis[vi09] == vis[vi11]); + // iand vi12, vi12, vi09 | add.xyzw vf09, vf02, vf06 + c->vfs[vf09].vf.add_xyzw(c->vf_src(vf02).vf, c->vf_src(vf06).vf); vis[vi12] = vis[vi12] & vis[vi09]; + if (bc) { goto L7; } + + // lq.xyzw vf24, 4(vi12) | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); lq_xyzw(c->vfs[vf24].vf, vis[vi12] + 4); + // lq.xyzw vf27, 5(vi11) | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); lq_xyzw(c->vfs[vf27].vf, vis[vi11] + 5); + // lq.xyzw vf25, 5(vi12) | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); lq_xyzw(c->vfs[vf25].vf, vis[vi12] + 5); + // lq.xyzw vf28, 6(vi11) | mulaz.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf28].vf, vis[vi11] + 6); + // lq.xyzw vf26, 6(vi12) | maddw.xyzw vf24, vf24, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf24].vf, c->vf_src(vf24).vf, c->vf_src(vf18).vf.w()); lq_xyzw(c->vfs[vf26].vf, vis[vi12] + 6); + // lq.xyzw vf29, 0(vi11) | mulaz.xyzw ACC, vf27, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf27).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf29].vf, vis[vi11]); + // lq.xyzw vf20, 0(vi12) | maddw.xyzw vf25, vf25, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf25].vf, c->vf_src(vf25).vf, c->vf_src(vf18).vf.w()); lq_xyzw(c->vfs[vf20].vf, vis[vi12]); + // lq.xyzw vf19, 1(vi11) | mulaz.xyzw ACC, vf28, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf28).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf19].vf, vis[vi11] + 1); + // lq.xyzw vf21, 1(vi12) | maddw.xyzw vf26, vf26, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf26].vf, c->vf_src(vf26).vf, c->vf_src(vf18).vf.w()); lq_xyzw(c->vfs[vf21].vf, vis[vi12] + 1); + // lq.xyzw vf27, 2(vi11) | mulaz.xyzw ACC, vf29, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf29).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf27].vf, vis[vi11] + 2); + // lq.xyzw vf22, 2(vi12) | maddw.xyzw vf20, vf20, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf20].vf, c->vf_src(vf20).vf, c->vf_src(vf18).vf.w()); lq_xyzw(c->vfs[vf22].vf, vis[vi12] + 2); + // lq.xyzw vf28, 3(vi11) | mulaz.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf28].vf, vis[vi11] + 3); + // lq.xyzw vf23, 3(vi12) | maddw.xyzw vf21, vf21, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf21].vf, c->vf_src(vf21).vf, c->vf_src(vf18).vf.w()); lq_xyzw(c->vfs[vf23].vf, vis[vi12] + 3); + // lqi.xyzw vf29, vi10 | mulaz.xyzw ACC, vf27, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf27).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf29].vf, vis[vi10]++); + // iaddiu vi01, vi00, 0x146 | maddw.xyzw vf22, vf22, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf22].vf, c->vf_src(vf22).vf, c->vf_src(vf18).vf.w()); vis[vi01] = 0x146; /* 326 */ + // BRANCH! + // ibne vi08, vi04, L6 | mulaz.xyzw ACC, vf28, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf28).vf, c->vf_src(vf18).vf.z()); bc = (vis[vi08] != vis[vi04]); + // nop | maddw.xyzw vf23, vf23, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf23].vf, c->vf_src(vf23).vf, c->vf_src(vf18).vf.w()); + if (bc) { goto L6; } + + // ior vi01, vi05, vi00 | nop + vis[vi01] = vis[vi05]; + L6: + // mtir vi13, vf29.w | itof0.xyzw vf18, vf29 + c->vfs[vf18].vf.itof0(Mask::xyzw, c->vf_src(vf29).vf); vis[vi13] = c->vf_src(vf29).vf.w_as_u16(); + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; + L7: + // nop | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); + // BRANCH! + // ibne vi08, vi04, L8 | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); bc = (vis[vi08] != vis[vi04]); + // nop | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); + if (bc) { goto L8; } + + // ior vi01, vi05, vi00 | nop + vis[vi01] = vis[vi05]; + L8: + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; +} + +void vcallms_311_case_386(ExecutionContext* c, u16* vis) { + bool bc; + // mtir vi11, vf01.x | maddz.xyzw vf11, vf26, vf10 + c->acc.vf.madd_xyzw(c->vfs[vf11].vf, c->vf_src(vf26).vf, c->vf_src(vf10).vf.z()); vis[vi11] = c->vf_src(vf01).vf.x_as_u16(); + // jr vi01 | mul.xyzw vf14, vf13, Q + c->vfs[vf14].vf.mul_xyzw(c->vf_src(vf13).vf, c->Q); + // sqi.xyzw vf04, vi08 | mulaw.xyzw ACC, vf20, vf08 + c->acc.vf.mula_xyzw(c->vf_src(vf20).vf, c->vf_src(vf08).vf.w()); sq_xyzw(c->vf_src(vf04).vf, vis[vi08]++); + // rsqrt Q, vf00.w, vf16.x | maddaw.xyzw ACC, vf21, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf21].vf, c->vfs[vf09].vf.w()); c->Q = c->vf_src(vf00).vf.w() / std::sqrt(c->vf_src(vf16).vf.x()); + // mtir vi12, vf01.y | maddaw.xyzw ACC, vf22, vf10 + c->acc.vf.madda_xyzw(c->vfs[vf22].vf, c->vfs[vf10].vf.w()); vis[vi12] = c->vf_src(vf01).vf.y_as_u16(); + // iand vi11, vi11, vi09 | maddw.xyzw vf15, vf23, vf00 + c->acc.vf.madd_xyzw(c->vfs[vf15].vf, c->vf_src(vf23).vf, c->vf_src(vf00).vf.w()); vis[vi11] = vis[vi11] & vis[vi09]; + // lq.xyzw vf19, 4(vi11) | mul.xyzw vf16, vf11, vf11 + c->vfs[vf16].vf.mul_xyzw(c->vf_src(vf11).vf, c->vf_src(vf11).vf); lq_xyzw(c->vfs[vf19].vf, vis[vi11] + 4); + // BRANCH! + // ibeq vi09, vi11, L10 | add.xyzw vf08, vf01, vf05 + c->vfs[vf08].vf.add_xyzw(c->vf_src(vf01).vf, c->vf_src(vf05).vf); bc = (vis[vi09] == vis[vi11]); + // iand vi12, vi12, vi09 | add.xyzw vf09, vf02, vf06 + c->vfs[vf09].vf.add_xyzw(c->vf_src(vf02).vf, c->vf_src(vf06).vf); vis[vi12] = vis[vi12] & vis[vi09]; + if (bc) { goto L10; } + + // nop | muly.xyzw vf18, vf18, vf17 + c->vfs[vf18].vf.mul_xyzw(c->vf_src(vf18).vf, c->vf_src(vf17).vf.y()); + // lq.xyzw vf27, 4(vi12) | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); lq_xyzw(c->vfs[vf27].vf, vis[vi12] + 4); + // lq.xyzw vf24, 4(vi13) | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); lq_xyzw(c->vfs[vf24].vf, vis[vi13] + 4); + // lq.xyzw vf28, 5(vi11) | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); lq_xyzw(c->vfs[vf28].vf, vis[vi11] + 5); + // lq.xyzw vf19, 5(vi12) | mulax.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf19].vf, vis[vi12] + 5); + // lq.xyzw vf25, 5(vi13) | madday.xyzw ACC, vf27, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf27].vf, c->vfs[vf18].vf.y()); lq_xyzw(c->vfs[vf25].vf, vis[vi13] + 5); + // lq.xyzw vf27, 6(vi11) | maddz.xyzw vf24, vf24, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf24].vf, c->vf_src(vf24).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf27].vf, vis[vi11] + 6); + // lq.xyzw vf28, 6(vi12) | mulax.xyzw ACC, vf28, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf28).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf28].vf, vis[vi12] + 6); + // lq.xyzw vf26, 6(vi13) | madday.xyzw ACC, vf19, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf19].vf, c->vfs[vf18].vf.y()); lq_xyzw(c->vfs[vf26].vf, vis[vi13] + 6); + // lq.xyzw vf19, 0(vi11) | maddz.xyzw vf25, vf25, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf25].vf, c->vf_src(vf25).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf19].vf, vis[vi11]); + // lq.xyzw vf27, 0(vi12) | mulax.xyzw ACC, vf27, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf27).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf27].vf, vis[vi12]); + // lq.xyzw vf20, 0(vi13) | madday.xyzw ACC, vf28, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf28].vf, c->vfs[vf18].vf.y()); lq_xyzw(c->vfs[vf20].vf, vis[vi13]); + // lq.xyzw vf28, 1(vi11) | maddz.xyzw vf26, vf26, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf26].vf, c->vf_src(vf26).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf28].vf, vis[vi11] + 1); + // lq.xyzw vf19, 1(vi12) | mulax.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf19].vf, vis[vi12] + 1); + // lq.xyzw vf21, 1(vi13) | madday.xyzw ACC, vf27, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf27].vf, c->vfs[vf18].vf.y()); lq_xyzw(c->vfs[vf21].vf, vis[vi13] + 1); + // lq.xyzw vf27, 2(vi11) | maddz.xyzw vf20, vf20, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf20].vf, c->vf_src(vf20).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf27].vf, vis[vi11] + 2); + // lq.xyzw vf28, 2(vi12) | mulax.xyzw ACC, vf28, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf28).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf28].vf, vis[vi12] + 2); + // lq.xyzw vf22, 2(vi13) | madday.xyzw ACC, vf19, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf19].vf, c->vfs[vf18].vf.y()); lq_xyzw(c->vfs[vf22].vf, vis[vi13] + 2); + // lq.xyzw vf19, 3(vi11) | maddz.xyzw vf21, vf21, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf21].vf, c->vf_src(vf21).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf19].vf, vis[vi11] + 3); + // lq.xyzw vf27, 3(vi12) | mulax.xyzw ACC, vf27, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf27).vf, c->vf_src(vf18).vf.x()); lq_xyzw(c->vfs[vf27].vf, vis[vi12] + 3); + // lq.xyzw vf23, 3(vi13) | madday.xyzw ACC, vf28, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf28].vf, c->vfs[vf18].vf.y()); lq_xyzw(c->vfs[vf23].vf, vis[vi13] + 3); + // lqi.xyzw vf29, vi10 | maddz.xyzw vf22, vf22, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf22].vf, c->vf_src(vf22).vf, c->vf_src(vf18).vf.z()); lq_xyzw(c->vfs[vf29].vf, vis[vi10]++); + // BRANCH! + // ibne vi08, vi06, L9 | mulax.xyzw ACC, vf19, vf18 + c->acc.vf.mula_xyzw(c->vf_src(vf19).vf, c->vf_src(vf18).vf.x()); bc = (vis[vi08] != vis[vi06]); + // nop | madday.xyzw ACC, vf27, vf18 + c->acc.vf.madda_xyzw(c->vfs[vf27].vf, c->vfs[vf18].vf.y()); + if (bc) { goto L9; } + + // iaddiu vi01, vi00, 0x1ab | nop + vis[vi01] = 0x1ab; /* 427 */ + L9: + // nop | maddz.xyzw vf23, vf23, vf18 + c->acc.vf.madd_xyzw(c->vfs[vf23].vf, c->vf_src(vf23).vf, c->vf_src(vf18).vf.z()); + // mtir vi13, vf29.w | itof0.xyz vf18, vf29 + c->vfs[vf18].vf.itof0(Mask::xyz, c->vf_src(vf29).vf); vis[vi13] = c->vf_src(vf29).vf.w_as_u16(); + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; + L10: + // nop | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); + // BRANCH! + // ibne vi08, vi06, L11 | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); bc = (vis[vi08] != vis[vi06]); + // nop | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); + if (bc) { goto L11; } + + // iaddiu vi01, vi00, 0x1ab | nop + vis[vi01] = 0x1ab; /* 427 */ + L11: + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; +} + +void vcallms_311_case_427(ExecutionContext* c, u16* vis) { + // mtir vi11, vf01.x | maddz.xyzw vf11, vf26, vf10 + c->acc.vf.madd_xyzw(c->vfs[vf11].vf, c->vf_src(vf26).vf, c->vf_src(vf10).vf.z()); vis[vi11] = c->vf_src(vf01).vf.x_as_u16(); + // jr vi01 | mul.xyzw vf14, vf13, Q + c->vfs[vf14].vf.mul_xyzw(c->vf_src(vf13).vf, c->Q); + // sqi.xyzw vf04, vi08 | mulaw.xyzw ACC, vf20, vf08 + c->acc.vf.mula_xyzw(c->vf_src(vf20).vf, c->vf_src(vf08).vf.w()); sq_xyzw(c->vf_src(vf04).vf, vis[vi08]++); + c->acc.vf.madda_xyzw(c->vfs[vf21].vf, c->vfs[vf09].vf.w()); c->Q = c->vf_src(vf00).vf.w() / std::sqrt(c->vf_src(vf16).vf.x()); + // nop | maddaw.xyzw ACC, vf22, vf10 + c->acc.vf.madda_xyzw(c->vfs[vf22].vf, c->vfs[vf10].vf.w()); + // nop | maddw.xyzw vf15, vf23, vf00 + c->acc.vf.madd_xyzw(c->vfs[vf15].vf, c->vf_src(vf23).vf, c->vf_src(vf00).vf.w()); + // nop | mul.xyzw vf16, vf11, vf11 + c->vfs[vf16].vf.mul_xyzw(c->vf_src(vf11).vf, c->vf_src(vf11).vf); + // nop | add.xyzw vf08, vf01, vf05 + c->vfs[vf08].vf.add_xyzw(c->vf_src(vf01).vf, c->vf_src(vf05).vf); + // nop | add.xyzw vf09, vf02, vf06 + c->vfs[vf09].vf.add_xyzw(c->vf_src(vf02).vf, c->vf_src(vf06).vf); + // nop | add.xyzw vf10, vf03, vf07 + c->vfs[vf10].vf.add_xyzw(c->vf_src(vf03).vf, c->vf_src(vf07).vf); + // nop | adday.xyzw vf16, vf16 + c->acc.vf.adda(Mask::xyzw, c->vfs[vf16].vf, c->vfs[vf16].vf.y()); + // nop | maddz.xyzw vf16, vf17, vf16 + c->acc.vf.madd_xyzw(c->vfs[vf16].vf, c->vf_src(vf17).vf, c->vf_src(vf16).vf.z()); + // move.xyzw vf13, vf12 | mulaz.xyzw ACC, vf24, vf08 :e + c->acc.vf.mula_xyzw(c->vf_src(vf24).vf, c->vf_src(vf08).vf.z()); c->vfs[vf13].vf.move(Mask::xyzw, c->vf_src(vf12).vf); + // move.xyzw vf12, vf11 | maddaz.xyzw ACC, vf25, vf09 + c->acc.vf.madda_xyzw(c->vfs[vf25].vf, c->vfs[vf09].vf.z()); c->vfs[vf12].vf.move(Mask::xyzw, c->vf_src(vf11).vf); + return; +} + +void vcallms_311(ExecutionContext* c, u16* vis) { + switch(vis[vi01]) { + case 314: + vcallms_311_case_314(c, vis); + break; + case 326: + vcallms_311_case_326(c, vis); + break; + case 353: + vcallms_311_case_353(c, vis); + break; + case 386: + vcallms_311_case_386(c, vis); + break; + case 427: + vcallms_311_case_427(c, vis); + break; + default: + ASSERT_MSG(false, fmt::format("BAD JUMP {}", vis[vi01])); + } +} + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u16 vis[16]; + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->sq(s0, 7536, at); // sq s0, 7536(at) + c->sq(s1, 7552, at); // sq s1, 7552(at) + c->sq(s2, 7568, at); // sq s2, 7568(at) + c->sq(s3, 7584, at); // sq s3, 7584(at) + c->sq(s4, 7600, at); // sq s4, 7600(at) + c->sq(s5, 7616, at); // sq s5, 7616(at) + c->sq(s6, 7632, at); // sq s6, 7632(at) + c->sq(t8, 7648, at); // sq t8, 7648(at) + c->sq(t9, 7664, at); // sq t9, 7664(at) + c->sq(gp, 7680, at); // sq gp, 7680(at) + c->sq(sp, 7696, at); // sq sp, 7696(at) + c->sq(fp, 7712, at); // sq fp, 7712(at) + c->sq(ra, 7728, at); // sq ra, 7728(at) + // nop // sll r0, r0, 0 + get_fake_spad_addr2(t2, cache.fake_scratchpad_data, 0, c);// lui t2, 28672 + c->addiu(a0, r0, 0); // addiu a0, r0, 0 + c->lbu(a1, 6955, t2); // lbu a1, 6955(t2) + c->addiu(a2, r0, 4); // addiu a2, r0, 4 + c->lw(t0, 7444, t2); // lw t0, 7444(t2) + c->addiu(a3, r0, 1); // addiu a3, r0, 1 + c->lw(v1, 7448, t2); // lw v1, 7448(t2) + c->and_(a3, a1, a3); // and a3, a1, a3 + c->lw(a1, 24, t2); // lw a1, 24(t2) + c->movn(a0, a2, a3); // movn a0, a2, a3 + c->lbu(a3, 6855, t2); // lbu a3, 6855(t2) + c->daddu(t1, a0, t2); // daddu t1, a0, t2 + c->lbu(t3, 6852, t2); // lbu t3, 6852(t2) + c->daddiu(a2, a1, 128); // daddiu a2, a1, 128 + c->lw(a0, 7428, t2); // lw a0, 7428(t2) + c->dsll(t4, a3, 3); // dsll t4, a3, 3 + // nop // sll r0, r0, 0 + c->andi(t3, t3, 1); // andi t3, t3, 1 + c->lbu(a3, 10, t0); // lbu a3, 10(t0) + c->dsll(t5, t3, 1); // dsll t5, t3, 1 + c->lbu(t3, 9, t0); // lbu t3, 9(t0) + c->daddu(t1, t1, t5); // daddu t1, t1, t5 + // nop // sll r0, r0, 0 + c->daddu(t4, t1, t4); // daddu t4, t1, t4 + c->lbu(t1, 11953, t4); // lbu t1, 11953(t4) + // nop // sll r0, r0, 0 + c->lbu(t5, 11952, t4); // lbu t5, 11952(t4) + // nop // sll r0, r0, 0 + c->lw(t4, 7432, t2); // lw t4, 7432(t2) + c->sll(t6, a3, 4); // sll t6, a3, 4 + c->daddu(t5, t5, t2); // daddu t5, t5, t2 + c->daddu(t7, t1, t2); // daddu t7, t1, t2 + c->lw(a3, 7436, t2); // lw a3, 7436(t2) + c->daddu(t1, t6, t0); // daddu t1, t6, t0 + c->sw(t1, 7452, t2); // sw t1, 7452(t2) + // nop // sll r0, r0, 0 + c->lbu(t0, 12, t1); // lbu t0, 12(t1) + // nop // sll r0, r0, 0 + c->lq(t7, 11888, t7); // lq t7, 11888(t7) + // nop // sll r0, r0, 0 + c->lq(s0, 11888, t5); // lq s0, 11888(t5) + // nop // sll r0, r0, 0 + c->sq(t7, 96, a1); // sq t7, 96(a1) + c->daddiu(t5, v1, 5504); // daddiu t5, v1, 5504 + c->sq(s0, 112, a1); // sq s0, 112(a1) + c->daddiu(v1, v1, 6048); // daddiu v1, v1, 6048 + c->lbu(ra, 6857, t2); // lbu ra, 6857(t2) + c->movn(v1, t5, t3); // movn v1, t5, t3 + c->sw(r0, 124, a1); // sw r0, 124(a1) + // nop // sll r0, r0, 0 + c->lq(t7, 11744, t2); // lq t7, 11744(t2) + c->daddiu(t6, t1, 16); // daddiu t6, t1, 16 + c->lq(s0, 11808, t2); // lq s0, 11808(t2) + c->addiu(t9, r0, 0); // addiu t9, r0, 0 + c->lq(s4, 11824, t2); // lq s4, 11824(t2) + c->addiu(t5, r0, 0); // addiu t5, r0, 0 + c->lq(gp, 11840, t2); // lq gp, 11840(t2) + c->addiu(t1, r0, -3); // addiu t1, r0, -3 + c->lq(s5, 11856, t2); // lq s5, 11856(t2) + c->addiu(t8, r0, 6); // addiu t8, r0, 6 + c->lq(t2, 11872, t2); // lq t2, 11872(t2) + c->andi(s3, ra, 4); // andi s3, ra, 4 + c->sq(t7, 0, a1); // sq t7, 0(a1) + c->movz(t8, r0, t3); // movz t8, r0, t3 + c->sq(s0, 16, a1); // sq s0, 16(a1) + c->addiu(ra, r0, 0); // addiu ra, r0, 0 + c->sq(s4, 32, a1); // sq s4, 32(a1) + c->addiu(t7, r0, -32768); // addiu t7, r0, -32768 + c->sq(gp, 48, a1); // sq gp, 48(a1) + c->movz(ra, t7, t0); // movz ra, t7, t0 + c->sq(s5, 64, a1); // sq s5, 64(a1) + c->dsll(t7, s3, 18); // dsll t7, s3, 18 + c->pextlw(t7, t7, t7); // pextlw t7, t7, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + // Unknown instr: pnor t7, r0, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pand(t2, t2, t7); // pand t2, t2, t7 + c->mfc1(r0, f31); // mfc1 r0, f31 + bc = c->sgpr64(t3) == 0; // beq t3, r0, L87 + c->sq(t2, 80, a1); // sq t2, 80(a1) + if (bc) {goto block_4;} // branch non-likely + + c->lq(t7, 2944, t4); // lq t7, 2944(t4) + c->daddu(ra, t3, ra); // daddu ra, t3, ra + c->lq(s0, 2960, t4); // lq s0, 2960(t4) + c->addiu(gp, r0, -6); // addiu gp, r0, -6 + c->lq(t3, 2976, t4); // lq t3, 2976(t4) + c->daddiu(t0, t0, 1); // daddiu t0, t0, 1 + c->lq(t2, 2992, t4); // lq t2, 2992(t4) + c->daddiu(s5, t0, -3); // daddiu s5, t0, -3 + bc = ((s64)c->sgpr64(s5)) <= 0; // blez s5, L89 + c->lq(t4, 3008, t4); // lq t4, 3008(t4) + if (bc) {goto block_8;} // branch non-likely + + c->daddiu(t9, t0, -5); // daddiu t9, t0, -5 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t9)) <= 0; // blez t9, L89 + c->lh(t9, 172, t6); // lh t9, 172(t6) + if (bc) {goto block_8;} // branch non-likely + + //beq r0, r0, L89 // beq r0, r0, L89 + c->lh(t5, 332, t6); // lh t5, 332(t6) + goto block_8; // branch always + + +block_4: + c->daddiu(t2, t0, -3); // daddiu t2, t0, -3 + // nop // sll r0, r0, 0 + bc = ((s64)c->sgpr64(t2)) <= 0; // blez t2, L88 + c->daddiu(t2, t0, -5); // daddiu t2, t0, -5 + if (bc) {goto block_7;} // branch non-likely + + bc = ((s64)c->sgpr64(t2)) <= 0; // blez t2, L88 + c->lh(t9, 252, t6); // lh t9, 252(t6) + if (bc) {goto block_7;} // branch non-likely + + // nop // sll r0, r0, 0 + c->lh(t5, 412, t6); // lh t5, 412(t6) + +block_7: + c->lh(gp, 12, t6); // lh gp, 12(t6) + // nop // sll r0, r0, 0 + c->lh(ra, 28, t6); // lh ra, 28(t6) + // nop // sll r0, r0, 0 + c->lq(t7, 0, t6); // lq t7, 0(t6) + // nop // sll r0, r0, 0 + c->lq(s0, 16, t6); // lq s0, 16(t6) + // nop // sll r0, r0, 0 + c->lq(t3, 32, t6); // lq t3, 32(t6) + // nop // sll r0, r0, 0 + c->lq(t2, 48, t6); // lq t2, 48(t6) + // nop // sll r0, r0, 0 + c->lq(t4, 64, t6); // lq t4, 64(t6) + c->daddiu(t6, t6, 80); // daddiu t6, t6, 80 + +block_8: + c->sq(t7, 0, a2); // sq t7, 0(a2) + c->daddu(gp, gp, t8); // daddu gp, gp, t8 + c->sq(s0, 16, a2); // sq s0, 16(a2) + c->daddiu(t8, t8, 2); // daddiu t8, t8, 2 + c->sq(t3, 32, a2); // sq t3, 32(a2) + c->daddu(t1, t1, ra); // daddu t1, t1, ra + c->sq(t2, 48, a2); // sq t2, 48(a2) + c->daddiu(t1, t1, 3); // daddiu t1, t1, 3 + c->sq(t4, 64, a2); // sq t4, 64(a2) + c->andi(t1, t1, 255); // andi t1, t1, 255 + c->sw(gp, 12, a2); // sw gp, 12(a2) + c->daddiu(a2, a2, 80); // daddiu a2, a2, 80 + bc = ((s64)c->sgpr64(ra)) > 0; // bgtz ra, L88 + c->sw(ra, -52, a2); // sw ra, -52(a2) + if (bc) {goto block_7;} // branch non-likely + + c->sw(t1, 108, a1); // sw t1, 108(a1) + c->daddiu(a1, t9, 7); // daddiu a1, t9, 7 + c->sq(t7, 2944, a0); // sq t7, 2944(a0) + c->daddiu(t5, t5, 7); // daddiu t5, t5, 7 + c->sq(s0, 2960, a0); // sq s0, 2960(a0) + c->sra(a2, a1, 4); // sra a2, a1, 4 + c->sq(t3, 2976, a0); // sq t3, 2976(a0) + c->sra(t3, t5, 4); // sra t3, t5, 4 + c->sq(t2, 2992, a0); // sq t2, 2992(a0) + c->daddiu(a1, a3, 192); // daddiu a1, a3, 192 + c->sq(t4, 3008, a0); // sq t4, 3008(a0) + c->dsll(a0, t0, 2); // dsll a0, t0, 2 + c->sh(t1, 18, a3); // sh t1, 18(a3) + c->daddu(a0, a0, t0); // daddu a0, a0, t0 + c->sb(t0, 16, a3); // sb t0, 16(a3) + c->daddiu(a0, a0, 7); // daddiu a0, a0, 7 + c->dsubu(a0, t3, a2); // dsubu a0, t3, a2 + c->lq(t0, 0, v1); // lq t0, 0(v1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(t1, a2, -3); // daddiu t1, a2, -3 + c->lq(a3, 16, v1); // lq a3, 16(v1) + // nop // sll r0, r0, 0 + c->sq(t0, 0, a1); // sq t0, 0(a1) + bc = c->sgpr64(t1) == 0; // beq t1, r0, L90 + c->lq(a2, 32, v1); // lq a2, 32(v1) + if (bc) {goto block_21;} // branch non-likely + + c->daddiu(t0, t1, -1); // daddiu t0, t1, -1 + c->sq(a3, 16, a1); // sq a3, 16(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L91 + c->lq(a3, 48, v1); // lq a3, 48(v1) + if (bc) {goto block_22;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a2, 32, a1); // sq a2, 32(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L92 + c->lq(a2, 64, v1); // lq a2, 64(v1) + if (bc) {goto block_23;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a3, 48, a1); // sq a3, 48(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L93 + c->lq(a3, 80, v1); // lq a3, 80(v1) + if (bc) {goto block_24;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a2, 64, a1); // sq a2, 64(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L94 + c->lq(a2, 96, v1); // lq a2, 96(v1) + if (bc) {goto block_25;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a3, 80, a1); // sq a3, 80(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L95 + c->lq(a3, 112, v1); // lq a3, 112(v1) + if (bc) {goto block_26;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a2, 96, a1); // sq a2, 96(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L96 + c->lq(a2, 128, v1); // lq a2, 128(v1) + if (bc) {goto block_27;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a3, 112, a1); // sq a3, 112(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L97 + c->lq(a3, 144, v1); // lq a3, 144(v1) + if (bc) {goto block_28;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a2, 128, a1); // sq a2, 128(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L98 + c->lq(a2, 160, v1); // lq a2, 160(v1) + if (bc) {goto block_29;} // branch non-likely + + c->daddiu(t0, t0, -1); // daddiu t0, t0, -1 + c->sq(a3, 144, a1); // sq a3, 144(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L99 + c->lq(a3, 176, v1); // lq a3, 176(v1) + if (bc) {goto block_30;} // branch non-likely + + c->daddiu(a0, t0, -1); // daddiu a0, t0, -1 + c->sq(a2, 160, a1); // sq a2, 160(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L100 + c->lq(a0, 192, v1); // lq a0, 192(v1) + if (bc) {goto block_31;} // branch non-likely + + // nop // sll r0, r0, 0 + c->sq(a3, 176, a1); // sq a3, 176(a1) + // nop // sll r0, r0, 0 + c->lq(v1, 208, v1); // lq v1, 208(v1) + // nop // sll r0, r0, 0 + c->sq(a0, 192, a1); // sq a0, 192(a1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sq(v1, 208, a1); // sq v1, 208(a1) + //beq r0, r0, L110 // beq r0, r0, L110 + // nop // sll r0, r0, 0 + goto block_41; // branch always + + +block_21: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, 16, a1); // sq a3, 16(a1) + // nop // sll r0, r0, 0 + c->lq(a3, 224, v1); // lq a3, 224(v1) + +block_22: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a2, 32, a1); // sq a2, 32(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L101 + c->lq(a2, 240, v1); // lq a2, 240(v1) + if (bc) {goto block_32;} // branch non-likely + + +block_23: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, 48, a1); // sq a3, 48(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L102 + c->lq(a3, 256, v1); // lq a3, 256(v1) + if (bc) {goto block_33;} // branch non-likely + + +block_24: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a2, 64, a1); // sq a2, 64(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L103 + c->lq(a2, 272, v1); // lq a2, 272(v1) + if (bc) {goto block_34;} // branch non-likely + + +block_25: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, 80, a1); // sq a3, 80(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L104 + c->lq(a3, 288, v1); // lq a3, 288(v1) + if (bc) {goto block_35;} // branch non-likely + + +block_26: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a2, 96, a1); // sq a2, 96(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L105 + c->lq(a2, 304, v1); // lq a2, 304(v1) + if (bc) {goto block_36;} // branch non-likely + + +block_27: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, 112, a1); // sq a3, 112(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L106 + c->lq(a3, 320, v1); // lq a3, 320(v1) + if (bc) {goto block_37;} // branch non-likely + + +block_28: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a2, 128, a1); // sq a2, 128(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L107 + c->lq(a2, 336, v1); // lq a2, 336(v1) + if (bc) {goto block_38;} // branch non-likely + + +block_29: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, 144, a1); // sq a3, 144(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L108 + c->lq(a3, 352, v1); // lq a3, 352(v1) + if (bc) {goto block_39;} // branch non-likely + + +block_30: + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a2, 160, a1); // sq a2, 160(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L109 + c->lq(a0, 368, v1); // lq a0, 368(v1) + if (bc) {goto block_40;} // branch non-likely + + +block_31: + // nop // sll r0, r0, 0 + c->sq(a3, 176, a1); // sq a3, 176(a1) + // nop // sll r0, r0, 0 + c->lq(v1, 384, v1); // lq v1, 384(v1) + // nop // sll r0, r0, 0 + c->sq(a0, 192, a1); // sq a0, 192(a1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sq(v1, 208, a1); // sq v1, 208(a1) + //beq r0, r0, L110 // beq r0, r0, L110 + // nop // sll r0, r0, 0 + goto block_41; // branch always + + +block_32: + // nop // sll r0, r0, 0 + c->sq(a3, 48, a1); // sq a3, 48(a1) + // nop // sll r0, r0, 0 + c->lq(a3, 400, v1); // lq a3, 400(v1) + +block_33: + // nop // sll r0, r0, 0 + c->sq(a2, 64, a1); // sq a2, 64(a1) + // nop // sll r0, r0, 0 + c->lq(a2, 416, v1); // lq a2, 416(v1) + +block_34: + // nop // sll r0, r0, 0 + c->sq(a3, 80, a1); // sq a3, 80(a1) + // nop // sll r0, r0, 0 + c->lq(a3, 432, v1); // lq a3, 432(v1) + +block_35: + // nop // sll r0, r0, 0 + c->sq(a2, 96, a1); // sq a2, 96(a1) + // nop // sll r0, r0, 0 + c->lq(a2, 448, v1); // lq a2, 448(v1) + +block_36: + // nop // sll r0, r0, 0 + c->sq(a3, 112, a1); // sq a3, 112(a1) + // nop // sll r0, r0, 0 + c->lq(a3, 464, v1); // lq a3, 464(v1) + +block_37: + // nop // sll r0, r0, 0 + c->sq(a2, 128, a1); // sq a2, 128(a1) + // nop // sll r0, r0, 0 + c->lq(a2, 480, v1); // lq a2, 480(v1) + +block_38: + // nop // sll r0, r0, 0 + c->sq(a3, 144, a1); // sq a3, 144(a1) + // nop // sll r0, r0, 0 + c->lq(a3, 496, v1); // lq a3, 496(v1) + +block_39: + // nop // sll r0, r0, 0 + c->sq(a2, 160, a1); // sq a2, 160(a1) + // nop // sll r0, r0, 0 + c->lq(a0, 512, v1); // lq a0, 512(v1) + +block_40: + // nop // sll r0, r0, 0 + c->sq(a3, 176, a1); // sq a3, 176(a1) + // nop // sll r0, r0, 0 + c->lq(v1, 528, v1); // lq v1, 528(v1) + // nop // sll r0, r0, 0 + c->sq(a0, 192, a1); // sq a0, 192(a1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sq(v1, 208, a1); // sq v1, 208(a1) + +block_41: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + // nop // sll r0, r0, 0 + c->lw(a1, 7452, v1); // lw a1, 7452(v1) + // nop // sll r0, r0, 0 + c->lw(a0, 7436, v1); // lw a0, 7436(v1) + // nop // sll r0, r0, 0 + c->lbu(a2, 13, a1); // lbu a2, 13(a1) + // nop // sll r0, r0, 0 + c->lbu(v1, 14, a1); // lbu v1, 14(a1) + c->daddiu(a0, a0, 32); // daddiu a0, a0, 32 + c->lbu(a3, 15, a1); // lbu a3, 15(a1) + c->daddu(a1, a1, a2); // daddu a1, a1, a2 + c->mult3(a3, v1, a3); // mult3 a3, v1, a3 + c->mov64(a1, a1); // or a1, a1, r0 + c->mov64(v1, v1); // or v1, v1, r0 + c->mov64(a0, a0); // or a0, a0, r0 + c->addiu(a2, r0, 513); // addiu a2, r0, 513 + c->addiu(t0, r0, 257); // addiu t0, r0, 257 + c->dsll(t2, a2, 18); // dsll t2, a2, 18 + c->dsll(t1, t0, 16); // dsll t1, t0, 16 + c->or_(a2, a2, t2); // or a2, a2, t2 + c->or_(t0, t0, t1); // or t0, t0, t1 + c->dsll32(t2, a2, 4); // dsll32 t2, a2, 4 + c->dsll32(t1, t0, 0); // dsll32 t1, t0, 0 + c->or_(a2, a2, t2); // or a2, a2, t2 + c->or_(t0, t0, t1); // or t0, t0, t1 + c->pcpyld(a2, a2, a2); // pcpyld a2, a2, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyld(t0, t0, t0); // pcpyld t0, t0, t0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->daddu(a3, a3, a1); // daddu a3, a3, a1 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->lhu(t1, 0, a1); // lhu t1, 0(a1) + c->daddu(a1, a1, v1); // daddu a1, a1, v1 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + // nop // sll r0, r0, 0 + c->pextlb(t1, t1, t1); // pextlb t1, t1, t1 + //beq r0, r0, L112 // beq r0, r0, L112 + c->pextlb(t2, t1, t1); // pextlb t2, t1, t1 + goto block_43; // branch always + + +block_42: + c->daddu(a1, a1, v1); // daddu a1, a1, v1 + c->daddiu(a0, a0, 32); // daddiu a0, a0, 32 + c->pextlb(t2, t2, t2); // pextlb t2, t2, t2 + c->sq(t1, -16, a0); // sq t1, -16(a0) + +block_43: + c->pextlb(t1, t2, t2); // pextlb t1, t2, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pand(t1, t1, a2); // pand t1, t1, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pceqb(t1, t1, a2); // pceqb t1, t1, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pand(t1, t1, t0); // pand t1, t1, t0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t2, t1, r0); // pextlb t2, t1, r0 + c->lhu(t3, 0, a1); // lhu t3, 0(a1) + c->pextub(t1, t1, r0); // pextub t1, t1, r0 + c->sq(t2, 0, a0); // sq t2, 0(a0) + bc = c->sgpr64(a1) != c->sgpr64(a3); // bne a1, a3, L111 + c->pextlb(t2, t3, t3); // pextlb t2, t3, t3 + if (bc) {goto block_42;} // branch non-likely + + // nop // sll r0, r0, 0 + c->sq(t1, 16, a0); // sq t1, 16(a0) + get_fake_spad_addr2(s4, cache.fake_scratchpad_data, 0, c);// lui s4, 28672 + // nop // sll r0, r0, 0 + c->lw(a0, 7444, s4); // lw a0, 7444(s4) + // nop // sll r0, r0, 0 + c->lw(a1, 7436, s4); // lw a1, 7436(s4) + // nop // sll r0, r0, 0 + c->lq(t8, 16, a0); // lq t8, 16(a0) + c->daddiu(s6, a0, 48); // daddiu s6, a0, 48 + c->lbu(a3, 12, a0); // lbu a3, 12(a0) + // nop // sll r0, r0, 0 + c->lbu(t2, 10, a0); // lbu t2, 10(a0) + c->pextlb(t9, r0, t8); // pextlb t9, r0, t8 + vis[10] = c->gpr_src(a3).du16[0]; // ctc2.ni vi10, a3 + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + c->mov128_vf_gpr(vf1, gp); // qmtc2.ni vf1, gp + c->pextuh(t9, r0, t9); // pextuh t9, r0, t9 + c->mov128_vf_gpr(vf2, t9); // qmtc2.ni vf2, t9 + c->pextub(t9, r0, t8); // pextub t9, r0, t8 + c->lbu(a3, 4, a0); // lbu a3, 4(a0) + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + c->mov128_vf_gpr(vf3, gp); // qmtc2.ni vf3, gp + c->pextuh(t9, r0, t9); // pextuh t9, r0, t9 + c->mov128_vf_gpr(vf4, t9); // qmtc2.ni vf4, t9 + c->sll(t2, t2, 4); // sll t2, t2, 4 + c->lbu(t0, 5, a0); // lbu t0, 5(a0) + c->daddu(t2, t2, a0); // daddu t2, t2, a0 + c->lbu(t1, 6, a0); // lbu t1, 6(a0) + c->daddiu(s5, a3, -1); // daddiu s5, a3, -1 + vis[11] = c->gpr_src(a3).du16[0]; // ctc2.ni vi11, a3 + c->daddu(s5, s5, t0); // daddu s5, s5, t0 + vis[12] = c->gpr_src(t0).du16[0]; // ctc2.ni vi12, t0 + c->daddu(s5, s5, t1); // daddu s5, s5, t1 + vis[13] = c->gpr_src(t1).du16[0]; // ctc2.ni vi13, t1 + c->daddiu(t4, a1, 32); // daddiu t4, a1, 32 + c->lqc2(vf27, 0, t2); // lqc2 vf27, 0(t2) + c->daddiu(t3, a1, 192); // daddiu t3, a1, 192 + // Unknown instr: vcallms 280 + vcallms_280(c, vis); + c->daddiu(v1, a1, 448); // daddiu v1, a1, 448 + c->lhu(s1, 6820, s4); // lhu s1, 6820(s4) + c->pextlw(t3, t3, t3); // pextlw t3, t3, t3 + c->lhu(s2, 6822, s4); // lhu s2, 6822(s4) + c->pcpyld(t3, t3, t3); // pcpyld t3, t3, t3 + c->lqc2(vf19, 6800, s4); // lqc2 vf19, 6800(s4) + c->pcpyh(s1, s1); // pcpyh s1, s1 + c->lbu(v0, 2, a0); // lbu v0, 2(a0) + c->addiu(t5, r0, 0); // addiu t5, r0, 0 + c->lbu(at, 1, a0); // lbu at, 1(a0) + c->addiu(s4, r0, -1); // addiu s4, r0, -1 + c->lui(a1, 19201); // lui a1, 19201 + c->daddiu(v0, v0, 3); // daddiu v0, v0, 3 + c->daddiu(a1, a1, 18304); // daddiu a1, a1, 18304 + c->andi(v0, v0, 252); // andi v0, v0, 252 + c->sll(at, at, 2); // sll at, at, 2 + c->sll(v0, v0, 2); // sll v0, v0, 2 + c->lq(t8, 32, a0); // lq t8, 32(a0) + c->daddu(v0, v0, a0); // daddu v0, v0, a0 + c->lbu(t0, 13, a0); // lbu t0, 13(a0) + c->daddu(at, at, a0); // daddu at, at, a0 + c->lbu(t2, 11, a0); // lbu t2, 11(a0) + c->pextlw(a1, a1, r0); // pextlw a1, a1, r0 + bc = c->sgpr64(t0) == 0; // beq t0, r0, L115 + c->pcpyld(a1, a1, a1); // pcpyld a1, a1, a1 + if (bc) {goto block_49;} // branch non-likely + + c->sll(t2, t2, 4); // sll t2, t2, 4 + c->daddiu(a3, a0, 14); // daddiu a3, a0, 14 + //beq r0, r0, L114 // beq r0, r0, L114 + c->daddu(t2, t2, a0); // daddu t2, t2, a0 + goto block_47; // branch always + + +block_46: + // Unknown instr: vcallms 303 + vcallms_303(c, vis); + c->mov64(t0, t1); // or t0, t1, r0 + +block_47: + c->lbu(t1, 0, a3); // lbu t1, 0(a3) + c->daddiu(a3, a3, 1); // daddiu a3, a3, 1 + c->lqc2(vf23, 64, t2); // lqc2 vf23, 64(t2) + // nop // sll r0, r0, 0 + c->lqc2(vf24, 80, t2); // lqc2 vf24, 80(t2) + // nop // sll r0, r0, 0 + c->lqc2(vf25, 96, t2); // lqc2 vf25, 96(t2) + // nop // sll r0, r0, 0 + c->lqc2(vf26, 112, t2); // lqc2 vf26, 112(t2) + // nop // sll r0, r0, 0 + c->lqc2(vf20, 16, t2); // lqc2 vf20, 16(t2) + // nop // sll r0, r0, 0 + c->lqc2(vf21, 32, t2); // lqc2 vf21, 32(t2) + // nop // sll r0, r0, 0 + c->lqc2(vf22, 48, t2); // lqc2 vf22, 48(t2) + c->daddiu(t2, t2, 128); // daddiu t2, t2, 128 + bc = c->sgpr64(t1) != 0; // bne t1, r0, L113 + vis[14] = c->gpr_src(t0).du16[0]; // ctc2.ni vi14, t0 + if (bc) {goto block_46;} // branch non-likely + + // Unknown instr: vcallms 303 + vcallms_303(c, vis); + // nop // sll r0, r0, 0 + +block_49: + c->lq(a2, 0, v0); // lq a2, 0(v0) + c->pextlb(t9, r0, t8); // pextlb t9, r0, t8 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(a3, r0, a2); // pextlb a3, r0, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextub(a2, r0, a2); // pextub a2, r0, a2 + c->mov128_vf_gpr(vf4, gp); // qmtc2.ni vf4, gp + c->pextlh(t0, a1, a3); // pextlh t0, a1, a3 + c->mov128_vf_gpr(vf1, t0); // qmtc2.ni vf1, t0 + c->pextuh(a3, a1, a3); // pextuh a3, a1, a3 + c->mov128_vf_gpr(vf2, a3); // qmtc2.ni vf2, a3 + c->pextlh(t1, a1, a2); // pextlh t1, a1, a2 + c->mov128_vf_gpr(vf3, t1); // qmtc2.ni vf3, t1 + c->pextuh(t9, r0, t9); // pextuh t9, r0, t9 + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lq(t2, 16, v0); // lq t2, 16(v0) + // nop // sll r0, r0, 0 + c->daddiu(at, at, -16); // daddiu at, at, -16 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuh(a2, a1, a2); // pextuh a2, a1, a2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t0, r0, t2); // pextlb t0, r0, t2 + c->mov128_vf_gpr(vf4, t9); // qmtc2.ni vf4, t9 + c->pextlh(t1, a1, t0); // pextlh t1, a1, t0 + c->mov128_vf_gpr(vf1, a2); // qmtc2.ni vf1, a2 + c->pextuh(t0, a1, t0); // pextuh t0, a1, t0 + c->mov128_vf_gpr(vf2, t1); // qmtc2.ni vf2, t1 + c->pextub(t9, r0, t8); // pextub t9, r0, t8 + c->mov128_vf_gpr(vf3, t0); // qmtc2.ni vf3, t0 + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + // nop // sll r0, r0, 0 + c->daddiu(v0, v0, -48); // daddiu v0, v0, -48 + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + // nop // sll r0, r0, 0 + c->addiu(t6, r0, 0); // addiu t6, r0, 0 + // nop // sll r0, r0, 0 + c->lwl(t6, 53, v0); // lwl t6, 53(v0) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->lq(a3, 80, v0); // lq a3, 80(v0) + c->paddw(t6, t6, t3); // paddw t6, t6, t3 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextub(t2, r0, t2); // pextub t2, r0, t2 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlh(t0, a1, t2); // pextlh t0, a1, t2 + c->mov128_vf_gpr(vf4, gp); // qmtc2.ni vf4, gp + c->pextuh(t2, a1, t2); // pextuh t2, a1, t2 + c->mov128_vf_gpr(vf1, t0); // qmtc2.ni vf1, t0 + c->pextlb(t1, r0, a3); // pextlb t1, r0, a3 + c->mov128_vf_gpr(vf2, t2); // qmtc2.ni vf2, t2 + c->pextlh(a2, a1, t1); // pextlh a2, a1, t1 + c->mov128_vf_gpr(vf3, a2); // qmtc2.ni vf3, a2 + c->pextuh(t9, r0, t9); // pextuh t9, r0, t9 + // nop // sll r0, r0, 0 + c->daddiu(v1, v1, -64); // daddiu v1, v1, -64 + // nop // sll r0, r0, 0 + c->sqc2(vf15, 64, v1); // sqc2 vf15, 64(v1) + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + // nop // sll r0, r0, 0 + c->lwr(s3, 56, v0); // lwr s3, 56(v0) + // nop // sll r0, r0, 0 + c->lwl(s3, 69, v0); // lwl s3, 69(v0) + // nop // sll r0, r0, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pcpyud(t6, t6, r0); // pcpyud t6, t6, r0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextlb(s3, r0, s3); // pextlb s3, r0, s3 + // nop // sll r0, r0, 0 + c->dsllv(s3, s3, s2); // dsllv s3, s3, s2 + c->lq(t8, 0, s6); // lq t8, 0(s6) + c->paddh(s3, s3, s1); // paddh s3, s3, s1 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + c->dsrl32(t6, t6, 0); // dsrl32 t6, t6, 0 + c->mfc1(r0, f31); // mfc1 r0, f31 + c->pextuh(t0, a1, t1); // pextuh t0, a1, t1 + c->lbu(s0, 0, t6); // lbu s0, 0(t6) + c->pextub(a3, r0, a3); // pextub a3, r0, a3 + c->mov128_vf_gpr(vf4, t9); // qmtc2.ni vf4, t9 + c->pextlh(t2, a1, a3); // pextlh t2, a1, a3 + c->mov128_vf_gpr(vf1, t0); // qmtc2.ni vf1, t0 + c->pextuh(a3, a1, a3); // pextuh a3, a1, a3 + c->mov128_vf_gpr(vf2, t2); // qmtc2.ni vf2, t2 + c->pextlb(t9, r0, t8); // pextlb t9, r0, t8 + c->mov128_vf_gpr(vf3, a3); // qmtc2.ni vf3, a3 + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + // nop // sll r0, r0, 0 + c->daddiu(s6, s6, 16); // daddiu s6, s6, 16 + // nop // sll r0, r0, 0 + c->sqc2(vf15, 96, v1); // sqc2 vf15, 96(v1) + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + c->sw(s3, 76, v1); // sw s3, 76(v1) + c->lwr(t6, 64, v0); // lwr t6, 64(v0) + c->daddu(t7, t7, t4); // daddu t7, t7, t4 + c->lwl(t6, 77, v0); // lwl t6, 77(v0) + c->daddu(s0, s0, t4); // daddu s0, s0, t4 + //beq r0, r0, L117 // beq r0, r0, L117 + c->dsrl32(s3, s3, 0); // dsrl32 s3, s3, 0 + goto block_51; // branch always + + +block_50: + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + c->sw(s3, 76, v1); // sw s3, 76(v1) + c->lwr(t6, 64, v0); // lwr t6, 64(v0) + c->daddu(t7, t7, t4); // daddu t7, t7, t4 + c->lwl(t6, 77, v0); // lwl t6, 77(v0) + c->daddu(s0, s0, t4); // daddu s0, s0, t4 + c->sw(a0, 60, v1); // sw a0, 60(v1) + c->dsrl32(s3, s3, 0); // dsrl32 s3, s3, 0 + +block_51: + c->sb(t5, 0, t7); // sb t5, 0(t7) + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->sb(t5, 0, s0); // sb t5, 0(s0) + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->lq(a2, 96, v0); // lq a2, 96(v0) + c->paddw(t6, t6, t3); // paddw t6, t6, t3 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + c->dsrl32(t6, t6, 0); // dsrl32 t6, t6, 0 + c->lw(a0, 16, at); // lw a0, 16(at) + c->pextlb(a3, r0, a2); // pextlb a3, r0, a2 + c->lbu(s0, 0, t6); // lbu s0, 0(t6) + c->pextub(a2, r0, a2); // pextub a2, r0, a2 + c->mov128_vf_gpr(vf4, gp); // qmtc2.ni vf4, gp + c->pextlh(t0, a1, a3); // pextlh t0, a1, a3 + c->mov128_vf_gpr(vf1, t0); // qmtc2.ni vf1, t0 + c->pextuh(a3, a1, a3); // pextuh a3, a1, a3 + c->mov128_vf_gpr(vf2, a3); // qmtc2.ni vf2, a3 + c->pextlh(t1, a1, a2); // pextlh t1, a1, a2 + c->mov128_vf_gpr(vf3, t1); // qmtc2.ni vf3, t1 + c->pextuh(t9, r0, t9); // pextuh t9, r0, t9 + c->sqc2(vf14, 80, v1); // sqc2 vf14, 80(v1) + c->daddiu(at, at, 16); // daddiu at, at, 16 + c->addiu(s4, s4, 2); // addiu s4, s4, 2 + c->sqc2(vf15, 128, v1); // sqc2 vf15, 128(v1) + bc = c->sgpr64(t5) == c->sgpr64(s5); // beq t5, s5, L118 + c->daddiu(t5, t5, 2); // daddiu t5, t5, 2 + if (bc) {goto block_56;} // branch non-likely + + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + c->sw(s3, 108, v1); // sw s3, 108(v1) + c->lwr(s3, 80, v0); // lwr s3, 80(v0) + c->daddu(t7, t7, t4); // daddu t7, t7, t4 + c->lwl(s3, 93, v0); // lwl s3, 93(v0) + c->daddu(s0, s0, t4); // daddu s0, s0, t4 + c->sw(a0, 92, v1); // sw a0, 92(v1) + c->pcpyud(t6, t6, r0); // pcpyud t6, t6, r0 + c->sb(s4, 0, t7); // sb s4, 0(t7) + c->pextlb(s3, r0, s3); // pextlb s3, r0, s3 + c->sb(s4, 0, s0); // sb s4, 0(s0) + c->dsllv(s3, s3, s2); // dsllv s3, s3, s2 + c->lq(t2, 112, v0); // lq t2, 112(v0) + c->paddh(s3, s3, s1); // paddh s3, s3, s1 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + c->dsrl32(t6, t6, 0); // dsrl32 t6, t6, 0 + c->lw(a0, 4, at); // lw a0, 4(at) + c->pextuh(a2, a1, a2); // pextuh a2, a1, a2 + c->lbu(s0, 0, t6); // lbu s0, 0(t6) + c->pextlb(t0, r0, t2); // pextlb t0, r0, t2 + c->mov128_vf_gpr(vf4, t9); // qmtc2.ni vf4, t9 + c->pextlh(t1, a1, t0); // pextlh t1, a1, t0 + c->mov128_vf_gpr(vf1, a2); // qmtc2.ni vf1, a2 + c->pextuh(t0, a1, t0); // pextuh t0, a1, t0 + c->mov128_vf_gpr(vf2, t1); // qmtc2.ni vf2, t1 + c->pextub(t9, r0, t8); // pextub t9, r0, t8 + c->mov128_vf_gpr(vf3, t0); // qmtc2.ni vf3, t0 + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + c->sqc2(vf14, 112, v1); // sqc2 vf14, 112(v1) + c->daddiu(v0, v0, 48); // daddiu v0, v0, 48 + bc = c->sgpr64(s4) == c->sgpr64(s5); // beq s4, s5, L119 + c->sqc2(vf15, 160, v1); // sqc2 vf15, 160(v1) + if (bc) {goto block_57;} // branch non-likely + + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + c->sw(s3, 140, v1); // sw s3, 140(v1) + c->lwr(t6, 40, v0); // lwr t6, 40(v0) + c->daddu(t7, t7, t4); // daddu t7, t7, t4 + c->lwl(t6, 53, v0); // lwl t6, 53(v0) + c->daddu(s0, s0, t4); // daddu s0, s0, t4 + c->sw(a0, 124, v1); // sw a0, 124(v1) + c->dsrl32(s3, s3, 0); // dsrl32 s3, s3, 0 + c->sb(t5, 0, t7); // sb t5, 0(t7) + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->sb(t5, 0, s0); // sb t5, 0(s0) + c->pextlb(t6, r0, t6); // pextlb t6, r0, t6 + c->lq(a3, 80, v0); // lq a3, 80(v0) + c->paddw(t6, t6, t3); // paddw t6, t6, t3 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + c->dsrl32(t6, t6, 0); // dsrl32 t6, t6, 0 + c->lw(a0, 8, at); // lw a0, 8(at) + c->pextub(t2, r0, t2); // pextub t2, r0, t2 + c->lbu(s0, 0, t6); // lbu s0, 0(t6) + c->pextlh(t0, a1, t2); // pextlh t0, a1, t2 + c->mov128_vf_gpr(vf4, gp); // qmtc2.ni vf4, gp + c->pextuh(t2, a1, t2); // pextuh t2, a1, t2 + c->mov128_vf_gpr(vf1, t0); // qmtc2.ni vf1, t0 + c->pextlb(t1, r0, a3); // pextlb t1, r0, a3 + c->mov128_vf_gpr(vf2, t2); // qmtc2.ni vf2, t2 + c->pextlh(a2, a1, t1); // pextlh a2, a1, t1 + c->mov128_vf_gpr(vf3, a2); // qmtc2.ni vf3, a2 + c->pextuh(t9, r0, t9); // pextuh t9, r0, t9 + c->sqc2(vf14, 144, v1); // sqc2 vf14, 144(v1) + c->daddiu(v1, v1, 128); // daddiu v1, v1, 128 + c->addiu(s4, s4, 2); // addiu s4, s4, 2 + c->sqc2(vf15, 64, v1); // sqc2 vf15, 64(v1) + bc = c->sgpr64(t5) == c->sgpr64(s5); // beq t5, s5, L120 + c->daddiu(t5, t5, 2); // daddiu t5, t5, 2 + if (bc) {goto block_58;} // branch non-likely + + // Unknown instr: vcallms 311 + vcallms_311(c, vis); + c->sw(s3, 44, v1); // sw s3, 44(v1) + c->lwr(s3, 56, v0); // lwr s3, 56(v0) + c->daddu(t7, t7, t4); // daddu t7, t7, t4 + c->lwl(s3, 69, v0); // lwl s3, 69(v0) + c->daddu(s0, s0, t4); // daddu s0, s0, t4 + c->sw(a0, 28, v1); // sw a0, 28(v1) + c->pcpyud(t6, t6, r0); // pcpyud t6, t6, r0 + c->sb(s4, 0, t7); // sb s4, 0(t7) + c->pextlb(s3, r0, s3); // pextlb s3, r0, s3 + c->sb(s4, 0, s0); // sb s4, 0(s0) + c->dsllv(s3, s3, s2); // dsllv s3, s3, s2 + c->lq(t8, 0, s6); // lq t8, 0(s6) + c->paddh(s3, s3, s1); // paddh s3, s3, s1 + c->lbu(t7, 0, t6); // lbu t7, 0(t6) + c->dsrl32(t6, t6, 0); // dsrl32 t6, t6, 0 + c->lw(a0, 12, at); // lw a0, 12(at) + c->pextuh(t0, a1, t1); // pextuh t0, a1, t1 + c->lbu(s0, 0, t6); // lbu s0, 0(t6) + c->pextub(a3, r0, a3); // pextub a3, r0, a3 + c->mov128_vf_gpr(vf4, t9); // qmtc2.ni vf4, t9 + c->pextlh(t2, a1, a3); // pextlh t2, a1, a3 + c->mov128_vf_gpr(vf1, t0); // qmtc2.ni vf1, t0 + c->pextuh(a3, a1, a3); // pextuh a3, a1, a3 + c->mov128_vf_gpr(vf2, t2); // qmtc2.ni vf2, t2 + c->pextlb(t9, r0, t8); // pextlb t9, r0, t8 + c->mov128_vf_gpr(vf3, a3); // qmtc2.ni vf3, a3 + c->pextlh(gp, r0, t9); // pextlh gp, r0, t9 + c->sqc2(vf14, 48, v1); // sqc2 vf14, 48(v1) + c->daddiu(s6, s6, 16); // daddiu s6, s6, 16 + bc = c->sgpr64(s4) != c->sgpr64(s5); // bne s4, s5, L116 + c->sqc2(vf15, 96, v1); // sqc2 vf15, 96(v1) + if (bc) {goto block_50;} // branch non-likely + + //beq r0, r0, L120 // beq r0, r0, L120 + c->daddiu(v1, v1, 32); // daddiu v1, v1, 32 + goto block_58; // branch always + + +block_56: + //beq r0, r0, L120 // beq r0, r0, L120 + c->daddiu(v1, v1, 64); // daddiu v1, v1, 64 + goto block_58; // branch always + + +block_57: + //beq r0, r0, L120 // beq r0, r0, L120 + c->daddiu(v1, v1, 96); // daddiu v1, v1, 96 + goto block_58; // branch always + + +block_58: + c->sw(a0, 28, v1); // sw a0, 28(v1) + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + c->daddiu(v1, v1, 32); // daddiu v1, v1, 32 + // nop // sll r0, r0, 0 + get_fake_spad_addr2(a3, cache.fake_scratchpad_data, 0, c);// lui a3, 28672 + // nop // sll r0, r0, 0 + c->lw(a0, 7444, a3); // lw a0, 7444(a3) + // nop // sll r0, r0, 0 + c->lw(a1, 7436, a3); // lw a1, 7436(a3) + // nop // sll r0, r0, 0 + c->lw(a3, 7440, a3); // lw a3, 7440(a3) + // nop // sll r0, r0, 0 + c->sb(s5, 17, a1); // sb s5, 17(a1) + // nop // sll r0, r0, 0 + c->lbu(s0, 0, a0); // lbu s0, 0(a0) + c->addiu(s4, r0, 0); // addiu s4, r0, 0 + c->lbu(s1, 7, a0); // lbu s1, 7(a0) + c->addiu(t8, r0, 0); // addiu t8, r0, 0 + c->lbu(s2, 8, a0); // lbu s2, 8(a0) + c->sll(s0, s0, 2); // sll s0, s0, 2 + c->daddu(s0, s0, a0); // daddu s0, s0, a0 + c->sll(s1, s1, 2); // sll s1, s1, 2 + bc = c->sgpr64(s1) == 0; // beq s1, r0, L122 + c->daddu(s1, s1, s0); // daddu s1, s1, s0 + if (bc) {goto block_61;} // branch non-likely + + +block_59: + c->lbu(s3, 0, s0); // lbu s3, 0(s0) + c->daddu(s4, s4, t4); // daddu s4, s4, t4 + c->lbu(s6, 1, s0); // lbu s6, 1(s0) + c->daddu(t8, t8, t4); // daddu t8, t8, t4 + c->lbu(t9, 0, s4); // lbu t9, 0(s4) + c->daddu(s3, s3, t3); // daddu s3, s3, t3 + c->lbu(s4, 0, s3); // lbu s4, 0(s3) + c->daddu(s6, s6, t3); // daddu s6, s6, t3 + c->sb(t9, 0, t8); // sb t9, 0(t8) + c->daddiu(s0, s0, 4); // daddiu s0, s0, 4 + bc = c->sgpr64(s0) != c->sgpr64(s1); // bne s0, s1, L121 + c->lbu(t8, 0, s6); // lbu t8, 0(s6) + if (bc) {goto block_59;} // branch non-likely + + // nop // sll r0, r0, 0 + c->daddu(s4, s4, t4); // daddu s4, s4, t4 + c->lbu(t9, 0, s4); // lbu t9, 0(s4) + c->daddu(t8, t8, t4); // daddu t8, t8, t4 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sb(t9, 0, t8); // sb t9, 0(t8) + // nop // sll r0, r0, 0 + +block_61: + c->sll(s2, s2, 2); // sll s2, s2, 2 + c->daddiu(t5, a3, 32); // daddiu t5, a3, 32 + bc = c->sgpr64(s2) == 0; // beq s2, r0, L125 + c->daddu(s2, s2, s1); // daddu s2, s2, s1 + if (bc) {goto block_65;} // branch non-likely + + c->lbu(s3, 0, s0); // lbu s3, 0(s0) + c->daddiu(t6, a3, 192); // daddiu t6, a3, 192 + c->lbu(s6, 1, s0); // lbu s6, 1(s0) + c->daddiu(t7, a3, 448); // daddiu t7, a3, 448 + // nop // sll r0, r0, 0 + c->daddu(s3, s3, t6); // daddu s3, s3, t6 + c->lbu(s3, 0, s3); // lbu s3, 0(s3) + c->daddu(s6, s6, t3); // daddu s6, s6, t3 + c->lbu(s6, 0, s6); // lbu s6, 0(s6) + c->daddiu(v1, v1, -32); // daddiu v1, v1, -32 + // nop // sll r0, r0, 0 + c->daddu(s3, s3, t5); // daddu s3, s3, t5 + c->lbu(s4, 0, s3); // lbu s4, 0(s3) + c->daddu(s6, s6, t4); // daddu s6, s6, t4 + // nop // sll r0, r0, 0 + c->daddiu(s0, s0, 4); // daddiu s0, s0, 4 + c->sb(s5, 0, s6); // sb s5, 0(s6) + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + bc = c->sgpr64(s0) == c->sgpr64(s2); // beq s0, s2, L124 + // nop // sll r0, r0, 0 + if (bc) {goto block_64;} // branch non-likely + + +block_63: + c->lbu(s3, 0, s0); // lbu s3, 0(s0) + c->sll(s4, s4, 5); // sll s4, s4, 5 + c->lbu(s6, 1, s0); // lbu s6, 1(s0) + c->daddu(s4, s4, t7); // daddu s4, s4, t7 + c->lq(t9, 0, s4); // lq t9, 0(s4) + c->daddu(s3, s3, t6); // daddu s3, s3, t6 + c->lbu(s3, 0, s3); // lbu s3, 0(s3) + c->daddu(s6, s6, t3); // daddu s6, s6, t3 + c->lbu(s6, 0, s6); // lbu s6, 0(s6) + c->daddiu(v1, v1, 32); // daddiu v1, v1, 32 + c->lq(gp, 16, s4); // lq gp, 16(s4) + c->daddu(s3, s3, t5); // daddu s3, s3, t5 + c->lbu(s4, 0, s3); // lbu s4, 0(s3) + c->daddu(s6, s6, t4); // daddu s6, s6, t4 + c->sq(t9, 0, v1); // sq t9, 0(v1) + c->daddiu(s0, s0, 4); // daddiu s0, s0, 4 + c->sb(s5, 0, s6); // sb s5, 0(s6) + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + bc = c->sgpr64(s0) != c->sgpr64(s2); // bne s0, s2, L123 + c->sq(gp, 16, v1); // sq gp, 16(v1) + if (bc) {goto block_63;} // branch non-likely + + +block_64: + // nop // sll r0, r0, 0 + c->sll(s4, s4, 5); // sll s4, s4, 5 + // nop // sll r0, r0, 0 + c->daddu(s4, s4, t7); // daddu s4, s4, t7 + c->lq(t9, 0, s4); // lq t9, 0(s4) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->daddiu(v1, v1, 32); // daddiu v1, v1, 32 + c->lq(gp, 16, s4); // lq gp, 16(s4) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sq(t9, 0, v1); // sq t9, 0(v1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->sq(gp, 16, v1); // sq gp, 16(v1) + +block_65: + c->sh(s5, 20, a1); // sh s5, 20(a1) + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lq(s0, 7536, at); // lq s0, 7536(at) + c->lq(s1, 7552, at); // lq s1, 7552(at) + c->lq(s2, 7568, at); // lq s2, 7568(at) + c->lq(s3, 7584, at); // lq s3, 7584(at) + c->lq(s4, 7600, at); // lq s4, 7600(at) + c->lq(s5, 7616, at); // lq s5, 7616(at) + c->lq(s6, 7632, at); // lq s6, 7632(at) + c->lq(t8, 7648, at); // lq t8, 7648(at) + c->lq(t9, 7664, at); // lq t9, 7664(at) + c->lq(gp, 7680, at); // lq gp, 7680(at) + c->lq(ra, 7728, at); // lq ra, 7728(at) + c->lq(sp, 7696, at); // lq sp, 7696(at) + //jr ra // jr ra + c->lq(fp, 7712, at); // lq fp, 7712(at) + goto end_of_function; // return + + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("mercneric-convert", execute, 128); +} + +} // namespace mercneric_convert +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace high_speed_reject { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +void vcallms_438(ExecutionContext* c, u16* vis) { + + // nop | mulaz.xyzw ACC, vf09, vf01 158 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf01).vf.z()); + // nop | maddax.xyzw ACC, vf10, vf01 159 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf01].vf.x()); + // nop | maddy.xyzw vf01, vf11, vf01 160 + u16 f1 = c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf01].vf, c->vf_src(vf11).vf, c->vf_src(vf01).vf.y()); + // nop | mulaz.xyzw ACC, vf09, vf02 161 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf02).vf.z()); + // nop | maddax.xyzw ACC, vf10, vf02 162 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf02].vf.x()); + // nop | maddy.xyzw vf02, vf11, vf02 163 + u16 f2 = c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf02].vf, c->vf_src(vf11).vf, c->vf_src(vf02).vf.y()); + // fmand vi01, vi09 | mulaz.xyzw ACC, vf09, vf03 164 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf03).vf.z()); vis[1] = vis[9] & f1; + // nop | maddax.xyzw ACC, vf10, vf03 165 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf03].vf.x()); + // nop | maddy.xyzw vf03, vf11, vf03 166 + u16 f3 = c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf03].vf, c->vf_src(vf11).vf, c->vf_src(vf03).vf.y()); + // fmand vi02, vi09 | mulaz.xyzw ACC, vf09, vf04 167 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf04).vf.z()); vis[2] = vis[9] & f2; + // nop | maddax.xyzw ACC, vf10, vf04 168 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf04].vf.x()); + // nop | maddy.xyzw vf04, vf11, vf04 169 + c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf04].vf, c->vf_src(vf11).vf, c->vf_src(vf04).vf.y()); + // fmand vi03, vi09 | nop 170 + // ASSERT(false); + vis[3] = vis[9] & f3; + // nop | nop 171 + + // nop | nop :e 172 + + // fmand vi04, vi09 | nop 173 + // ASSERT(false); + vis[4] = vis[9] & f4; + +} + +void vcallms_454(ExecutionContext* c, u16* vis) { + // nop | mulaz.xyzw ACC, vf09, vf05 174 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf05).vf.z()); + // nop | maddax.xyzw ACC, vf10, vf05 175 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf05].vf.x()); + // nop | maddy.xyzw vf05, vf11, vf05 176 + u16 f1 = c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf05].vf, c->vf_src(vf11).vf, c->vf_src(vf05).vf.y()); + // nop | mulaz.xyzw ACC, vf09, vf06 177 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf06).vf.z()); + // nop | maddax.xyzw ACC, vf10, vf06 178 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf06].vf.x()); + // nop | maddy.xyzw vf06, vf11, vf06 179 + u16 f2 = c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf06].vf, c->vf_src(vf11).vf, c->vf_src(vf06).vf.y()); + // fmand vi05, vi09 | mulaz.xyzw ACC, vf09, vf07 180 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf07).vf.z()); vis[5] = vis[9] & f1; + // nop | maddax.xyzw ACC, vf10, vf07 181 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf07].vf.x()); + // nop | maddy.xyzw vf07, vf11, vf07 182 + u16 f3 = c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf07].vf, c->vf_src(vf11).vf, c->vf_src(vf07).vf.y()); + // fmand vi06, vi09 | mulaz.xyzw ACC, vf09, vf08 183 + c->acc.vf.mula_xyzw(c->vf_src(vf09).vf, c->vf_src(vf08).vf.z()); vis[5] = vis[9] & f2; + // nop | maddax.xyzw ACC, vf10, vf08 184 + c->acc.vf.madda_xyzw(c->vfs[vf10].vf, c->vfs[vf08].vf.x()); + // nop | maddy.xyzw vf08, vf11, vf08 185 + u16 f4 =c->acc.vf.madd_flag(Mask::xyzw, c->vfs[vf08].vf, c->vf_src(vf11).vf, c->vf_src(vf08).vf.y()); + // fmand vi07, vi09 | nop 186 + vis[7] = vis[9] & f3; + // nop | nop 187 + + // nop | nop :e 188 + + // fmand vi08, vi09 | nop 189 + // ASSERT(false); + vis[8] = vis[9] & f4; +} + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u16 vis[16]; + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lw(a0, 7436, v1); // lw a0, 7436(v1) + c->daddiu(a1, a0, 448); // daddiu a1, a0, 448 + c->lhu(a3, 20, a0); // lhu a3, 20(a0) + c->vmax_bc(DEST::xyzw, BC::w, vf9, vf0, vf0); // vmaxw.xyzw vf9, vf0, vf0 + c->lqc2(vf10, 7488, v1); // lqc2 vf10, 7488(v1) + c->lqc2(vf11, 7504, v1); // lqc2 vf11, 7504(v1) + c->lqc2(vf1, 0, a1); // lqc2 vf1, 0(a1) + c->addiu(a0, r0, 240); // addiu a0, r0, 240 + c->lqc2(vf2, 32, a1); // lqc2 vf2, 32(a1) + vis[9] = c->gpr_src(a0).du16[0]; // ctc2.i vi9, a0 + c->lqc2(vf3, 64, a1); // lqc2 vf3, 64(a1) + c->lqc2(vf4, 96, a1); // lqc2 vf4, 96(a1) + c->daddiu(a0, r0, -1); // daddiu a0, r0, -1 + // nop // sll r0, r0, 0 + // Unknown instr: vcallms 438 + vcallms_438(c, vis); + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf5, 128, a1); // lqc2 vf5, 128(a1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lqc2(vf6, 160, a1); // lqc2 vf6, 160(a1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->lwu(t0, 8, a1); // lwu t0, 8(a1) + c->lqc2(vf7, 192, a1); // lqc2 vf7, 192(a1) + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + c->gprs[a2].du64[0] = vis[1]; // cfc2.ni a2, vi1 + c->lqc2(vf8, 224, a1); // lqc2 vf8, 224(a1) + c->srl(t0, t0, 31); // srl t0, t0, 31 + c->or_(t0, a2, t0); // or t0, a2, t0 + c->lwu(a2, 40, a1); // lwu a2, 40(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + c->daddiu(a1, a1, 128); // daddiu a1, a1, 128 + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + bc = c->sgpr64(a3) == 0; // beq a3, r0, L84 + c->gprs[t0].du64[0] = vis[2]; // cfc2.ni t0, vi2 + if (bc) {goto block_18;} // branch non-likely + + +block_2: + // Unknown instr: vcallms 454 + vcallms_454(c, vis); + c->srl(a2, a2, 31); // srl a2, a2, 31 + c->or_(a2, t0, a2); // or a2, t0, a2 + c->lwu(t0, -56, a1); // lwu t0, -56(a1) + bc = c->sgpr64(a2) == 0; // beq a2, r0, L85 + c->and_(a0, a0, a2); // and a0, a0, a2 + if (bc) {goto block_20;} // branch non-likely + + c->lqc2(vf1, 128, a1); // lqc2 vf1, 128(a1) + c->daddiu(a2, a3, -1); // daddiu a2, a3, -1 + bc = c->sgpr64(a2) == 0; // beq a2, r0, L84 + c->gprs[a3].du64[0] = vis[3]; // cfc2.ni a3, vi3 + if (bc) {goto block_18;} // branch non-likely + + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->srl(t0, t0, 31); // srl t0, t0, 31 + c->or_(t0, a3, t0); // or t0, a3, t0 + c->lwu(a3, -24, a1); // lwu a3, -24(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L84 + c->gprs[t0].du64[0] = vis[4]; // cfc2.ni t0, vi4 + if (bc) {goto block_18;} // branch non-likely + + c->lqc2(vf2, 160, a1); // lqc2 vf2, 160(a1) + c->srl(a3, a3, 31); // srl a3, a3, 31 + c->or_(t0, t0, a3); // or t0, t0, a3 + c->lwu(a3, 8, a1); // lwu a3, 8(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + c->lqc2(vf3, 192, a1); // lqc2 vf3, 192(a1) + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + bc = c->sgpr64(a2) == 0; // beq a2, r0, L84 + c->gprs[t0].du64[0] = vis[5]; // cfc2.ni t0, vi5 + if (bc) {goto block_18;} // branch non-likely + + c->lqc2(vf4, 224, a1); // lqc2 vf4, 224(a1) + c->srl(a3, a3, 31); // srl a3, a3, 31 + c->or_(t0, t0, a3); // or t0, t0, a3 + c->lwu(a3, 40, a1); // lwu a3, 40(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + c->daddiu(a1, a1, 128); // daddiu a1, a1, 128 + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + bc = c->sgpr64(a2) == 0; // beq a2, r0, L84 + c->gprs[t0].du64[0] = vis[6]; // cfc2.ni t0, vi6 + if (bc) {goto block_18;} // branch non-likely + + // Unknown instr: vcallms 438 + // vcallms_438(c, vis); + c->srl(a3, a3, 31); // srl a3, a3, 31 + c->or_(t0, t0, a3); // or t0, t0, a3 + c->lwu(a3, -56, a1); // lwu a3, -56(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + c->lqc2(vf5, 128, a1); // lqc2 vf5, 128(a1) + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + bc = c->sgpr64(a2) == 0; // beq a2, r0, L84 + c->gprs[t0].du64[0] = vis[7]; // cfc2.ni t0, vi7 + if (bc) {goto block_18;} // branch non-likely + + c->daddiu(a2, a2, -1); // daddiu a2, a2, -1 + c->srl(a3, a3, 31); // srl a3, a3, 31 + c->or_(t0, t0, a3); // or t0, t0, a3 + c->lwu(a3, -24, a1); // lwu a3, -24(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + bc = c->sgpr64(a2) == 0; // beq a2, r0, L84 + c->gprs[t0].du64[0] = vis[8]; // cfc2.ni t0, vi8 + if (bc) {goto block_18;} // branch non-likely + + c->lqc2(vf6, 160, a1); // lqc2 vf6, 160(a1) + c->srl(a3, a3, 31); // srl a3, a3, 31 + c->or_(a3, t0, a3); // or a3, t0, a3 + c->lwu(t0, 8, a1); // lwu t0, 8(a1) + bc = c->sgpr64(a3) == 0; // beq a3, r0, L85 + c->and_(a0, a0, a3); // and a0, a0, a3 + if (bc) {goto block_20;} // branch non-likely + + c->lqc2(vf7, 192, a1); // lqc2 vf7, 192(a1) + c->daddiu(a3, a2, -1); // daddiu a3, a2, -1 + bc = c->sgpr64(a3) == 0; // beq a3, r0, L84 + c->gprs[a2].du64[0] = vis[1]; // cfc2.ni a2, vi1 + if (bc) {goto block_18;} // branch non-likely + + c->lqc2(vf8, 224, a1); // lqc2 vf8, 224(a1) + c->srl(t0, t0, 31); // srl t0, t0, 31 + c->or_(t0, a2, t0); // or t0, a2, t0 + c->lwu(a2, 40, a1); // lwu a2, 40(a1) + bc = c->sgpr64(t0) == 0; // beq t0, r0, L85 + c->and_(a0, a0, t0); // and a0, a0, t0 + if (bc) {goto block_20;} // branch non-likely + + c->daddiu(a1, a1, 128); // daddiu a1, a1, 128 + c->daddiu(a3, a3, -1); // daddiu a3, a3, -1 + bc = c->sgpr64(a3) != 0; // bne a3, r0, L83 + c->gprs[t0].du64[0] = vis[2]; // cfc2.ni t0, vi2 + if (bc) {goto block_2;} // branch non-likely + + +block_18: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L85 + // nop // sll r0, r0, 0 + if (bc) {goto block_20;} // branch non-likely + + c->sb(r0, 6853, v1); // sb r0, 6853(v1) + +block_20: + //jr ra // jr ra + // nop // sll r0, r0, 0 + goto end_of_function; // return + + //jr ra // jr ra + c->daddu(sp, sp, r0); // daddu sp, sp, r0 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("high-speed-reject", execute, 128); +} + +} // namespace high_speed_reject +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace generic_translucent { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* +} cache; + +u64 execute(void* ctxt) { + u32 qwc = 0; + u32 madr = 0; + u32 sadr = 0; + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + [[maybe_unused]] u32 call_addr = 0; + c->daddiu(sp, sp, -16); // daddiu sp, sp, -16 + c->sd(ra, 0, sp); // sd ra, 0(sp) + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->mov64(v1, a0); // or v1, a0, r0 + c->daddiu(a0, at, 12064); // daddiu a0, at, 12064 + c->lbu(a1, 6842, at); // lbu a1, 6842(at) + c->daddiu(a2, at, 6960); // daddiu a2, at, 6960 + c->mov64(a2, a2); // or a2, a2, r0 + c->movn(a0, a2, a1); // movn a0, a2, a1 + c->lbu(a1, 6856, at); // lbu a1, 6856(at) + c->addiu(a2, r0, 128); // addiu a2, r0, 128 + c->sltu(a2, a2, a1); // sltu a2, a2, a1 + bc = c->sgpr64(a2) != 0; // bne a2, r0, L78 + // nop // sll r0, r0, 0 + if (bc) {goto block_2;} // branch non-likely + + c->addiu(a3, r0, 100); // addiu a3, r0, 100 + c->lw(a2, 24, at); // lw a2, 24(at) + c->sw(a3, 112, a2); // sw a3, 112(a2) + c->addiu(a3, r0, 66); // addiu a3, r0, 66 + c->sw(a3, 120, a2); // sw a3, 120(a2) + c->sw(a1, 116, a2); // sw a1, 116(a2) + //beq r0, r0, L79 // beq r0, r0, L79 + // nop // sll r0, r0, 0 + goto block_3; // branch always + + +block_2: + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + +block_3: + c->sw(r0, 48, at); // sw r0, 48(at) + c->sw(a0, 52, at); // sw a0, 52(at) + c->sw(v1, 44, at); // sw v1, 44(at) + c->lwu(t9, 7468, at); // lwu t9, 7468(at) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_prepare_dma_double::execute(c); + c->lwu(t9, 7472, at); // lwu t9, 7472(at) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_light_proc::execute(c); + c->lwu(t9, 7476, at); // lwu t9, 7476(at) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_envmap_proc::execute(c); + c->lw(v1, 24, at); // lw v1, 24(at) + c->lw(a0, 40, at); // lw a0, 40(at) + c->mov64(a3, v1); // or a3, v1, r0 + // nop // sll r0, r0, 0 + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lui(a2, 4096); // lui a2, 4096 + c->lwu(a1, 60, at); // lwu a1, 60(at) + c->ori(a2, a2, 53248); // ori a2, a2, 53248 + // c->lw(t1, 0, a2); // lw t1, 0(a2) + // nop // sll r0, r0, 0 + c->daddiu(t0, at, 92); // daddiu t0, at, 92 + c->andi(a3, a3, 16383); // andi a3, a3, 16383 + c->andi(t1, t1, 256); // andi t1, t1, 256 + // nop // sll r0, r0, 0 + // bc = c->sgpr64(t1) == 0; // beq t1, r0, L81 + // nop // sll r0, r0, 0 + +// if (bc) {goto block_7;} // branch non-likely +// +// c->mov64(t1, a2); // or t1, a2, r0 +// // nop // sll r0, r0, 0 +// +// block_5: +// c->lw(t2, 0, t0); // lw t2, 0(t0) +// // nop // sll r0, r0, 0 +// c->lw(t3, 0, t1); // lw t3, 0(t1) +// // nop // sll r0, r0, 0 +// c->andi(t3, t3, 256); // andi t3, t3, 256 +// c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 +// bc = c->sgpr64(t3) != 0; // bne t3, r0, L80 +// c->sw(t2, 0, t0); // sw t2, 0(t0) +// if (bc) {goto block_5;} // branch non-likely +// +// c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + + +// block_7: + c->dsll(t0, a0, 4); // dsll t0, a0, 4 + // c->sw(a3, 128, a2); // sw a3, 128(a2) + sadr = c->sgpr64(a3); + // nop // sll r0, r0, 0 + // c->sw(a1, 16, a2); // sw a1, 16(a2) + madr = c->sgpr64(a1); + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + // c->sw(a0, 32, a2); // sw a0, 32(a2) + qwc = c->sgpr64(a0); + c->daddu(a0, a1, t0); // daddu a0, a1, t0 + // c->sw(a3, 0, a2); // sw a3, 0(a2) + spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc); + // nop // sll r0, r0, 0 + c->sw(a0, 60, at); // sw a0, 60(at) + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + c->xori(v1, v1, 4608); // xori v1, v1, 4608 + c->sw(v1, 24, at); // sw v1, 24(at) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 16); // daddiu sp, sp, 16 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + gLinkedFunctionTable.reg("generic-translucent", execute, 128); +} + +} // namespace generic_translucent +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace generic_merc_query { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* vector_matrix; // vector-matrix*! +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -96); // daddiu sp, sp, -96 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s2, 16, sp); // sq s2, 16(sp) + c->sq(s3, 32, sp); // sq s3, 32(sp) + c->sq(s4, 48, sp); // sq s4, 48(sp) + c->sq(s5, 64, sp); // sq s5, 64(sp) + c->sq(gp, 80, sp); // sq gp, 80(sp) + c->mov64(s4, a0); // or s4, a0, r0 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(gp, 6836, v1); // lwu gp, 6836(v1) + c->lhu(s3, 20, s4); // lhu s3, 20(s4) + c->lw(s2, 24, gp); // lw s2, 24(gp) + c->lw(s5, 20, gp); // lw s5, 20(gp) + c->addiu(v1, r0, 7136); // addiu v1, r0, 7136 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lwu(v1, 284, v1); // lwu v1, 284(v1) + bc = c->sgpr64(v1) != 0; // bne v1, r0, L73 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_2;} // branch non-likely + + c->addiu(s5, r0, 0); // addiu s5, r0, 0 + c->lw(s2, 12, gp); // lw s2, 12(gp) + c->mov64(v1, s2); // or v1, s2, r0 + +block_2: + //beq r0, r0, L76 // beq r0, r0, L76 + // nop // sll r0, r0, 0 + goto block_6; // branch always + + +block_3: + c->lw(v1, 0, gp); // lw v1, 0(gp) + c->slt(v1, s5, v1); // slt v1, s5, v1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L75 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_5;} // branch non-likely + + c->dsll(v1, s5, 4); // dsll v1, s5, 4 + c->daddiu(v1, v1, 28); // daddiu v1, v1, 28 + c->daddu(a1, v1, gp); // daddu a1, v1, gp + c->dsll(v1, s2, 5); // dsll v1, s2, 5 + c->daddu(v1, v1, s4); // daddu v1, v1, s4 + c->lwc1(f0, 448, v1); // lwc1 f0, 448(v1) + c->swc1(f0, 0, a1); // swc1 f0, 0(a1) + c->dsll(v1, s2, 5); // dsll v1, s2, 5 + c->daddu(v1, v1, s4); // daddu v1, v1, s4 + c->lwc1(f0, 452, v1); // lwc1 f0, 452(v1) + c->swc1(f0, 4, a1); // swc1 f0, 4(a1) + c->dsll(v1, s2, 5); // dsll v1, s2, 5 + c->daddu(v1, v1, s4); // daddu v1, v1, s4 + c->lwc1(f0, 456, v1); // lwc1 f0, 456(v1) + c->swc1(f0, 8, a1); // swc1 f0, 8(a1) + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 12, a1); // swc1 f0, 12(a1) + c->load_symbol2(t9, cache.vector_matrix); // lw t9, vector-matrix*!(s7) + c->mov64(a0, a1); // or a0, a1, r0 + c->addiu(v1, r0, 7264); // addiu v1, r0, 7264 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a2, v1, a2); // daddu a2, v1, a2 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + c->mov64(v1, s5); // or v1, s5, r0 + +block_5: + c->lw(v1, 16, gp); // lw v1, 16(gp) + c->daddu(s2, s2, v1); // daddu s2, s2, v1 + +block_6: + c->slt(v1, s2, s3); // slt v1, s2, s3 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L74 + // nop // sll r0, r0, 0 + if (bc) {goto block_3;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->dsubu(v1, s2, s3); // dsubu v1, s2, s3 + c->sw(v1, 24, gp); // sw v1, 24(gp) + c->sw(s5, 20, gp); // sw s5, 20(gp) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 80, sp); // lq gp, 80(sp) + c->lq(s5, 64, sp); // lq s5, 64(sp) + c->lq(s4, 48, sp); // lq s4, 48(sp) + c->lq(s3, 32, sp); // lq s3, 32(sp) + c->lq(s2, 16, sp); // lq s2, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 96); // daddiu sp, sp, 96 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.vector_matrix = intern_from_c(-1, 0, "vector-matrix*!").c(); + gLinkedFunctionTable.reg("generic-merc-query", execute, 128); +} + +} // namespace generic_merc_query +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace generic_merc_death { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* merc_death_spawn; // merc-death-spawn + void* vector_matrix; // vector-matrix*! +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -144); // daddiu sp, sp, -144 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 48, sp); // sq s1, 48(sp) + c->sq(s2, 64, sp); // sq s2, 64(sp) + c->sq(s3, 80, sp); // sq s3, 80(sp) + c->sq(s4, 96, sp); // sq s4, 96(sp) + c->sq(s5, 112, sp); // sq s5, 112(sp) + c->sq(gp, 128, sp); // sq gp, 128(sp) + c->mov64(gp, a0); // or gp, a0, r0 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lhu(s5, 6846, v1); // lhu s5, 6846(v1) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lhu(s3, 6844, v1); // lhu s3, 6844(v1) + c->lhu(s4, 20, gp); // lhu s4, 20(gp) + c->daddiu(s2, sp, 16); // daddiu s2, sp, 16 + c->sq(r0, 0, s2); // sq r0, 0(s2) + c->daddiu(s1, sp, 32); // daddiu s1, sp, 32 + c->sq(r0, 0, s1); // sq r0, 0(s1) + //beq r0, r0, L71 // beq r0, r0, L71 + // nop // sll r0, r0, 0 + goto block_2; // branch always + + +block_1: + c->dsll(v1, s5, 5); // dsll v1, s5, 5 + c->daddu(v1, v1, gp); // daddu v1, v1, gp + c->lwc1(f0, 448, v1); // lwc1 f0, 448(v1) + c->swc1(f0, 0, s2); // swc1 f0, 0(s2) + c->dsll(v1, s5, 5); // dsll v1, s5, 5 + c->daddu(v1, v1, gp); // daddu v1, v1, gp + c->lwc1(f0, 452, v1); // lwc1 f0, 452(v1) + c->swc1(f0, 4, s2); // swc1 f0, 4(s2) + c->dsll(v1, s5, 5); // dsll v1, s5, 5 + c->daddu(v1, v1, gp); // daddu v1, v1, gp + c->lwc1(f0, 456, v1); // lwc1 f0, 456(v1) + c->swc1(f0, 8, s2); // swc1 f0, 8(s2) + c->lui(v1, 16256); // lui v1, 16256 + c->mtc1(f0, v1); // mtc1 f0, v1 + c->swc1(f0, 12, s2); // swc1 f0, 12(s2) + c->dsll(v1, s5, 5); // dsll v1, s5, 5 + c->daddu(v1, v1, gp); // daddu v1, v1, gp + c->lwc1(f0, 464, v1); // lwc1 f0, 464(v1) + c->swc1(f0, 0, s1); // swc1 f0, 0(s1) + c->dsll(v1, s5, 5); // dsll v1, s5, 5 + c->daddu(v1, v1, gp); // daddu v1, v1, gp + c->lwc1(f0, 468, v1); // lwc1 f0, 468(v1) + c->swc1(f0, 4, s1); // swc1 f0, 4(s1) + c->dsll(v1, s5, 5); // dsll v1, s5, 5 + c->daddu(v1, v1, gp); // daddu v1, v1, gp + c->lwc1(f0, 472, v1); // lwc1 f0, 472(v1) + c->swc1(f0, 8, s1); // swc1 f0, 8(s1) + c->mtc1(f0, r0); // mtc1 f0, r0 + c->swc1(f0, 12, s1); // swc1 f0, 12(s1) + c->load_symbol2(t9, cache.vector_matrix); // lw t9, vector-matrix*!(s7) + c->mov64(a0, s2); // or a0, s2, r0 + c->mov64(a1, s2); // or a1, s2, r0 + c->addiu(v1, r0, 7264); // addiu v1, r0, 7264 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a2, v1, a2); // daddu a2, v1, a2 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(t9, cache.vector_matrix); // lw t9, vector-matrix*!(s7) + c->mov64(a0, s1); // or a0, s1, r0 + c->mov64(a1, s1); // or a1, s1, r0 + c->addiu(v1, r0, 7264); // addiu v1, r0, 7264 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a2, v1, a2); // daddu a2, v1, a2 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->load_symbol2(t9, cache.merc_death_spawn); // lw t9, merc-death-spawn(s7) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(a0, 6848, v1); // lwu a0, 6848(v1) + c->mov64(a1, s2); // or a1, s2, r0 + c->mov64(a2, s1); // or a2, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->daddu(s5, s5, s3); // daddu s5, s5, s3 + +block_2: + c->sltu(v1, s5, s4); // sltu v1, s5, s4 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L70 + // nop // sll r0, r0, 0 + if (bc) {goto block_1;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + c->dsubu(a0, s5, s4); // dsubu a0, s5, s4 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->sh(a0, 6846, v1); // sh a0, 6846(v1) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 128, sp); // lq gp, 128(sp) + c->lq(s5, 112, sp); // lq s5, 112(sp) + c->lq(s4, 96, sp); // lq s4, 96(sp) + c->lq(s3, 80, sp); // lq s3, 80(sp) + c->lq(s2, 64, sp); // lq s2, 64(sp) + c->lq(s1, 48, sp); // lq s1, 48(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 144); // daddiu sp, sp, 144 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.merc_death_spawn = intern_from_c(-1, 0, "merc-death-spawn").c(); + cache.vector_matrix = intern_from_c(-1, 0, "vector-matrix*!").c(); + gLinkedFunctionTable.reg("generic-merc-death", execute, 256); +} + +} // namespace generic_merc_death +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace generic_merc_execute_asm { +struct Cache { + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* gsf_buffer; // *gsf-buffer* + void* generic_merc_death; // generic-merc-death + void* generic_merc_query; // generic-merc-query + void* generic_translucent; // generic-translucent + void* generic_warp_dest; // generic-warp-dest + void* generic_warp_envmap_dest; // generic-warp-envmap-dest + void* generic_warp_source; // generic-warp-source +} cache; + +u64 execute(void* ctxt) { + u32 madr, sadr, qwc; + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -112); // daddiu sp, sp, -112 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s1, 16, sp); // sq s1, 16(sp) + c->sq(s2, 32, sp); // sq s2, 32(sp) + c->sq(s3, 48, sp); // sq s3, 48(sp) + c->sq(s4, 64, sp); // sq s4, 64(sp) + c->sq(s5, 80, sp); // sq s5, 80(sp) + c->sq(gp, 96, sp); // sq gp, 96(sp) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(v1, 7456, v1); // lwu v1, 7456(v1) + c->lwu(s2, 0, v1); // lwu s2, 0(v1) + c->addiu(v1, r0, 0); // addiu v1, r0, 0 + c->addiu(gp, r0, 0); // addiu gp, r0, 0 + c->addiu(s5, r0, 0); // addiu s5, r0, 0 + c->load_symbol2(s4, cache.gsf_buffer); // lw s4, *gsf-buffer*(s7) + c->lui(v1, 4096); // lui v1, 4096 + c->ori(s3, v1, 54272); // ori s3, v1, 54272 + c->addiu(v1, r0, 624); // addiu v1, r0, 624 + c->lui(a0, 4096); // lui a0, 4096 + c->ori(a0, a0, 54272); // ori a0, a0, 54272 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->ori(a1, a1, 88); // ori a1, a1, 88 + +// dma sync +// c->lw(a2, 0, a0); // lw a2, 0(a0) +// c->andi(a2, a2, 256); // andi a2, a2, 256 +// bc = c->sgpr64(a2) == 0; // beq a2, r0, L22 +// DANGER jump to delay slot, this MUST be fixed manually! +// c->lw(a2, 0, a1); // lw a2, 0(a1) +// if (bc) {goto block_-1;} // branch non-likely +// +// +// block_1: +// c->lw(a2, 0, a1); // lw a2, 0(a1) +// // nop // sll r0, r0, 0 +// c->lw(a3, 0, a0); // lw a3, 0(a0) +// // nop // sll r0, r0, 0 +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// c->daddiu(a2, a2, 1); // daddiu a2, a2, 1 +// bc = c->sgpr64(a3) != 0; // bne a3, r0, L21 +// c->sw(a2, 0, a1); // sw a2, 0(a1) +// if (bc) {goto block_1;} // branch non-likely + + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + // c->sw(v1, 128, s3); // sw v1, 128(s3) + sadr = c->sgpr64(v1); + // c->sw(s2, 48, s3); // sw s2, 48(s3) + u32 tadr = c->sgpr64(s2); + // c->sw(r0, 32, s3); // sw r0, 32(s3) + // Unknown instr: sync.l + c->addiu(v1, r0, 324); // addiu v1, r0, 324 + // c->sw(v1, 0, s3); // sw v1, 0(s3) + spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr, tadr); + // Unknown instr: sync.l + //beq r0, r0, L68 // beq r0, r0, L68 + // nop // sll r0, r0, 0 + goto block_88; // branch always + + +block_4: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L24 + // nop // sll r0, r0, 0 + if (bc) {goto block_6;} // branch non-likely + + c->addiu(v1, r0, 624); // addiu v1, r0, 624 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + //beq r0, r0, L25 // beq r0, r0, L25 + // nop // sll r0, r0, 0 + goto block_7; // branch always + + +block_6: + c->addiu(v1, r0, 3648); // addiu v1, r0, 3648 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + +block_7: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L26 + // nop // sll r0, r0, 0 + if (bc) {goto block_9;} // branch non-likely + + c->addiu(a0, r0, 3648); // addiu a0, r0, 3648 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + //beq r0, r0, L27 // beq r0, r0, L27 + // nop // sll r0, r0, 0 + goto block_10; // branch always + + +block_9: + c->addiu(a0, r0, 624); // addiu a0, r0, 624 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + +block_10: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L28 + // nop // sll r0, r0, 0 + if (bc) {goto block_12;} // branch non-likely + + c->addiu(a1, r0, 3568); // addiu a1, r0, 3568 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a1, a1, a2); // daddu a1, a1, a2 + //beq r0, r0, L29 // beq r0, r0, L29 + // nop // sll r0, r0, 0 + goto block_13; // branch always + + +block_12: + c->addiu(a1, r0, 6592); // addiu a1, r0, 6592 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a1, a1, a2); // daddu a1, a1, a2 + +block_13: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L30 + // nop // sll r0, r0, 0 + if (bc) {goto block_15;} // branch non-likely + + c->addiu(a1, r0, 6592); // addiu a1, r0, 6592 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a1, a1, a2); // daddu a1, a1, a2 + //beq r0, r0, L31 // beq r0, r0, L31 + // nop // sll r0, r0, 0 + goto block_16; // branch always + + +block_15: + c->addiu(a1, r0, 3568); // addiu a1, r0, 3568 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->daddu(a1, a1, a2); // daddu a1, a1, a2 + +block_16: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L32 + // nop // sll r0, r0, 0 + if (bc) {goto block_18;} // branch non-likely + + c->daddu(s1, r0, s4); // daddu s1, r0, s4 + //beq r0, r0, L33 // beq r0, r0, L33 + // nop // sll r0, r0, 0 + goto block_19; // branch always + + +block_18: + c->daddiu(s1, s4, 2752); // daddiu s1, s4, 2752 + +block_19: + bc = c->sgpr64(gp) != 0; // bne gp, r0, L34 + // nop // sll r0, r0, 0 + if (bc) {goto block_21;} // branch non-likely + + c->daddiu(a1, s4, 2752); // daddiu a1, s4, 2752 + //beq r0, r0, L35 // beq r0, r0, L35 + // nop // sll r0, r0, 0 + goto block_22; // branch always + + +block_21: + c->daddu(a1, r0, s4); // daddu a1, r0, s4 + +block_22: + c->addiu(a2, r0, 7136); // addiu a2, r0, 7136 + get_fake_spad_addr2(a3, cache.fake_scratchpad_data, 0, c);// lui a3, 28672 + c->daddu(a2, a2, a3); // daddu a2, a2, a3 + c->sw(gp, 280, a2); // sw gp, 280(a2) + c->sw(s5, 284, a2); // sw s5, 284(a2) + c->sw(v1, 292, a2); // sw v1, 292(a2) + c->sw(a0, 296, a2); // sw a0, 296(a2) + c->sw(s1, 300, a2); // sw s1, 300(a2) + c->sw(a1, 304, a2); // sw a1, 304(a2) + c->sw(s4, 312, a2); // sw s4, 312(a2) + c->mov64(a1, s4); // or a1, s4, r0 + c->lui(a1, 4096); // lui a1, 4096 + c->ori(a1, a1, 54272); // ori a1, a1, 54272 + get_fake_spad_addr2(a2, cache.fake_scratchpad_data, 0, c);// lui a2, 28672 + c->ori(a2, a2, 88); // ori a2, a2, 88 + +// dma sync +// c->lw(a3, 0, a1); // lw a3, 0(a1) +// c->andi(a3, a3, 256); // andi a3, a3, 256 +// bc = c->sgpr64(a3) == 0; // beq a3, r0, L37 +// DANGER jump to delay slot, this MUST be fixed manually! +// c->lw(a3, 0, a2); // lw a3, 0(a2) +// if (bc) {goto block_-1;} // branch non-likely +// +// +// block_23: +// c->lw(a3, 0, a2); // lw a3, 0(a2) +// // nop // sll r0, r0, 0 +// c->lw(t0, 0, a1); // lw t0, 0(a1) +// // nop // sll r0, r0, 0 +// c->andi(t0, t0, 256); // andi t0, t0, 256 +// c->daddiu(a3, a3, 1); // daddiu a3, a3, 1 +// bc = c->sgpr64(t0) != 0; // bne t0, r0, L36 +// c->sw(a3, 0, a2); // sw a3, 0(a2) +// if (bc) {goto block_23;} // branch non-likely + + c->gprs[a1].du64[0] = 0; // or a1, r0, r0 + c->lwu(s2, 12, v1); // lwu s2, 12(v1) + bc = c->sgpr64(s2) == 0; // beq s2, r0, L38 + c->mov64(a1, s7); // or a1, s7, r0 + if (bc) {goto block_27;} // branch non-likely + + c->daddu(a0, r0, a0); // daddu a0, r0, a0 + c->andi(a0, a0, 65535); // andi a0, a0, 65535 + // c->sw(a0, 128, s3); // sw a0, 128(s3) + sadr = c->sgpr64(a0); + // c->sw(s2, 48, s3); // sw s2, 48(s3) + tadr = c->sgpr64(s2); + // c->sw(r0, 32, s3); // sw r0, 32(s3) + // Unknown instr: sync.l + c->addiu(a0, r0, 324); // addiu a0, r0, 324 + // c->sw(a0, 0, s3); // sw a0, 0(s3) + // hack - I don't really know why, but the andi above puts sadr into a 64 kb + // range instead of a 16 kB range. I believe the hardware will just mask it. + // or, maybe there's something else wrong? Not sure, but the transfer does seem to go + // to the right spot when I use this. + spad_to_dma_blerc_chain(cache.fake_scratchpad_data, sadr & 0x3fff, tadr); + // Unknown instr: sync.l + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + +block_27: + bc = c->sgpr64(s5) != 0; // bne s5, r0, L47 + c->mov64(a0, s7); // or a0, s7, r0 + if (bc) {goto block_44;} // branch non-likely + + c->addiu(a0, r0, 6672); // addiu a0, r0, 6672 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a1, a0, a1); // daddu a1, a0, a1 + c->mov64(a2, v1); // or a2, v1, r0 + c->lwu(a0, 8, v1); // lwu a0, 8(v1) + // nop // sll r0, r0, 0 + c->daddiu(a3, a0, -4); // daddiu a3, a0, -4 + c->mov64(a1, a1); // or a1, a1, r0 + bc = ((s64)c->sgpr64(a3)) < 0; // bltz a3, L40 + c->mov64(a2, a2); // or a2, a2, r0 + if (bc) {goto block_30;} // branch non-likely + + +block_29: + // nop // sll r0, r0, 0 + c->lq(t2, 0, a2); // lq t2, 0(a2) + // nop // sll r0, r0, 0 + c->lq(a3, 16, a2); // lq a3, 16(a2) + c->daddiu(a0, a0, -4); // daddiu a0, a0, -4 + c->lq(t0, 32, a2); // lq t0, 32(a2) + c->daddiu(a1, a1, 64); // daddiu a1, a1, 64 + c->lq(t1, 48, a2); // lq t1, 48(a2) + c->daddiu(a2, a2, 64); // daddiu a2, a2, 64 + c->sq(t2, -64, a1); // sq t2, -64(a1) + c->daddiu(t2, a0, -4); // daddiu t2, a0, -4 + c->sq(a3, -48, a1); // sq a3, -48(a1) + // nop // sll r0, r0, 0 + c->sq(t0, -32, a1); // sq t0, -32(a1) + bc = ((s64)c->sgpr64(t2)) >= 0; // bgez t2, L39 + c->sq(t1, -16, a1); // sq t1, -16(a1) + if (bc) {goto block_29;} // branch non-likely + + +block_30: + bc = c->sgpr64(a0) == 0; // beq a0, r0, L41 + c->lq(a3, 0, a2); // lq a3, 0(a2) + if (bc) {goto block_35;} // branch non-likely + + c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, -16, a1); // sq a3, -16(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L41 + c->lq(a3, 0, a2); // lq a3, 0(a2) + if (bc) {goto block_35;} // branch non-likely + + c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, -16, a1); // sq a3, -16(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L41 + c->lq(a3, 0, a2); // lq a3, 0(a2) + if (bc) {goto block_35;} // branch non-likely + + c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, -16, a1); // sq a3, -16(a1) + bc = c->sgpr64(a0) == 0; // beq a0, r0, L41 + c->lq(a3, 0, a2); // lq a3, 0(a2) + if (bc) {goto block_35;} // branch non-likely + + c->daddiu(a2, a2, 16); // daddiu a2, a2, 16 + c->daddiu(a1, a1, 16); // daddiu a1, a1, 16 + c->daddiu(a0, a0, -1); // daddiu a0, a0, -1 + c->sq(a3, -16, a1); // sq a3, -16(a1) + +block_35: + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6840, a0); // lbu a0, 6840(a0) + bc = c->sgpr64(a0) != 0; // bne a0, r0, L42 + // nop // sll r0, r0, 0 + if (bc) {goto block_37;} // branch non-likely + + c->addiu(a0, r0, 8); // addiu a0, r0, 8 + //beq r0, r0, L43 // beq r0, r0, L43 + // nop // sll r0, r0, 0 + goto block_38; // branch always + + +block_37: + c->addiu(a0, r0, 6); // addiu a0, r0, 6 + +block_38: + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->ori(a1, a1, 11984); // ori a1, a1, 11984 + c->sh(a0, 0, a1); // sh a0, 0(a1) + c->addiu(a0, r0, 12048); // addiu a0, r0, 12048 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->lwu(a1, 6832, a1); // lwu a1, 6832(a1) + c->sw(a1, 0, a0); // sw a1, 0(a0) + c->sw(a1, 4, a0); // sw a1, 4(a0) + c->sw(a1, 8, a0); // sw a1, 8(a0) + c->sw(a1, 12, a0); // sw a1, 12(a0) + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->addiu(a0, a1, 7136); // addiu a0, a1, 7136 + c->lbu(a2, 6841, a1); // lbu a2, 6841(a1) + c->addiu(a3, a1, 7200); // addiu a3, a1, 7200 + c->addiu(a1, a1, 11808); // addiu a1, a1, 11808 + c->movn(a0, a3, a2); // movn a0, a3, a2 + c->lq(a2, 0, a0); // lq a2, 0(a0) + c->lq(a3, 16, a0); // lq a3, 16(a0) + c->lq(t0, 32, a0); // lq t0, 32(a0) + c->lq(a0, 48, a0); // lq a0, 48(a0) + c->sq(a2, 0, a1); // sq a2, 0(a1) + c->sq(a3, 16, a1); // sq a3, 16(a1) + c->sq(t0, 32, a1); // sq t0, 32(a1) + c->sq(a0, 48, a1); // sq a0, 48(a1) + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6843, a0); // lbu a0, 6843(a0) + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->sb(a0, 6853, a1); // sb a0, 6853(a1) + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lqc2(vf1, 6688, at); // lqc2 vf1, 6688(at) + c->lqc2(vf2, 6704, at); // lqc2 vf2, 6704(at) + c->lqc2(vf3, 6720, at); // lqc2 vf3, 6720(at) + c->lqc2(vf4, 6736, at); // lqc2 vf4, 6736(at) + c->lqc2(vf5, 6752, at); // lqc2 vf5, 6752(at) + c->lqc2(vf6, 6768, at); // lqc2 vf6, 6768(at) + c->lqc2(vf7, 6784, at); // lqc2 vf7, 6784(at) + c->sqc2(vf1, 12688, at); // sqc2 vf1, 12688(at) + c->sqc2(vf2, 12704, at); // sqc2 vf2, 12704(at) + c->sqc2(vf3, 12720, at); // sqc2 vf3, 12720(at) + c->sqc2(vf4, 12736, at); // sqc2 vf4, 12736(at) + c->sqc2(vf5, 12752, at); // sqc2 vf5, 12752(at) + c->sqc2(vf6, 12768, at); // sqc2 vf6, 12768(at) + c->sqc2(vf7, 12784, at); // sqc2 vf7, 12784(at) + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6852, a0); // lbu a0, 6852(a0) + c->andi(a0, a0, 2); // andi a0, a0, 2 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L44 + // nop // sll r0, r0, 0 + if (bc) {goto block_40;} // branch non-likely + + c->lui(a0, 12342); // lui a0, 12342 + c->ori(a0, a0, 16384); // ori a0, a0, 16384 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->sw(a0, 11876, a1); // sw a0, 11876(a1) + c->lui(a0, 12342); // lui a0, 12342 + c->ori(a1, a0, 49152); // ori a1, a0, 49152 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->sw(a1, 11872, a0); // sw a1, 11872(a0) + //beq r0, r0, L45 // beq r0, r0, L45 + // nop // sll r0, r0, 0 + goto block_41; // branch always + + +block_40: + c->lui(a0, 12350); // lui a0, 12350 + c->ori(a0, a0, 16384); // ori a0, a0, 16384 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->sw(a0, 11876, a1); // sw a0, 11876(a1) + c->lui(a0, 12350); // lui a0, 12350 + c->ori(a1, a0, 49152); // ori a1, a0, 49152 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->sw(a1, 11872, a0); // sw a1, 11872(a0) + +block_41: + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6856, a0); // lbu a0, 6856(a0) + c->addiu(a1, r0, 128); // addiu a1, r0, 128 + c->sltu(a1, a1, a0); // sltu a1, a1, a0 + bc = c->sgpr64(a1) != 0; // bne a1, r0, L46 + c->mov64(a1, s7); // or a1, s7, r0 + if (bc) {goto block_43;} // branch non-likely + + c->lui(a1, 15360); // lui a1, 15360 + c->mtc1(f0, a1); // mtc1 f0, a1 + c->mtc1(f1, a0); // mtc1 f1, a0 + c->cvtsw(f1, f1); // cvt.s.w f1, f1 + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lwc1(f1, 12796, a0); // lwc1 f1, 12796(a0) + c->muls(f0, f0, f1); // mul.s f0, f0, f1 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->swc1(f0, 12796, a0); // swc1 f0, 12796(a0) + c->mfc1(a1, f0); // mfc1 a1, f0 + +block_43: + c->lwu(a0, 8, v1); // lwu a0, 8(v1) + c->dsll(a0, a0, 4); // dsll a0, a0, 4 + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->mov64(a0, v1); // or a0, v1, r0 + +block_44: + c->addiu(a0, r0, 7136); // addiu a0, r0, 7136 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + c->daddiu(v1, v1, 16); // daddiu v1, v1, 16 + c->sw(v1, 308, a0); // sw v1, 308(a0) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(t9, 7460, v1); // lwu t9, 7460(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + mercneric_convert::execute(c); + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->addiu(a0, r0, 1); // addiu a0, r0, 1 + c->lbu(a1, 6840, v1); // lbu a1, 6840(v1) + c->daddiu(a2, s1, 448); // daddiu a2, s1, 448 + c->lbu(a3, 6843, v1); // lbu a3, 6843(v1) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L49 + c->lqc2(vf1, 0, a2); // lqc2 vf1, 0(a2) + if (bc) {goto block_50;} // branch non-likely + + bc = c->sgpr64(a3) == 0; // beq a3, r0, L49 + c->vmax_bc(DEST::xyzw, BC::w, vf9, vf0, vf0); // vmaxw.xyzw vf9, vf0, vf0 + if (bc) {goto block_50;} // branch non-likely + + c->sb(a0, 6853, v1); // sb a0, 6853(v1) + c->lqc2(vf10, 7488, v1); // lqc2 vf10, 7488(v1) + c->lqc2(vf11, 7504, v1); // lqc2 vf11, 7504(v1) + c->vmula_bc(DEST::xyzw, BC::z, vf9, vf1); // vmulaz.xyzw acc, vf9, vf1 + c->lw(a0, 8, a2); // lw a0, 8(a2) + c->vmadda_bc(DEST::xyzw, BC::x, vf10, vf1); // vmaddax.xyzw acc, vf10, vf1 + bc = ((s64)c->sgpr64(a0)) < 0; // bltz a0, L48 + c->lw(v1, 7480, v1); // lw v1, 7480(v1) + if (bc) {goto block_48;} // branch non-likely + + c->vmadd_bc(DEST::xyzw, BC::y, vf1, vf11, vf1); // vmaddy.xyzw vf1, vf11, vf1 + c->mov128_gpr_vf(a0, vf1); // qmfc2.i a0, vf1 + c->pcgtw(a0, r0, a0); // pcgtw a0, r0, a0 + c->ppach(a0, r0, a0); // ppach a0, r0, a0 + bc = c->sgpr64(a0) == 0; // beq a0, r0, L49 + // DANGER jump to delay slot, this MUST be fixed manually! + // nop // sll r0, r0, 0 + if (bc) {goto block_50;} // branch non-likely + + +block_48: + // nop // sll r0, r0, 0 + call_addr = c->gprs[v1].du32[0]; // function call: + // nop // sll r0, r0, 0 + c->jalr(call_addr); // jalr ra, v1 + // high_speed_reject::execute(c); + +block_50: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(v1, 6836, v1); // lwu v1, 6836(v1) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L50 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_52;} // branch non-likely + + c->load_symbol2(t9, cache.generic_merc_query); // lw t9, generic-merc-query(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_52: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lhu(v1, 6844, v1); // lhu v1, 6844(v1) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L51 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_54;} // branch non-likely + + c->load_symbol2(t9, cache.generic_merc_death); // lw t9, generic-merc-death(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_54: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lw(v1, 7424, v1); // lw v1, 7424(v1) + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lwu(a0, 60, a0); // lwu a0, 60(a0) + c->dsubu(v1, v1, a0); // dsubu v1, v1, a0 + c->slt(v1, r0, v1); // slt v1, r0, v1 + bc = c->sgpr64(v1) != 0; // bne v1, r0, L52 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_56;} // branch non-likely + + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->sb(r0, 6853, v1); // sb r0, 6853(v1) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->sb(r0, 6843, v1); // sb r0, 6843(v1) + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + +block_56: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lbu(v1, 6853, v1); // lbu v1, 6853(v1) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L66 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_85;} // branch non-likely + + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6854, a0); // lbu a0, 6854(a0) + bc = c->sgpr64(a0) != c->sgpr64(v1); // bne a0, v1, L53 + // nop // sll r0, r0, 0 + if (bc) {goto block_59;} // branch non-likely + + c->load_symbol2(t9, cache.generic_warp_source); // lw t9, generic-warp-source(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + //beq r0, r0, L66 // beq r0, r0, L66 + // nop // sll r0, r0, 0 + goto block_85; // branch always + + +block_59: + c->addiu(v1, r0, 2); // addiu v1, r0, 2 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6854, a0); // lbu a0, 6854(a0) + bc = c->sgpr64(a0) != c->sgpr64(v1); // bne a0, v1, L56 + // nop // sll r0, r0, 0 + if (bc) {goto block_64;} // branch non-likely + + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lbu(v1, 6955, v1); // lbu v1, 6955(v1) + c->andi(v1, v1, 1); // andi v1, v1, 1 + bc = c->sgpr64(v1) == 0; // beq v1, r0, L54 + // nop // sll r0, r0, 0 + if (bc) {goto block_62;} // branch non-likely + + c->load_symbol2(t9, cache.generic_warp_envmap_dest);// lw t9, generic-warp-envmap-dest(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + //beq r0, r0, L55 // beq r0, r0, L55 + // nop // sll r0, r0, 0 + goto block_63; // branch always + + +block_62: + c->load_symbol2(t9, cache.generic_warp_dest); // lw t9, generic-warp-dest(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_warp_dest::execute(c); + c->mov64(v1, v0); // or v1, v0, r0 + +block_63: + //beq r0, r0, L66 // beq r0, r0, L66 + // nop // sll r0, r0, 0 + goto block_85; // branch always + + +block_64: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lbu(v1, 6955, v1); // lbu v1, 6955(v1) + c->andi(v1, v1, 1); // andi v1, v1, 1 + if (((s64)c->sgpr64(v1)) == ((s64)0)) { // beql v1, r0, L57 + c->mov64(v1, s7); // or v1, s7, r0 + goto block_67; + } + +block_66: + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->lbu(a0, 6852, a0); // lbu a0, 6852(a0) + c->andi(a0, a0, 1); // andi a0, a0, 1 + c->movz(v1, s7, a0); // movz v1, s7, a0 + +block_67: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L58 + // nop // sll r0, r0, 0 + if (bc) {goto block_69;} // branch non-likely + + c->load_symbol2(t9, cache.generic_translucent); // lw t9, generic-translucent(s7) + c->mov64(a0, s1); // or a0, s1, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + //beq r0, r0, L66 // beq r0, r0, L66 + // nop // sll r0, r0, 0 + goto block_85; // branch always + + +block_69: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lbu(v1, 6955, v1); // lbu v1, 6955(v1) + c->andi(v1, v1, 1); // andi v1, v1, 1 + if (((s64)c->sgpr64(v1)) == ((s64)0)) { // beql v1, r0, L59 + c->mov64(v1, s7); // or v1, s7, r0 + goto block_72; + } + +block_71: + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lbu(v1, 6858, v1); // lbu v1, 6858(v1) + c->daddiu(a0, v1, -1); // daddiu a0, v1, -1 + c->daddiu(v1, s7, 4); // daddiu v1, s7, 4 + c->movz(v1, s7, a0); // movz v1, s7, a0 + +block_72: + bc = c->sgpr64(s7) == c->sgpr64(v1); // beq s7, v1, L63 + // nop // sll r0, r0, 0 + if (bc) {goto block_80;} // branch non-likely + + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->mov64(v1, s1); // or v1, s1, r0 + c->daddiu(a0, at, 12064); // daddiu a0, at, 12064 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->lbu(a1, 6842, a1); // lbu a1, 6842(a1) + bc = c->sgpr64(a1) == 0; // beq a1, r0, L60 + c->mov64(a1, s7); // or a1, s7, r0 + if (bc) {goto block_75;} // branch non-likely + + c->addiu(a0, r0, 6960); // addiu a0, r0, 6960 + get_fake_spad_addr2(a1, cache.fake_scratchpad_data, 0, c);// lui a1, 28672 + c->daddu(a0, a0, a1); // daddu a0, a0, a1 + c->mov64(a0, a0); // or a0, a0, r0 + c->mov64(a1, a0); // or a1, a0, r0 + +block_75: + c->sw(r0, 48, at); // sw r0, 48(at) + c->sw(a0, 52, at); // sw a0, 52(at) + c->sw(v1, 44, at); // sw v1, 44(at) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(t9, 7468, v1); // lwu t9, 7468(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_prepare_dma_double::execute(c); + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(t9, 7472, v1); // lwu t9, 7472(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_light_proc::execute(c); + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(t9, 7476, v1); // lwu t9, 7476(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_envmap_proc::execute(c); + c->lw(v1, 24, at); // lw v1, 24(at) + c->lw(a0, 40, at); // lw a0, 40(at) + c->mov64(a3, v1); // or a3, v1, r0 + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lui(a2, 4096); // lui a2, 4096 + c->lwu(a1, 60, at); // lwu a1, 60(at) + c->ori(a2, a2, 53248); // ori a2, a2, 53248 + // c->lw(t1, 0, a2); // lw t1, 0(a2) + // nop // sll r0, r0, 0 + c->daddiu(t0, at, 92); // daddiu t0, at, 92 + c->andi(a3, a3, 16383); // andi a3, a3, 16383 + c->andi(t1, t1, 256); // andi t1, t1, 256 + // nop // sll r0, r0, 0 +// dma sync +// bc = c->sgpr64(t1) == 0; // beq t1, r0, L62 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_79;} // branch non-likely +// +// c->mov64(t1, a2); // or t1, a2, r0 +// // nop // sll r0, r0, 0 +// +// block_77: +// c->lw(t2, 0, t0); // lw t2, 0(t0) +// // nop // sll r0, r0, 0 +// c->lw(t3, 0, t1); // lw t3, 0(t1) +// // nop // sll r0, r0, 0 +// c->andi(t3, t3, 256); // andi t3, t3, 256 +// c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 +// bc = c->sgpr64(t3) != 0; // bne t3, r0, L61 +// c->sw(t2, 0, t0); // sw t2, 0(t0) +// if (bc) {goto block_77;} // branch non-likely +// +// c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + +block_79: + c->dsll(t0, a0, 4); // dsll t0, a0, 4 + // c->sw(a3, 128, a2); // sw a3, 128(a2) + sadr = c->sgpr64(a3); + // nop // sll r0, r0, 0 + // c->sw(a1, 16, a2); // sw a1, 16(a2) + madr = c->sgpr64(a1); + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + // c->sw(a0, 32, a2); // sw a0, 32(a2) + qwc = c->sgpr64(a0); + c->daddu(a0, a1, t0); // daddu a0, a1, t0 + // c->sw(a3, 0, a2); // sw a3, 0(a2) + spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc); + // nop // sll r0, r0, 0 + c->sw(a0, 60, at); // sw a0, 60(at) + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + c->xori(v1, v1, 4608); // xori v1, v1, 4608 + c->sw(v1, 24, at); // sw v1, 24(at) + //beq r0, r0, L66 // beq r0, r0, L66 + // nop // sll r0, r0, 0 + goto block_85; // branch always + + +block_80: + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->mov64(v1, s1); // or v1, s1, r0 + c->sw(r0, 48, at); // sw r0, 48(at) + c->sw(v1, 44, at); // sw v1, 44(at) + c->sh(r0, 56, at); // sh r0, 56(at) + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(t9, 7464, v1); // lwu t9, 7464(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_prepare_dma_single::execute_real(c); + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(t9, 7472, v1); // lwu t9, 7472(v1) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + // c->jalr(call_addr); // jalr ra, t9 + generic_light_proc::execute(c); + c->lw(v1, 24, at); // lw v1, 24(at) + c->lw(a0, 40, at); // lw a0, 40(at) + c->mov64(a3, v1); // or a3, v1, r0 + get_fake_spad_addr2(at, cache.fake_scratchpad_data, 0, c);// lui at, 28672 + c->lui(a2, 4096); // lui a2, 4096 + c->lwu(a1, 60, at); // lwu a1, 60(at) + c->ori(a2, a2, 53248); // ori a2, a2, 53248 + // c->lw(t1, 0, a2); // lw t1, 0(a2) + // nop // sll r0, r0, 0 + c->daddiu(t0, at, 92); // daddiu t0, at, 92 + c->andi(a3, a3, 16383); // andi a3, a3, 16383 + c->andi(t1, t1, 256); // andi t1, t1, 256 + // nop // sll r0, r0, 0 +// dma sync +// bc = c->sgpr64(t1) == 0; // beq t1, r0, L65 +// // nop // sll r0, r0, 0 +// if (bc) {goto block_84;} // branch non-likely +// +// c->mov64(t1, a2); // or t1, a2, r0 +// // nop // sll r0, r0, 0 +// +// block_82: +// c->lw(t2, 0, t0); // lw t2, 0(t0) +// // nop // sll r0, r0, 0 +// c->lw(t3, 0, t1); // lw t3, 0(t1) +// // nop // sll r0, r0, 0 +// c->andi(t3, t3, 256); // andi t3, t3, 256 +// c->daddiu(t2, t2, 1); // daddiu t2, t2, 1 +// bc = c->sgpr64(t3) != 0; // bne t3, r0, L64 +// c->sw(t2, 0, t0); // sw t2, 0(t0) +// if (bc) {goto block_82;} // branch non-likely + + c->gprs[t0].du64[0] = 0; // or t0, r0, r0 + +block_84: + c->dsll(t0, a0, 4); // dsll t0, a0, 4 + // c->sw(a3, 128, a2); // sw a3, 128(a2) + sadr = c->sgpr64(a3); + // nop // sll r0, r0, 0 + // c->sw(a1, 16, a2); // sw a1, 16(a2) + madr = c->sgpr64(a1); + c->addiu(a3, r0, 256); // addiu a3, r0, 256 + // c->sw(a0, 32, a2); // sw a0, 32(a2) + qwc = c->sgpr64(a0); + c->daddu(a0, a1, t0); // daddu a0, a1, t0 + // c->sw(a3, 0, a2); // sw a3, 0(a2) + spad_from_dma_no_sadr_off(cache.fake_scratchpad_data, madr, sadr, qwc); + // nop // sll r0, r0, 0 + c->sw(a0, 60, at); // sw a0, 60(at) + c->gprs[a0].du64[0] = 0; // or a0, r0, r0 + c->xori(v1, v1, 4608); // xori v1, v1, 4608 + c->sw(v1, 24, at); // sw v1, 24(at) + +block_85: + c->addiu(v1, r0, 1); // addiu v1, r0, 1 + c->dsubu(gp, v1, gp); // dsubu gp, v1, gp + c->daddiu(s5, s5, 1); // daddiu s5, s5, 1 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lhu(v1, 6946, v1); // lhu v1, 6946(v1) + bc = c->sgpr64(s5) != c->sgpr64(v1); // bne s5, v1, L67 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_87;} // branch non-likely + + c->addiu(s5, r0, 0); // addiu s5, r0, 0 + c->mov64(v1, s5); // or v1, s5, r0 + +block_87: + c->mov64(v1, s2); // or v1, s2, r0 + +block_88: + bc = c->sgpr64(s2) != 0; // bne s2, r0, L23 + // nop // sll r0, r0, 0 + if (bc) {goto block_4;} // branch non-likely + + c->mov64(v1, s7); // or v1, s7, r0 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(v1, 7456, v1); // lwu v1, 7456(v1) + c->sw(r0, 0, v1); // sw r0, 0(v1) + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 96, sp); // lq gp, 96(sp) + c->lq(s5, 80, sp); // lq s5, 80(sp) + c->lq(s4, 64, sp); // lq s4, 64(sp) + c->lq(s3, 48, sp); // lq s3, 48(sp) + c->lq(s2, 32, sp); // lq s2, 32(sp) + c->lq(s1, 16, sp); // lq s1, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 112); // daddiu sp, sp, 112 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.gsf_buffer = intern_from_c(-1, 0, "*gsf-buffer*").c(); + cache.generic_merc_death = intern_from_c(-1, 0, "generic-merc-death").c(); + cache.generic_merc_query = intern_from_c(-1, 0, "generic-merc-query").c(); + cache.generic_translucent = intern_from_c(-1, 0, "generic-translucent").c(); + cache.generic_warp_dest = intern_from_c(-1, 0, "generic-warp-dest").c(); + cache.generic_warp_envmap_dest = intern_from_c(-1, 0, "generic-warp-envmap-dest").c(); + cache.generic_warp_source = intern_from_c(-1, 0, "generic-warp-source").c(); + gLinkedFunctionTable.reg("generic-merc-execute-asm", execute, 256); +} + +} // namespace generic_merc_execute_asm +} // namespace Mips2C + +//--------------------------MIPS2C--------------------- +// clang-format off +#include "game/mips2c/mips2c_private.h" +#include "game/kernel/jak3/kscheme.h" +using ::jak3::intern_from_c; +namespace Mips2C::jak3 { +namespace generic_merc_do_chain { +struct Cache { + void* display; // *display* + void* fake_scratchpad_data; // *fake-scratchpad-data* + void* dma_bucket_insert_tag; // dma-bucket-insert-tag + void* generic_merc_execute_asm; // generic-merc-execute-asm + void* generic_work_init; // generic-work-init +} cache; + +u64 execute(void* ctxt) { + auto* c = (ExecutionContext*)ctxt; + bool bc = false; + u32 call_addr = 0; + c->daddiu(sp, sp, -80); // daddiu sp, sp, -80 + c->sd(ra, 0, sp); // sd ra, 0(sp) + c->sq(s3, 16, sp); // sq s3, 16(sp) + c->sq(s4, 32, sp); // sq s4, 32(sp) + c->sq(s5, 48, sp); // sq s5, 48(sp) + c->sq(gp, 64, sp); // sq gp, 64(sp) + c->mov64(gp, a0); // or gp, a0, r0 + c->mov64(s5, a1); // or s5, a1, r0 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + // printf("watch *0x%lx\n", (uintptr_t)(g_ee_main_mem + c->sgpr64(a0) + 60)); + c->sw(gp, 7456, v1); // sw gp, 7456(v1) + c->daddiu(a0, gp, 8); // daddiu a0, gp, 8 + c->lwu(v1, 0, gp); // lwu v1, 0(gp) + bc = c->sgpr64(v1) == 0; // beq v1, r0, L19 + c->mov64(v0, s7); // or v0, s7, r0 + if (bc) {goto block_7;} // branch non-likely + + c->load_symbol2(v1, cache.display); // lw v1, *display*(s7) + c->lw(v1, 0, v1); // lw v1, 0(v1) + c->dsll(v1, v1, 2); // dsll v1, v1, 2 + c->load_symbol2(a1, cache.display); // lw a1, *display*(s7) + c->daddu(v1, v1, a1); // daddu v1, v1, a1 + c->lwu(v1, 8, v1); // lwu v1, 8(v1) + c->lwu(s3, 36, v1); // lwu s3, 36(v1) + c->lwu(s4, 4, s3); // lwu s4, 4(s3) + c->load_symbol2(t9, cache.generic_work_init); // lw t9, generic-work-init(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->lwu(v1, 4, s3); // lwu v1, 4(s3) + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 + c->sw(v1, 60, a0); // sw v1, 60(a0) + c->load_symbol2(t9, cache.generic_merc_execute_asm);// lw t9, generic-merc-execute-asm(s7) + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + get_fake_spad_addr2(v1, cache.fake_scratchpad_data, 0, c);// lui v1, 28672 + c->lwu(v1, 60, v1); // lwu v1, 60(v1) + c->sw(v1, 4, s3); // sw v1, 4(s3) + c->lui(v1, 4096); // lui v1, 4096 + c->ori(v1, v1, 53248); // ori v1, v1, 53248 + get_fake_spad_addr2(a0, cache.fake_scratchpad_data, 0, c);// lui a0, 28672 +// dma sync +// c->ori(a0, a0, 92); // ori a0, a0, 92 +// c->lw(a1, 0, v1); // lw a1, 0(v1) +// c->andi(a1, a1, 256); // andi a1, a1, 256 +// bc = c->sgpr64(a1) == 0; // beq a1, r0, L17 +// DANGER jump to delay slot, this MUST be fixed manually! +// c->lw(a1, 0, a0); // lw a1, 0(a0) +// if (bc) {goto block_-1;} // branch non-likely +// +// +// block_2: +// c->lw(a1, 0, a0); // lw a1, 0(a0) +// // nop // sll r0, r0, 0 +// c->lw(a2, 0, v1); // lw a2, 0(v1) +// // nop // sll r0, r0, 0 +// c->andi(a2, a2, 256); // andi a2, a2, 256 +// c->daddiu(a1, a1, 1); // daddiu a1, a1, 1 +// bc = c->sgpr64(a2) != 0; // bne a2, r0, L16 +// c->sw(a1, 0, a0); // sw a1, 0(a0) +// if (bc) {goto block_2;} // branch non-likely + + c->gprs[v1].du64[0] = 0; // or v1, r0, r0 + c->lwu(a3, 4, s3); // lwu a3, 4(s3) + bc = c->sgpr64(s4) == c->sgpr64(a3); // beq s4, a3, L18 + c->mov64(v1, s7); // or v1, s7, r0 + if (bc) {goto block_6;} // branch non-likely + + c->lwu(v1, 4, s3); // lwu v1, 4(s3) + c->lui(a0, 8192); // lui a0, 8192 + c->sd(a0, 0, v1); // sd a0, 0(v1) + c->sw(r0, 8, v1); // sw r0, 8(v1) + c->sw(r0, 12, v1); // sw r0, 12(v1) + c->daddiu(v1, v1, 16); // daddiu v1, v1, 16 + c->sw(v1, 4, s3); // sw v1, 4(s3) + c->load_symbol2(t9, cache.dma_bucket_insert_tag); // lw t9, dma-bucket-insert-tag(s7) + c->load_symbol2(v1, cache.display); // lw v1, *display*(s7) + c->lw(v1, 0, v1); // lw v1, 0(v1) + c->dsll(v1, v1, 2); // dsll v1, v1, 2 + c->load_symbol2(a0, cache.display); // lw a0, *display*(s7) + c->daddu(v1, v1, a0); // daddu v1, v1, a0 + c->lwu(v1, 8, v1); // lwu v1, 8(v1) + c->lwu(a0, 40, v1); // lwu a0, 40(v1) + c->lw(a1, 16, gp); // lw a1, 16(gp) + c->mov64(a2, s4); // or a2, s4, r0 + call_addr = c->gprs[t9].du32[0]; // function call: + c->sll(v0, ra, 0); // sll v0, ra, 0 + c->jalr(call_addr); // jalr ra, t9 + c->mov64(v1, v0); // or v1, v0, r0 + +block_6: + c->lwu(v1, 4, s5); // lwu v1, 4(s5) + // Unknown instr: sync.l + // Unknown instr: cache dxwbin v1, 0 + // Unknown instr: sync.l + // Unknown instr: cache dxwbin v1, 1 + // Unknown instr: sync.l + c->gprs[v0].du64[0] = 0; // or v0, r0, r0 + +block_7: + c->ld(ra, 0, sp); // ld ra, 0(sp) + c->lq(gp, 64, sp); // lq gp, 64(sp) + c->lq(s5, 48, sp); // lq s5, 48(sp) + c->lq(s4, 32, sp); // lq s4, 32(sp) + c->lq(s3, 16, sp); // lq s3, 16(sp) + //jr ra // jr ra + c->daddiu(sp, sp, 80); // daddiu sp, sp, 80 + goto end_of_function; // return + + // nop // sll r0, r0, 0 + // nop // sll r0, r0, 0 +end_of_function: + return c->gprs[v0].du64[0]; +} + +void link() { + cache.display = intern_from_c(-1, 0, "*display*").c(); + cache.fake_scratchpad_data = intern_from_c(-1, 0, "*fake-scratchpad-data*").c(); + cache.dma_bucket_insert_tag = intern_from_c(-1, 0, "dma-bucket-insert-tag").c(); + cache.generic_merc_execute_asm = intern_from_c(-1, 0, "generic-merc-execute-asm").c(); + cache.generic_work_init = intern_from_c(-1, 0, "generic-work-init").c(); + gLinkedFunctionTable.reg("generic-merc-do-chain", execute, 128); +} + +} // namespace generic_merc_do_chain +} // namespace Mips2C + diff --git a/game/mips2c/mips2c_table.cpp b/game/mips2c/mips2c_table.cpp index eac8aed3cb..e724c5f354 100644 --- a/game/mips2c/mips2c_table.cpp +++ b/game/mips2c/mips2c_table.cpp @@ -357,6 +357,14 @@ namespace method_16_ocean { extern void link(); } namespace init_ocean_far_regs { extern void link(); } namespace draw_large_polygon_ocean { extern void link(); } namespace render_ocean_quad { extern void link(); } +namespace generic_merc_do_chain { extern void link(); } +namespace generic_merc_execute_asm { extern void link(); } +namespace generic_merc_death { extern void link(); } +namespace generic_merc_query { extern void link(); } +namespace generic_translucent { extern void link(); } +namespace high_speed_reject { extern void link(); } +namespace mercneric_convert { extern void link(); } +namespace generic_merc_init_asm { extern void link(); } } // clang-format on @@ -601,6 +609,11 @@ PerGameVersion>> gMips2C {"ocean", {jak3::init_ocean_far_regs::link, jak3::draw_large_polygon_ocean::link, jak3::render_ocean_quad::link}}, + {"generic-merc", + {jak3::generic_merc_do_chain::link, jak3::generic_merc_execute_asm::link, + jak3::generic_merc_death::link, jak3::generic_merc_query::link, + jak3::generic_translucent::link, jak3::high_speed_reject::link, + jak3::mercneric_convert::link, jak3::generic_merc_init_asm::link}}, }}; void LinkedFunctionTable::reg(const std::string& name, u64 (*exec)(void*), u32 stack_size) { diff --git a/goal_src/jak3/engine/anim/joint-mod-h.gc b/goal_src/jak3/engine/anim/joint-mod-h.gc index 190f76feb3..ec06048064 100644 --- a/goal_src/jak3/engine/anim/joint-mod-h.gc +++ b/goal_src/jak3/engine/anim/joint-mod-h.gc @@ -240,7 +240,7 @@ This is used to make jak look toward an enemy, for example." "Set up this joint-mod to modify the given joint of the given process. Will attach automatically if attached flag is set." (set! (-> this flags) flags) (set! (-> this node-index) (the-as int bone-idx)) - (set! (-> this proc) (the-as (pointer process-drawable) (process->ppointer proc))) + (set! (-> this proc) (process->ppointer proc)) (if (logtest? flags (joint-mod-base-flags attached)) (attach-callback this) ) diff --git a/goal_src/jak3/engine/collide/collide-edge-grab.gc b/goal_src/jak3/engine/collide/collide-edge-grab.gc index 4aa0b83196..9187eed359 100644 --- a/goal_src/jak3/engine/collide/collide-edge-grab.gc +++ b/goal_src/jak3/engine/collide/collide-edge-grab.gc @@ -22,7 +22,7 @@ (set! (-> *edge-grab-info* found-edge?) #f) (mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320) (let ((s5-0 *collide-edge-work*)) - (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this))) + (set! (-> s5-0 process) (process->ppointer this)) (set! (-> s5-0 num-verts) (the-as uint 0)) (set! (-> s5-0 num-edges) (the-as uint 0)) (set! (-> s5-0 num-tris) (the-as uint 0)) diff --git a/goal_src/jak3/engine/common-obs/particle-curves.gc b/goal_src/jak3/engine/common-obs/particle-curves.gc index 9fb1c24b29..c35c297a20 100644 --- a/goal_src/jak3/engine/common-obs/particle-curves.gc +++ b/goal_src/jak3/engine/common-obs/particle-curves.gc @@ -11,6 +11,7 @@ :bitfield #t (pcf0 0) (pcf1 1) + (pcf2 2) ) ;; ---particle-curve-flags diff --git a/goal_src/jak3/engine/debug/debug.gc b/goal_src/jak3/engine/debug/debug.gc index 23346f1d79..723f1f8f10 100644 --- a/goal_src/jak3/engine/debug/debug.gc +++ b/goal_src/jak3/engine/debug/debug.gc @@ -493,7 +493,8 @@ (set! (-> *debug-text-3d-trk* allocated-length) 512) (dotimes (gp-0 (-> *debug-text-3d-trk* allocated-length)) - (set! (-> *debug-text-3ds* gp-0 str) (new 'debug 'string 80 (the-as string #f))) + ;; og:preserve-this allocate larger strings for 3d text + (set! (-> *debug-text-3ds* gp-0 str) (new 'debug 'string (#if PC_BIG_MEMORY 255 80) (the-as string #f))) ) ) diff --git a/goal_src/jak3/engine/debug/menu.gc b/goal_src/jak3/engine/debug/menu.gc index 6802ebec9d..ebb1645189 100644 --- a/goal_src/jak3/engine/debug/menu.gc +++ b/goal_src/jak3/engine/debug/menu.gc @@ -67,7 +67,8 @@ (set! (-> gp-0 joypad-func) #f) (set! (-> gp-0 joypad-item) #f) (set! (-> gp-0 font) - (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) + ;; og:preserve-this pc flag + (new 'debug 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning pc-hack)) ) (set! (-> gp-0 joypad-number) 0) gp-0 @@ -935,11 +936,12 @@ (with-dma-buffer-add-bucket ((s0-0 (-> *display* frames (-> *display* on-screen) debug-buf)) (bucket-id debug-menu) ) + ;; og:preserve-this fixed for widescreen (draw-sprite2d-xy s0-0 - arg1 + (correct-x-int arg1) arg2 - (-> arg0 pix-width) + (correct-x-int (-> arg0 pix-width)) (-> arg0 pix-height) (new 'static 'rgba :a #x40) #x3fffff diff --git a/goal_src/jak3/engine/draw/drawable.gc b/goal_src/jak3/engine/draw/drawable.gc index e3ec07f109..3fac0133ac 100644 --- a/goal_src/jak3/engine/draw/drawable.gc +++ b/goal_src/jak3/engine/draw/drawable.gc @@ -1454,7 +1454,7 @@ (let ((gp-0 (-> *display* frames (-> *display* on-screen) global-buf))) (bones-init gp-0) (bones-mtx-calc-execute) - ;; (generic-merc-execute-all gp-0) + (generic-merc-execute-all gp-0) ;; (shadow-execute-all gp-0) ) (lightning-draw-all) diff --git a/goal_src/jak3/engine/entity/entity-table.gc b/goal_src/jak3/engine/entity/entity-table.gc index 529ca0fec5..c7e29b8fcf 100644 --- a/goal_src/jak3/engine/entity/entity-table.gc +++ b/goal_src/jak3/engine/entity/entity-table.gc @@ -25,7 +25,7 @@ :heap-size #x8000 ) (new 'static 'entity-info - :ptype (type-ref desert-chase-ring :method-count 0) + :ptype (type-ref desert-chase-ring :method-count 24) :pool '*16k-dead-pool* :heap-size #x4000 ) @@ -100,7 +100,7 @@ :heap-size #x4000 ) (new 'static 'entity-info - :ptype (type-ref mh-centipede :method-count 0) + :ptype (type-ref mh-centipede :method-count 43) :pool '*16k-dead-pool* :heap-size #x4000 ) diff --git a/goal_src/jak3/engine/game/game-h.gc b/goal_src/jak3/engine/game/game-h.gc index 805ae33656..eec1957d5a 100644 --- a/goal_src/jak3/engine/game/game-h.gc +++ b/goal_src/jak3/engine/game/game-h.gc @@ -112,7 +112,8 @@ This handles drawing, collision, animation, navigation, particles, sounds, physics, etc. The actual child classes will add most of the functionality, and this just serves as a common container for references to the `-control` objects for this object." - ((self process-drawable :override) + ((self process-drawable :override) + (ppointer (pointer process-drawable) :override) (root trsqv) (node-list cspace-array) (draw draw-control) diff --git a/goal_src/jak3/engine/game/main-h.gc b/goal_src/jak3/engine/game/main-h.gc index 58b35f2003..9e1fa0c505 100644 --- a/goal_src/jak3/engine/game/main-h.gc +++ b/goal_src/jak3/engine/game/main-h.gc @@ -95,23 +95,23 @@ ;; +++main-h:bot-marks-controls (defenum bot-marks-controls :type int64 - ; (all-off 0) - ; (course-spots 1) - ; (task-spots 2) - ; (all-on 3) - ; (bmc04 4) - ; (bmc05 5) - ; (bmc06 6) - ; (bmc07 7) - ; (bmc08 8) - ; (bmc09 9) - ; (bmc10 10) - ; (bmc11 11) - ; (bmc12 12) - ; (bmc13 13) - ; (bmc14 14) - ; (bmc15 15) - ; (bmc16 16) + (all-off 0) + (course-spots 1) + (task-spots 2) + (all-on 3) + (bmc04 4) + (bmc05 5) + (bmc06 6) + (bmc07 7) + (bmc08 8) + (bmc09 9) + (bmc10 10) + (bmc11 11) + (bmc12 12) + (bmc13 13) + (bmc14 14) + (bmc15 15) + (bmc16 16) ) ;; ---main-h:bot-marks-controls diff --git a/goal_src/jak3/engine/game/task/task-control-h.gc b/goal_src/jak3/engine/game/task/task-control-h.gc index 7d49900122..9be2e1871e 100644 --- a/goal_src/jak3/engine/game/task/task-control-h.gc +++ b/goal_src/jak3/engine/game/task/task-control-h.gc @@ -47,10 +47,12 @@ (define-extern *editable* (pointer editable-player)) ;; temporarily forward declared as symbols +(declare-type mission-squad-control basic) +(declare-type cty-attack-controller mission-squad-control) (define-extern *cty-faction-manager* symbol) -(define-extern *cty-attack-controller* symbol) +(define-extern *cty-attack-controller* cty-attack-controller) (set! *cty-faction-manager* #f) -(set! *cty-attack-controller* #f) +(set! *cty-attack-controller* (the cty-attack-controller #f)) (define-extern cty-attack-reset (function symbol symbol symbol none)) (define-extern setup-city-task-faction (function object)) diff --git a/goal_src/jak3/engine/gfx/font.gc b/goal_src/jak3/engine/gfx/font.gc index 46c0310378..f42466b276 100644 --- a/goal_src/jak3/engine/gfx/font.gc +++ b/goal_src/jak3/engine/gfx/font.gc @@ -20,6 +20,10 @@ ;; ERROR: Failed load: (set! a2-4 (l.wu (+ a2-3 2224))) at op 19 (defun draw-string ((arg0 string) (arg1 dma-buffer) (arg2 font-context)) (local-vars (v0-2 uint)) + (#when PC_PORT + ;; debug font scaling. + (unless (logtest? (-> arg2 flags) (font-flags large pc-hack)) + (*! (-> arg2 scale) (get-debug-font-scale-factor)))) (let ((v1-1 (the int (* 128.0 (-> arg2 alpha))))) (-> arg2 origin quad) (dotimes (a0-2 45) @@ -42,7 +46,23 @@ (the-as draw-string-result v0-2) ) -(def-mips2c get-string-length (function string font-context draw-string-result)) +; (def-mips2c get-string-length (function string font-context draw-string-result)) +(def-mips2c get-string-length-asm (function string font-context draw-string-result)) + +(#when PC_PORT +;; og:preserve-this get-string-length is an asm function, but for PC port we use a trampoline in order to inject hacks more easily +(defun get-string-length ((text string) (ctx font-context)) + "return the length of a string, in gs framebuffer units" + (let ((orig-scale (-> ctx scale)) + (result (begin (#when PC_PORT ;; debug font scaling. + (unless (logtest? (-> ctx flags) (font-flags large pc-hack)) + (*! (-> ctx scale) (get-debug-font-scale-factor)))) + (get-string-length-asm text ctx)))) + (set! (-> ctx scale) orig-scale) + result) + ) + +) (defun draw-string-xy ((arg0 string) (arg1 dma-buffer) (arg2 int) (arg3 int) (arg4 font-color) (arg5 font-flags)) (let ((s4-0 (new 'stack 'font-context *font-default-matrix* arg2 arg3 0.0 arg4 arg5))) diff --git a/goal_src/jak3/engine/gfx/generic/generic-merc.gc b/goal_src/jak3/engine/gfx/generic/generic-merc.gc index 59e1a79bdd..3b582c924b 100644 --- a/goal_src/jak3/engine/gfx/generic/generic-merc.gc +++ b/goal_src/jak3/engine/gfx/generic/generic-merc.gc @@ -7,3 +7,158 @@ ;; DECOMP BEGINS +(define mercneric-vu0-block (new 'static 'vu-function #|:length #xbe :origin #x118 :qlength 95|#)) + +(deftype invinitdata (structure) + ((count uint8) + (init-data uint8) + (init-addr uint16) + ) + :pack-me + ) + + +(define *inv-init-table* (new 'static 'inline-array invinitdata 8 + (new 'static 'invinitdata :count #x48 :init-addr #x1) + (new 'static 'invinitdata :count #x43 :init-data #xc :init-addr #x11) + (new 'static 'invinitdata :count #x3d :init-data #x18 :init-addr #x21) + (new 'static 'invinitdata :count #x38 :init-data #x22 :init-addr #xe0) + (new 'static 'invinitdata :count #x38 :init-data #x24 :init-addr #xe1) + (new 'static 'invinitdata :count #x33 :init-data #x30 :init-addr #xf1) + (new 'static 'invinitdata :count #x2e :init-data #x3a :init-addr #x190) + (new 'static 'invinitdata :count #x2d :init-data #x3c :init-addr #x191) + ) + ) + +(def-mips2c generic-merc-init-asm (function none)) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; ERROR: function has no type analysis. Cannot decompile. + +(def-mips2c mercneric-convert function) + +(def-mips2c high-speed-reject function) + +(def-mips2c generic-translucent (function gsf-buffer none)) + +(def-mips2c generic-merc-query function) + +(def-mips2c generic-merc-death function) + +(def-mips2c generic-merc-execute-asm function) + +(def-mips2c generic-merc-do-chain (function mercneric-chain dma-buffer pointer)) + +(defun generic-merc-execute-all ((arg0 dma-buffer)) + (local-vars (a0-24 int) (a0-26 int)) + (let ((s4-0 (-> *foreground* foreground-grid)) + (gp-0 (-> *display* frames (-> *display* on-screen) global-buf base)) + ) + (when *debug-segment* + (let ((s3-0 (-> *display* frames (-> *display* on-screen) profile-array data 0)) + (v1-14 'generic) + (s2-0 *profile-generic-color*) + ) + (when (and *dproc* *debug-segment*) + (let ((s1-0 (-> s3-0 data (-> s3-0 count)))) + (let ((s0-0 (-> s3-0 base-time))) + (set! (-> s1-0 name) v1-14) + (set! (-> s1-0 start-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s0-0)))) + ) + (set! (-> s1-0 depth) (the-as uint (-> s3-0 depth))) + (set! (-> s1-0 color) s2-0) + (set! (-> s3-0 segment (-> s3-0 depth)) s1-0) + ) + (set! (-> s3-0 count) (min 1023 (+ (-> s3-0 count) 1))) + (+! (-> s3-0 depth) 1) + (set! (-> s3-0 max-depth) (max (-> s3-0 max-depth) (-> s3-0 depth))) + ) + ) + 0 + ) + (let* ((v1-28 (-> *perf-stats* data 38)) + (a0-12 (-> v1-28 ctrl)) + ) + (+! (-> v1-28 count) 1) + (b! (zero? a0-12) cfg-9 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mtpc pcr0 0) + (.mtpc pcr1 0) + (.sync.l) + (.sync.p) + (.mtc0 Perf a0-12) + ) + (.sync.l) + (.sync.p) + (label cfg-9) + 0 + ;; og:preserve-this + (set! (-> (scratchpad-object generic-work) saves to-vu0-waits) (the-as uint 0)) + (set! (-> (scratchpad-object generic-work) saves to-spr-waits) (the-as uint 0)) + (set! (-> (scratchpad-object generic-work) saves from-spr-waits) (the-as uint 0)) + (flush-cache 0) + (generic-initialize-without-sync (-> *math-camera* perspective) *default-lights*) + (generic-merc-init-asm) + (set! (-> (scratchpad-object generic-work) in-buf merc shadow write-limit) + (the-as int (&+ (-> arg0 end) -262144)) + ) + (dotimes (s3-1 11) + (dotimes (s2-1 7) + (generic-merc-do-chain (-> s4-0 level-buckets s3-1 data s2-1 mercneric) arg0) + ) + ) + (generic-merc-do-chain (-> s4-0 warp-chain) arg0) + (let ((v1-43 (-> *perf-stats* data 38))) + (b! (zero? (-> v1-43 ctrl)) cfg-17 :delay (nop!)) + (.mtc0 Perf 0) + (.sync.l) + (.sync.p) + (.mfpc a0-24 pcr0) + (+! (-> v1-43 accum0) a0-24) + (.mfpc a0-26 pcr1) + (+! (-> v1-43 accum1) a0-26) + ) + (label cfg-17) + 0 + (update-wait-stats + (-> *perf-stats* data 38) + ;; og:preserve-this + (-> (scratchpad-object generic-work) saves to-vu0-waits) + (-> (scratchpad-object generic-work) saves to-spr-waits) + (-> (scratchpad-object generic-work) saves from-spr-waits) + ) + (when *debug-segment* + (let ((s5-1 (-> *display* frames (-> *display* on-screen) profile-array data 0))) + (when (and *dproc* *debug-segment*) + (let* ((v1-61 (+ (-> s5-1 depth) -1)) + (s4-1 (-> s5-1 segment v1-61)) + (s3-2 (-> s5-1 base-time)) + ) + (when (>= v1-61 0) + (set! (-> s4-1 end-time) (the-as int (- (timer-count (the-as timer-bank #x10000800)) (the-as uint s3-2)))) + (+! (-> s5-1 depth) -1) + ) + ) + ) + ) + 0 + ) + (let ((v1-66 *dma-mem-usage*)) + (when (nonzero? v1-66) + (set! (-> v1-66 length) (max 91 (-> v1-66 length))) + (set! (-> v1-66 data 90 name) "pris-generic") + (+! (-> v1-66 data 90 count) 1) + (+! (-> v1-66 data 90 used) + (&- (-> *display* frames (-> *display* on-screen) global-buf base) (the-as uint gp-0)) + ) + (set! (-> v1-66 data 90 total) (-> v1-66 data 90 used)) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/engine/gfx/generic/generic-vu1.gc b/goal_src/jak3/engine/gfx/generic/generic-vu1.gc index 4a2cc0d0a1..9b929578a0 100644 --- a/goal_src/jak3/engine/gfx/generic/generic-vu1.gc +++ b/goal_src/jak3/engine/gfx/generic/generic-vu1.gc @@ -186,7 +186,8 @@ (let* ((s3-0 (-> *display* frames (-> *display* on-screen) global-buf)) (s4-3 (-> s3-0 base)) ) - (fx-copy-buf s3-0) + ;; this is like the normal one, but runs fx-copy-buf first, copying the framebuffer. + ; (fx-copy-buf s3-0) (generic-init-buf s3-0 arg1) (let ((v1-14 (the-as object (-> s3-0 base)))) (set! (-> (the-as dma-packet v1-14) dma) (new 'static 'dma-tag :id (dma-tag-id next) :addr (-> s5-0 next))) diff --git a/goal_src/jak3/engine/gfx/hw/video-h.gc b/goal_src/jak3/engine/gfx/hw/video-h.gc index b1d698e6b4..6179df524d 100644 --- a/goal_src/jak3/engine/gfx/hw/video-h.gc +++ b/goal_src/jak3/engine/gfx/hw/video-h.gc @@ -39,3 +39,8 @@ :screen-pages-high 13 ) ) + +;; og:preserve-this added +(defmacro correct-x-int (pos) + `(the int (* (-> *video-params* relative-x-scale) (the float ,pos))) + ) \ No newline at end of file diff --git a/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc b/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc index 2612a95bb8..3f40cc925e 100644 --- a/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc +++ b/goal_src/jak3/engine/gfx/texture/texture-anim-h.gc @@ -73,7 +73,8 @@ (deftype texture-anim-array (array) - () + ((array-data texture-anim :dynamic) + ) (:methods (init! (_type_) _type_) (clear! (_type_) _type_) diff --git a/goal_src/jak3/engine/gfx/texture/texture.gc b/goal_src/jak3/engine/gfx/texture/texture.gc index b8c68a7edc..bdc5aa7130 100644 --- a/goal_src/jak3/engine/gfx/texture/texture.gc +++ b/goal_src/jak3/engine/gfx/texture/texture.gc @@ -1292,7 +1292,7 @@ (logior! (-> (&-> v1-7 0 mask data a1-1) 0) (-> a0-2 mask data a1-1)) ) ) - (set! (-> lev upload-size 0) (upload-vram-pages-pris + (set! (-> lev upload-size 0) (upload-vram-pages-pris-pc pool (-> pool segment-common) a2-1 diff --git a/goal_src/jak3/engine/gfx/warp.gc b/goal_src/jak3/engine/gfx/warp.gc index e1f201575b..4ef3649468 100644 --- a/goal_src/jak3/engine/gfx/warp.gc +++ b/goal_src/jak3/engine/gfx/warp.gc @@ -7,3 +7,30 @@ ;; DECOMP BEGINS +(defun fx-copy-buf ((arg0 dma-buffer)) + "draw the current framebuffer to tbp #x3300 (13056)" + (#when PC_PORT + (dma-buffer-add-cnt-vif2 arg0 1 (new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm #x10) ;; kind - buffer->texture + (new 'static 'vif-tag :cmd (vif-cmd pc-port) :imm #x3300)) + (dma-buffer-add-uint128 arg0 0) + ) + (set-dirty-mask! (-> *level* level-default) 5 #xd0000 #x4c000) + (none) + ) + +(define *warp-shader* (new 'static 'adgif-shader + :reg-0 #x6 + :reg-1 #x14 + :reg-2 #x34 + :reg-3 #x8 + :reg-4 #x42 + :tex0 (new 'static 'gs-tex0 :tbp0 #x4c0 :tbw #x8 :tw #x9 :th #x9 :tcc #x1) + :tex1 (new 'static 'gs-tex1 :mmag #x1) + :clamp (new 'static 'gs-clamp + :wms (gs-tex-wrap-mode region-clamp) + :wmt (gs-tex-wrap-mode region-clamp) + :maxu #x1ff + :maxv #x19f + ) + ) + ) diff --git a/goal_src/jak3/engine/math/matrix-compose.gc b/goal_src/jak3/engine/math/matrix-compose.gc index 7f8e1688b1..1fac1e1a2e 100644 --- a/goal_src/jak3/engine/math/matrix-compose.gc +++ b/goal_src/jak3/engine/math/matrix-compose.gc @@ -83,10 +83,10 @@ arg0 ) -(defun matrix-f-compose ((arg0 matrix) (arg1 vector) (arg2 float)) +(defun matrix-f-compose ((arg0 matrix) (arg1 vector)) (set! (-> arg0 fvec quad) (-> arg1 quad)) - (let ((a2-1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) - (matrix-f-u-compose arg0 arg1 a2-1) + (let ((a2-0 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) + (matrix-f-u-compose arg0 arg1 a2-0) ) arg0 ) diff --git a/goal_src/jak3/engine/physics/trajectory.gc b/goal_src/jak3/engine/physics/trajectory.gc index 62734c904b..abf4e7910b 100644 --- a/goal_src/jak3/engine/physics/trajectory.gc +++ b/goal_src/jak3/engine/physics/trajectory.gc @@ -142,7 +142,7 @@ (defmethod initialize ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) (set! (-> this start-time) (the-as uint (current-time))) - (set! (-> this process) (the-as (pointer process-drawable) (process->ppointer arg0))) + (set! (-> this process) (process->ppointer arg0)) (set! (-> this joint) arg1) (set! (-> this radius) arg2) (set! (-> this collide-with) (logclear arg3 (collide-spec water))) diff --git a/goal_src/jak3/engine/process-drawable/process-drawable.gc b/goal_src/jak3/engine/process-drawable/process-drawable.gc index 67b3a2a6ae..64dde55087 100644 --- a/goal_src/jak3/engine/process-drawable/process-drawable.gc +++ b/goal_src/jak3/engine/process-drawable/process-drawable.gc @@ -1634,7 +1634,7 @@ (defmethod new top-anim-joint-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> gp-0 process) (the-as (pointer process-drawable) (process->ppointer arg0))) + (set! (-> gp-0 process) (process->ppointer arg0)) (set! (-> gp-0 interp-select 0) (the-as uint (-> arg0 skel interp-select 0))) (set! (-> gp-0 interp-select 1) (the-as uint (-> arg0 skel interp-select 1))) (set! (-> gp-0 base-anim-speed) 1.0) diff --git a/goal_src/jak3/engine/process-drawable/process-focusable.gc b/goal_src/jak3/engine/process-drawable/process-focusable.gc index 842f7b6b66..909cf52b16 100644 --- a/goal_src/jak3/engine/process-drawable/process-focusable.gc +++ b/goal_src/jak3/engine/process-drawable/process-focusable.gc @@ -81,8 +81,9 @@ ;; DECOMP BEGINS (deftype process-focusable (process-drawable) - ((self process-focusable :override) - (root collide-shape :override) + ((self process-focusable :override) + (ppointer (pointer process-focusable) :override) + (root collide-shape :override) (focus-status focus-status) ) (:methods diff --git a/goal_src/jak3/engine/process-drawable/simple-focus.gc b/goal_src/jak3/engine/process-drawable/simple-focus.gc index 8f63c53056..1ed77b0293 100644 --- a/goal_src/jak3/engine/process-drawable/simple-focus.gc +++ b/goal_src/jak3/engine/process-drawable/simple-focus.gc @@ -7,3 +7,51 @@ ;; DECOMP BEGINS +(deftype simple-focus (process-focusable) + ((first-time? symbol) + ) + (:state-methods + idle + ) + ) + + +(defmethod get-trans ((this simple-focus) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +(defmethod run-logic? ((this simple-focus)) + "Should this process be run? Checked by execute-process-tree." + (when (-> this first-time?) + (set! (-> this first-time?) #f) + #t + ) + ) + +(defstate idle (simple-focus) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-trans) + (let ((v0-0 (-> self root trans))) + (set! (-> v0-0 quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 + ) + ) + ) + ) + :code sleep-code + ) + +(defbehavior simple-focus-init-by-other simple-focus () + (let ((gp-0 (new 'process 'trsqv))) + (set! (-> self root) (the-as collide-shape gp-0)) + (vector-identity! (-> gp-0 scale)) + (quaternion-identity! (-> gp-0 quat)) + ) + (logclear! (-> self mask) (process-mask enemy)) + (set! (-> self first-time?) #t) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) diff --git a/goal_src/jak3/engine/target/board/target-board.gc b/goal_src/jak3/engine/target/board/target-board.gc index a636ac0d26..af3c4cc26b 100644 --- a/goal_src/jak3/engine/target/board/target-board.gc +++ b/goal_src/jak3/engine/target/board/target-board.gc @@ -829,7 +829,7 @@ (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 process) (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)) diff --git a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc index 4d8364d0a0..d4a190ff97 100644 --- a/goal_src/jak3/engine/target/gun/gun-dark-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-dark-shot.gc @@ -563,13 +563,8 @@ ) (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((t9-10 vector-normalize-copy!) - (a0-12 (new 'stack-no-clear 'vector)) - (a1-4 (-> self root transv)) - (a2-3 1.0) - (a1-5 (t9-10 a0-12 a1-4 a2-3)) - ) - (matrix-f-compose gp-1 a1-5 a2-3) + (let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0))) + (matrix-f-compose gp-1 a1-5) ) (matrix->quaternion (-> self root quat) gp-1) ) diff --git a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc index c6c8630097..86e95cd852 100644 --- a/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc +++ b/goal_src/jak3/engine/target/gun/gun-yellow-shot.gc @@ -929,29 +929,23 @@ (set! (-> s4-1 quad) (-> self gun fire-dir-out quad)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) - (let ((t9-9 draw-beam) - (a0-38 (-> *part-id-table* 297)) - (a1-9 (-> gp-0 fire-point)) - (a2-5 s4-1) - ) - (t9-9 a0-38 a1-9 a2-5 #f) - (let ((s5-1 (new 'stack-no-clear 'matrix))) - (matrix-f-compose s5-1 s4-1 (the-as float a2-5)) - (set! (-> s5-1 trans quad) (-> gp-0 fire-point quad)) - (let ((v1-62 - (if (logtest? (-> *part-group-id-table* 100 flags) (sp-group-flag sp13)) - (part-tracker-spawn - part-tracker-subsampler - :to *entity-pool* - :group (-> *part-group-id-table* 100) - :mat-joint s5-1 - ) - (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 100) :mat-joint s5-1) + (draw-beam (-> *part-id-table* 297) (-> gp-0 fire-point) s4-1 #f) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (matrix-f-compose s5-1 s4-1) + (set! (-> s5-1 trans quad) (-> gp-0 fire-point quad)) + (let ((v1-62 + (if (logtest? (-> *part-group-id-table* 100 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 100) + :mat-joint s5-1 ) - ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 100) :mat-joint s5-1) + ) ) - (send-event (ppointer->process v1-62) 'clock self) - ) + ) + (send-event (ppointer->process v1-62) 'clock self) ) ) ) diff --git a/goal_src/jak3/engine/target/target-darkjak.gc b/goal_src/jak3/engine/target/target-darkjak.gc index f89b9ebe6c..26867cb5d7 100644 --- a/goal_src/jak3/engine/target/target-darkjak.gc +++ b/goal_src/jak3/engine/target/target-darkjak.gc @@ -616,7 +616,7 @@ (defbehavior target-darkjak-setup target ((arg0 symbol)) (when (zero? (-> self darkjak)) (set! (-> self darkjak) (new 'process 'darkjak-info)) - (set! (-> self darkjak process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self darkjak process) (process->ppointer self)) (let* ((v1-4 (-> self game)) (a0-5 (+ (-> v1-4 attack-id) 1)) ) diff --git a/goal_src/jak3/engine/target/target-gun.gc b/goal_src/jak3/engine/target/target-gun.gc index 2133207679..f947e1d67a 100644 --- a/goal_src/jak3/engine/target/target-gun.gc +++ b/goal_src/jak3/engine/target/target-gun.gc @@ -206,7 +206,7 @@ (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 process) (process->ppointer self)) (set! (-> self gun strip) #f) (set! (-> self gun uv-slide) 0.0) (set! (-> self gun gun) (the-as (pointer gun) #f)) diff --git a/goal_src/jak3/engine/target/target-h.gc b/goal_src/jak3/engine/target/target-h.gc index 1bfdca6815..579f5fc78c 100644 --- a/goal_src/jak3/engine/target/target-h.gc +++ b/goal_src/jak3/engine/target/target-h.gc @@ -262,6 +262,7 @@ (deftype target (process-focusable) ((self target :override) + (ppointer (pointer target) :override) (fact fact-info-target :override) (control control-info :overlay-at root) (skel2 joint-control) diff --git a/goal_src/jak3/engine/target/target-lightjak.gc b/goal_src/jak3/engine/target/target-lightjak.gc index 4d48dbece1..c42280840c 100644 --- a/goal_src/jak3/engine/target/target-lightjak.gc +++ b/goal_src/jak3/engine/target/target-lightjak.gc @@ -960,7 +960,7 @@ (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))) + (set! (-> self lightjak process) (process->ppointer self)) (let* ((v1-4 (-> self game)) (a0-5 (+ (-> v1-4 attack-id) 1)) ) diff --git a/goal_src/jak3/game.gp b/goal_src/jak3/game.gp index 93239a8bc1..0beec704de 100644 --- a/goal_src/jak3/game.gp +++ b/goal_src/jak3/game.gp @@ -136,7 +136,7 @@ (cgo-file "desinter.gd" common-dep) ; (cgo-file "desjump.gd" common-dep) (cgo-file "desliz.gd" common-dep) -; (cgo-file "desoasis.gd" common-dep) +(cgo-file "desoasis.gd" common-dep) (cgo-file "desrace1.gd" common-dep) (cgo-file "desrace2.gd" common-dep) (cgo-file "desrally.gd" common-dep) @@ -229,11 +229,12 @@ (cgo-file "frsta.gd" common-dep) (cgo-file "frstb.gd" common-dep) (cgo-file "frstx.gd" common-dep) -; ;; factory -; (cgo-file "factorya.gd" common-dep) -; (cgo-file "facb.gd" common-dep) -; (cgo-file "facc.gd" common-dep) -; (cgo-file "facd.gd" common-dep) +;; factory +(cgo-file "lfacrm1.gd" common-dep) +(cgo-file "factorya.gd" common-dep) +(cgo-file "facb.gd" common-dep) +(cgo-file "facc.gd" common-dep) +(cgo-file "facd.gd" common-dep) ; ;; tower (cgo-file "towb.gd" common-dep) (cgo-file "towera.gd" common-dep) @@ -250,22 +251,22 @@ ; (cgo-file "rubb.gd" common-dep) ; (cgo-file "rubc.gd" common-dep) ; ;; comb -; (cgo-file "comba.gd" common-dep) -; (cgo-file "combb.gd" common-dep) -; (cgo-file "combc.gd" common-dep) -; (cgo-file "combd.gd" common-dep) -; (cgo-file "combe.gd" common-dep) -; (cgo-file "combn.gd" common-dep) -; (cgo-file "combx.gd" common-dep) -; (cgo-file "raila.gd" common-dep) -; (cgo-file "railb.gd" common-dep) -; (cgo-file "railb2.gd" common-dep) -; (cgo-file "railc.gd" common-dep) -; (cgo-file "railcst.gd" common-dep) -; (cgo-file "raild.gd" common-dep) -; (cgo-file "raile.gd" common-dep) -; (cgo-file "railf.gd" common-dep) -; (cgo-file "railx.gd" common-dep) +(cgo-file "comba.gd" common-dep) +(cgo-file "combb.gd" common-dep) +(cgo-file "combc.gd" common-dep) +(cgo-file "combd.gd" common-dep) +(cgo-file "combe.gd" common-dep) +(cgo-file "combn.gd" common-dep) +(cgo-file "combx.gd" common-dep) +(cgo-file "raila.gd" common-dep) +(cgo-file "railb.gd" common-dep) +(cgo-file "railb2.gd" common-dep) +(cgo-file "railc.gd" common-dep) +(cgo-file "railcst.gd" common-dep) +(cgo-file "raild.gd" common-dep) +(cgo-file "raile.gd" common-dep) +(cgo-file "railf.gd" common-dep) +(cgo-file "railx.gd" common-dep) ; ;; precursor ; (cgo-file "preca.gd" common-dep) ; (cgo-file "precb.gd" common-dep) @@ -292,22 +293,22 @@ (cgo-file "halfpipe.gd" common-dep) ; ;; borrow ; (cgo-file "lashelin.gd" common-dep) -; (cgo-file "lbbring1.gd" common-dep) -; (cgo-file "lbbring2.gd" common-dep) -; (cgo-file "lbbring3.gd" common-dep) -; (cgo-file "lbbring4.gd" common-dep) -; (cgo-file "lbbring5.gd" common-dep) -; (cgo-file "lbbring6.gd" common-dep) -; (cgo-file "lbbsdrp1.gd" common-dep) -; (cgo-file "lbbsdrp2.gd" common-dep) -; (cgo-file "lbbsdrp3.gd" common-dep) -; (cgo-file "lbbspid.gd" common-dep) -; (cgo-file "lbbspirt.gd" common-dep) -; (cgo-file "lbbsprt2.gd" common-dep) -; (cgo-file "lbbsprt3.gd" common-dep) -; (cgo-file "lbbtcha1.gd" common-dep) -; (cgo-file "lbbtcha2.gd" common-dep) -; (cgo-file "lbbtcha3.gd" common-dep) +(cgo-file "lbbring1.gd" common-dep) +(cgo-file "lbbring2.gd" common-dep) +(cgo-file "lbbring3.gd" common-dep) +(cgo-file "lbbring4.gd" common-dep) +(cgo-file "lbbring5.gd" common-dep) +(cgo-file "lbbring6.gd" common-dep) +(cgo-file "lbbsdrp1.gd" common-dep) +(cgo-file "lbbsdrp2.gd" common-dep) +(cgo-file "lbbsdrp3.gd" common-dep) +(cgo-file "lbbspid.gd" common-dep) +(cgo-file "lbbspirt.gd" common-dep) +(cgo-file "lbbsprt2.gd" common-dep) +(cgo-file "lbbsprt3.gd" common-dep) +(cgo-file "lbbtcha1.gd" common-dep) +(cgo-file "lbbtcha2.gd" common-dep) +(cgo-file "lbbtcha3.gd" common-dep) ; (cgo-file "lbiped.gd" common-dep) ; (cgo-file "lblowcst.gd" common-dep) ; (cgo-file "lblowtkg.gd" common-dep) @@ -316,7 +317,7 @@ ; (cgo-file "lcitysml.gd" common-dep) ; (cgo-file "lctyass.gd" common-dep) ; (cgo-file "lctyblow.gd" common-dep) -; (cgo-file "lctydest.gd" common-dep) +(cgo-file "lctydest.gd" common-dep) ; (cgo-file "lctyhijk.gd" common-dep) ; (cgo-file "lctypalt.gd" common-dep) ; (cgo-file "lctypatk.gd" common-dep) @@ -330,13 +331,12 @@ ; (cgo-file "ldesgcst.gd" common-dep) ; (cgo-file "ldmpckgn.gd" common-dep) ; (cgo-file "lerrol.gd" common-dep) -; (cgo-file "lfacb.gd" common-dep) +(cgo-file "lfacb.gd" common-dep) (cgo-file "lfaccar.gd" common-dep) -; (cgo-file "lfaccity.gd" common-dep) -; (cgo-file "lfaco.gd" common-dep) -; (cgo-file "lfacrm1.gd" common-dep) -; (cgo-file "lfacrm2.gd" common-dep) -; (cgo-file "lfactory.gd" common-dep) +(cgo-file "lfaccity.gd" common-dep) +(cgo-file "lfaco.gd" common-dep) +(cgo-file "lfacrm2.gd" common-dep) +(cgo-file "lfactory.gd" common-dep) (cgo-file "lform.gd" common-dep) (cgo-file "lforp.gd" common-dep) ; (cgo-file "lforring.gd" common-dep) @@ -360,10 +360,10 @@ ; (cgo-file "lmech.gd" common-dep) ; (cgo-file "lmhca.gd" common-dep) ; (cgo-file "lmhcb.gd" common-dep) -; (cgo-file "lnstcst.gd" common-dep) -; (cgo-file "lnstoa.gd" common-dep) -; (cgo-file "lnstobb.gd" common-dep) -; (cgo-file "lnstobc.gd" common-dep) +(cgo-file "lnstcst.gd" common-dep) +(cgo-file "lnstoa.gd" common-dep) +(cgo-file "lnstobb.gd" common-dep) +(cgo-file "lnstobc.gd" common-dep) ; (cgo-file "loninsim.gd" common-dep) ; (cgo-file "loutro.gd" common-dep) ; (cgo-file "loutro2.gd" common-dep) @@ -384,12 +384,12 @@ ; (cgo-file "ltorn.gd" common-dep) ; (cgo-file "ltornjnx.gd" common-dep) ; (cgo-file "ltornsam.gd" common-dep) -; (cgo-file "ltowa.gd" common-dep) -; (cgo-file "ltowb.gd" common-dep) +(cgo-file "ltowa.gd" common-dep) +(cgo-file "ltowb.gd" common-dep) ; (cgo-file "ltowcity.gd" common-dep) ; (cgo-file "ltrtwhls.gd" common-dep) ; (cgo-file "lvincst.gd" common-dep) -; (cgo-file "lwasbbv.gd" common-dep) +(cgo-file "lwasbbv.gd" common-dep) (cgo-file "lwassig.gd" common-dep) ; (cgo-file "lwlandm.gd" common-dep) ; (cgo-file "lwstdpck.gd" common-dep) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc index 3208ade191..1c1fd7ee89 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle-h.gc @@ -658,7 +658,7 @@ (vehicle-method-88 (_type_ vehicle-controls) none) (init-reverse (_type_ vehicle-controls) none) (control-hook-ai (_type_ vehicle-controls) none) - (control-hook-player (_type_ vehicle-controls) none) + (control-hook-player (_type_) none) (vehicle-method-92 (_type_ vehicle-controls) none) (vehicle-method-93 (_type_) none) (vehicle-method-94 (_type_) none) diff --git a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc index cb0652342a..0f75dc3329 100644 --- a/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc +++ b/goal_src/jak3/levels/city/traffic/vehicle/vehicle.gc @@ -207,7 +207,7 @@ (none) ) -(defmethod control-hook-player ((this vehicle) (arg0 vehicle-controls)) +(defmethod control-hook-player ((this vehicle)) (let ((gp-0 (new 'stack-no-clear 'vehicle-controls))) (mem-set32! (&-> gp-0 steering) 6 0) (cond diff --git a/goal_src/jak3/levels/comb/comb-field.gc b/goal_src/jak3/levels/comb/comb-field.gc index 4e46cc60cc..88613fcb66 100644 --- a/goal_src/jak3/levels/comb/comb-field.gc +++ b/goal_src/jak3/levels/comb/comb-field.gc @@ -7,3 +7,345 @@ ;; DECOMP BEGINS +(deftype comb-field (process-drawable) + ((root collide-shape :override) + (pass pickup-type) + (incoming-attack-id uint32) + (next-message-time time-frame) + (message int32) + (plane plane :inline) + (color vector :inline) + (target-pos vector :inline) + (hum-sound-id sound-id) + (flash float) + (touch-count int32) + (touch-time time-frame) + (breach symbol) + ) + (:state-methods + idle-close + ) + (:methods + (init-collision! (_type_ path-control float) none) + (on-jak-touch (_type_) none) + (play-hum (_type_) none) + ) + ) + + +(defskelgroup skel-comb-field security-wall security-wall-lod0-jg security-wall-idle-ja + ((security-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100.1) + ) + +(defmethod on-jak-touch ((this comb-field)) + (when (time-elapsed? (-> this touch-time) (seconds 0.25)) + (set-time! (-> this touch-time)) + (sound-play "barrier-deflect") + ) + 0 + (none) + ) + +(defmethod play-hum ((this comb-field)) + (let ((v1-0 *target*)) + (when v1-0 + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> v1-0 control trans))) + (f1-0 655360.0) + ) + (cond + ((< f0-0 (* f1-0 f1-0)) + (if (zero? (-> this hum-sound-id)) + (set! (-> this hum-sound-id) (new-sound-id)) + ) + (sound-play "barrier-loop" :id (-> this hum-sound-id)) + ) + (else + (sound-stop (-> this hum-sound-id)) + (set! (-> this hum-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defstate idle-close (comb-field) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (set! v0-0 (-> self root backup-collide-with)) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + ) + v0-0 + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (('attack) + (let ((v1-5 (the-as attack-info (-> block param 1)))) + (when (!= (-> v1-5 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> v1-5 id)) + (let* ((gp-0 proc) + (s4-0 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when s4-0 + (let ((gp-1 (process-spawn + manipy + :init manipy-init + (-> (the-as process-drawable s4-0) root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when gp-1 + (send-event (ppointer->process gp-1) 'anim-mode 'play1) + (send-event (ppointer->process gp-1) 'speed 1.5) + (send-event (ppointer->process gp-1) 'art-joint-anim "generic-ripples-idle" 0) + (set-vector! (-> (the-as process-drawable (-> gp-1 0)) root scale) 1.0 1.0 1.0 1.0) + (quaternion-rotate-local-x! (-> (the-as process-drawable (-> gp-1 0)) root quat) (-> self root quat) -16384.0) + (let ((v1-43 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a0-22 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a1-17 *up-vector*)) + (let ((a2-8 8192.0)) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-17 quad)) + ) + (.lvf vf4 (&-> a0-22 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-43 quad) vf6) + ) + (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> gp-1 0)) root trans) (the-as vector (-> self plane))))) + (let ((v1-50 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a0-26 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a1-18 (-> self plane))) + (let ((a2-9 (- f0-6))) + (.mov vf7 a2-9) + ) + (.lvf vf5 (&-> a1-18 quad)) + ) + (.lvf vf4 (&-> a0-26 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-50 quad) vf6) + ) + (let ((v1-53 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a0-29 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a1-19 (-> self plane))) + (let ((a2-11 (the-as float (if (< 0.0 f0-6) + -2048.0 + 2048.0 + ) + ) + ) + ) + (.mov vf7 a2-11) + ) + (.lvf vf5 (&-> a1-19 quad)) + ) + (.lvf vf4 (&-> a0-29 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-53 quad) vf6) + ) + ) + (send-event (ppointer->process gp-1) 'trans-hook (lambda () #f)) + ) + ) + ) + ) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (set! v0-0 (+ (-> self touch-count) 1)) + (set! (-> self touch-count) (the-as int v0-0)) + v0-0 + ) + ) + ) + (('touched) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (let* ((gp-3 proc) + (v1-75 (if (type? gp-3 process-focusable) + gp-3 + ) + ) + ) + (when v1-75 + (let* ((s5-1 (-> (the-as process-drawable v1-75) root)) + (gp-4 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (when gp-4 + (if (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec jak)) + (on-jak-touch self) + ) + (when (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec vehicle-sphere)) + (when (not (-> self breach)) + (sound-play "barrier-cross") + (set! v0-0 #t) + (set! (-> self breach) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (play-hum self) + ) + :code (behavior () + (until #f + (let ((f30-0 (calc-fade-from-fog (-> self root trans))) + (a0-1 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-1 (-> self color) f30-0) + (set-comb-field-color! a0-1) + (vector-float*! gp-0 (-> self color) (* f30-0 (-> self flash))) + (seek! (-> self flash) 0.0 (seconds-per-frame)) + (if (nonzero? (-> self touch-count)) + (+! (-> self touch-count) -1) + ) + (set-comb-field-flash! gp-0) + ) + (suspend) + ) + #f + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod init-collision! ((this comb-field) (arg0 path-control) (arg1 float)) + (let ((s3-0 (new 'static 'vector)) + (s4-0 (new 'static 'vector)) + ) + 0.0 + (get-point-in-path! arg0 s3-0 0.0 'exact) + (get-point-in-path! arg0 s4-0 1.0 'exact) + (* 0.5 (vector-vector-distance s3-0 s4-0)) + (let ((s2-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s2-1 penetrated-by) (penetrate vehicle)) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s2-1 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle blocking-plane camera-blocker)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set! (-> s2-1 total-prims) (the-as uint 1)) + (set! (-> s2-1 root-prim) v1-8) + ) + (set! (-> s2-1 nav-radius) (* 0.75 (-> s2-1 root-prim local-sphere w))) + (let ((v1-11 (-> s2-1 root-prim))) + (set! (-> s2-1 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s2-1 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s2-1) + ) + (let ((s2-2 (new 'stack-no-clear 'matrix)) + (s1-0 (-> this root)) + ) + (vector+! (-> s1-0 trans) s3-0 s4-0) + (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) + (vector-! (-> s2-2 rvec) s4-0 s3-0) + (let ((f30-1 (vector-normalize-ret-len! (-> s2-2 rvec) 1.0))) + (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) + (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale z) 1.0) + (set! (-> s2-2 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-cross! (-> s2-2 fvec) (-> s2-2 rvec) (-> s2-2 uvec)) + (vector-normalize! (-> s2-2 fvec) 1.0) + (matrix->quaternion (-> s1-0 quat) s2-2) + (set! (-> this plane quad) (-> s2-2 fvec quad)) + (set! (-> this plane w) (- (vector-dot (-> s2-2 fvec) (-> this root trans)))) + (let ((v0-8 (-> this root root-prim local-sphere))) + (set! (-> v0-8 x) 0.0) + (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 z) 0.0) + (let ((f0-18 0.5) + (f1-5 (* f30-1 f30-1)) + (f2-1 arg1) + ) + (set! (-> v0-8 w) (* f0-18 (sqrtf (+ f1-5 (* f2-1 f2-1))))) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod init-from-entity! ((this comb-field) (arg0 entity-actor)) + (set! (-> this breach) #f) + (set! (-> this hum-sound-id) (new 'static 'sound-id)) + (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) + (let ((v1-3 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))) + (set! (-> this path) v1-3) + (if (or (not v1-3) (!= (-> v1-3 curve num-cverts) 2)) + (go process-drawable-art-error "bad path") + ) + ) + (init-collision! this (-> this path) 204800.0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-field" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this root event-self) 'touched) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set-comb-field-texture-masks! (the-as vector (-> this draw mgeo header texture-usage-group data 4))) + (set-vector! (-> this color) 0.0 0.5 1.0 1.0) + (set-comb-field-color! (-> this color)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) + (transform-post) + (go (method-of-object this idle-close)) + ) diff --git a/goal_src/jak3/levels/comb/comb-mood.gc b/goal_src/jak3/levels/comb/comb-mood.gc index 4c823086d8..85f754f5a4 100644 --- a/goal_src/jak3/levels/comb/comb-mood.gc +++ b/goal_src/jak3/levels/comb/comb-mood.gc @@ -7,3 +7,285 @@ ;; DECOMP BEGINS +(deftype comb-states (structure) + () + ) + + +(defun init-mood-comb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 1))) + (let ((a0-1 (-> v1-0 dir0))) + (set! (-> a0-1 direction x) 0.0) + (set! (-> a0-1 direction y) 1.0) + (set! (-> a0-1 direction z) 0.0) + (set! (-> a0-1 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 dir0 extra x) 0.75) + (set! (-> v1-0 dir1 extra x) 0.0) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 0.25) + ) + ) + +(defbehavior update-mood-comb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (let* ((s5-0 (camera-pos)) + (f0-1 (fmin + (vector-vector-distance s5-0 (new 'static 'vector :x 368640.0 :z 40960.0 :w 1.0)) + (vector-vector-distance s5-0 (new 'static 'vector :x 14274560.0 :y -167936.0 :z 614400.0 :w 1.0)) + ) + ) + ) + (when (< f0-1 716800.0) + (let ((f30-1 (fmax 0.0 (fmin 1.0 (* 0.000009765625 (- 819200.0 f0-1))))) + (a1-4 (-> arg0 current-fog)) + (s5-1 (-> arg0 current-fog fog-dists)) + ) + (vector4-lerp! + (the-as vector a1-4) + (the-as vector a1-4) + (new 'static 'vector :x 30.0 :y 80.0 :z 150.0 :w 128.0) + f30-1 + ) + (vector4-lerp! s5-1 s5-1 (new 'static 'vector :x 262144.0 :y 937984.0 :z 255.0 :w 200.0) f30-1) + ) + ) + ) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (let* ((s5-2 (-> *display* part-clock frame-counter)) + (f0-6 (* 1310.72 (the float (mod s5-2 25)))) + (f30-2 (sin f0-6)) + (f0-8 (* 109.22667 (the float (mod s5-2 600)))) + (s5-3 (/ (mod s5-2 125) 25)) + ) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) f30-2) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.15 (cos f0-8)))) + (set! (-> arg0 times 3 w) (if (zero? s5-3) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 4 w) (if (= s5-3 1) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 5 w) (if (= s5-3 2) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 6 w) (if (= s5-3 3) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 7 w) (if (= s5-3 4) + f30-2 + 0.0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; og:preserve-this not-yet-implemented texture anim stuff +; (define *comb-field-texture-anim-array* +; (the-as (texture-anim-array texture-anim) +; (new 'static 'texture-anim-array :type texture-anim +; (new 'static 'texture-anim +; :num-layers #x2 +; :func #f +; :init-func #f +; :tex #f +; :tex-name "security-env-dest" +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 4800.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) +; :data (new 'static 'array texture-anim-layer 2 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 4800.0 +; :tex-name "security-env-uscroll" +; :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0 0.5)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 4.0 0.5)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 4800.0 +; :tex-name "security-env-uscroll" +; :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0 3.0)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; (new 'static 'texture-anim +; :num-layers #x3 +; :func #f +; :init-func #f +; :tex #f +; :tex-name "security-dot-dest" +; :color (new 'static 'rgba :a #x80) +; :frame-delta 300.0 +; :frame-mod 600.0 +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x1 :d #x1) +; :data (new 'static 'array texture-anim-layer 6 +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 4800.0 +; :tex-name "common-white" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "security-dot-src" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.015625)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.0078125 0.015625)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; (new 'static 'texture-anim-layer +; :func-id 'default-texture-anim-layer-func +; :init-func #f +; :tex #f +; :end-time 600.0 +; :tex-name "security-dot-src" +; :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) +; :alpha (new 'static 'gs-alpha :b #x2 :d #x1) +; :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.140625)) +; :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) +; :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) +; :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0078125 0.140625)) +; :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) +; ) +; ) +; ) +; ) +; ) +; ) + +;; WARN: Return type mismatch vector vs none. +(defun set-comb-field-color! ((arg0 vector)) + ; (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 0))) + ; (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + ; ) + ; (let ((v1-5 (-> *comb-field-texture-anim-array* array-data 1))) + ; (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) + ; (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-5 data 2 end-color quad) (-> arg0 quad)) + ; ) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defun set-comb-field-flash! ((arg0 vector)) + ; (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 1))) + ; (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + ; (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + ; ) + (none) + ) + +(defun set-comb-field-texture-masks! ((arg0 vector)) + ; (local-vars (a3-3 uint128) (a3-4 uint128)) + ; (let ((v1-3 (-> *comb-field-texture-anim-array* array-data 0 data 0 tex)) + ; (a1-3 (-> *comb-field-texture-anim-array* array-data 1 data 1 tex)) + ; ) + ; (when (and v1-3 a1-3) + ; (dotimes (a2-1 3) + ; (let ((a3-2 (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16))))) + ; (t0-2 (-> v1-3 masks data a2-1 mask quad)) + ; ) + ; (.por a3-3 a3-2 t0-2) + ; ) + ; (let ((t0-5 (-> a1-3 masks data a2-1 mask quad))) + ; (.por a3-4 a3-3 t0-5) + ; ) + ; (set! (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16)))) a3-4) + ; ) + ; #f + ; ) + ; ) + #f + ) diff --git a/goal_src/jak3/levels/comb/comb-obs.gc b/goal_src/jak3/levels/comb/comb-obs.gc index b19cd732dd..440caf056c 100644 --- a/goal_src/jak3/levels/comb/comb-obs.gc +++ b/goal_src/jak3/levels/comb/comb-obs.gc @@ -5,5 +5,1153 @@ ;; name in dgo: comb-obs ;; dgos: RAILA, COMBA +(define-extern *comb-energy-ring-lightning-width* curve2d-fast) +(define-extern *comb-energy-ring-lightning* lightning-appearance) + ;; DECOMP BEGINS +(deftype comb-elevator (elevator) + () + ) + + +(defskelgroup skel-comb-elevator min-elevator min-elevator-lod0-jg min-elevator-idle-ja + ((min-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + ) + +(defmethod get-art-group ((this comb-elevator)) + (art-group-get-by-name *level* "skel-comb-elevator" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this comb-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod init-bounce-params! ((this comb-elevator)) + (call-parent-method this) + (setup-masks (-> this draw) 1 2) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "min-elevator" :group 0)) + (none) + ) + +(defmethod base-plat-method-34 ((this comb-elevator)) + 0 + (none) + ) + +(deftype comb-pillar (process-focusable) + ((center-pos vector :inline) + (attack-vel vector :inline) + (exploder-params joint-exploder-static-params) + (exploder-skel skeleton-group) + (exploder-anim uint32) + (hit-points float) + (incoming-attack-id int32) + ) + (:state-methods + idle + explode + ) + (:methods + (update-fade (_type_) none) + (set-cspec! (_type_) none) + (go-explode (_type_) none) + (set-attack-vel! (_type_ vector) none) + (on-attack (_type_ process attack-info object) symbol) + (on-impulse (_type_ rigid-body-impact) symbol) + ) + ) + + +(defskelgroup skel-comb-pillar comb-pillar comb-pillar-lod0-jg comb-pillar-idle-ja + ((comb-pillar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 70 0 75) + ) + +(defskelgroup skel-comb-pillar-explode comb-pillar comb-pillar-explode-lod0-jg comb-pillar-explode-idle-ja + ((comb-pillar-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6.5 0 7) + ) + +(define *comb-pillar-explode-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defmethod init-from-entity! ((this comb-pillar) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 286720.0 0.0 307200.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 286720.0 0.0 307200.0) + ) + (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! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 1))) + (vector-y-quaternion! (-> s5-1 0) (-> this root quat)) + (vector+float*! (-> this center-pos) (-> this root trans) (-> s5-1 0) 286720.0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-pillar" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this hit-points) 8.0) + (set! (-> this exploder-params) *comb-pillar-explode-params*) + (set! (-> this exploder-skel) + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-pillar-explode" (the-as (pointer level) #f))) + ) + (set! (-> this exploder-anim) (the-as uint 7)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +(defmethod set-cspec! ((this comb-pillar)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +(defmethod update-fade ((this comb-pillar)) + (let ((f0-2 (fmax 0.0 (+ -81920.0 (vector-vector-distance (-> this center-pos) (camera-pos))))) + (f1-0 40960.0) + ) + (cond + ((< f0-2 f1-0) + (logior! (-> this draw status) (draw-control-status force-fade)) + (set! (-> this draw force-fade) (the-as uint (the int (* 128.0 (/ f0-2 f1-0))))) + ) + (else + (logclear! (-> this draw status) (draw-control-status force-fade)) + ) + ) + ) + (ja-post) + 0 + (none) + ) + +(defmethod go-explode ((this comb-pillar)) + (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 + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this explode)) + 0 + (none) + ) + +(defmethod get-inv-mass ((this comb-pillar)) + 0.125 + ) + +(defmethod set-attack-vel! ((this comb-pillar) (arg0 vector)) + (set! (-> this attack-vel quad) (-> arg0 quad)) + (if (< 81920.0 (vector-length (-> this attack-vel))) + (vector-normalize! (-> this attack-vel) 81920.0) + ) + 0 + (none) + ) + +(defmethod on-attack ((this comb-pillar) (arg0 process) (arg1 attack-info) (arg2 object)) + (vector-reset! (-> this attack-vel)) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (vector-reset! a1-1) + (when (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0) + (set-attack-vel! this a1-1) + ) + (when (logtest? (attack-mask damage) (-> arg1 mask)) + (if (>= (-> arg1 damage) 2.0) + (set! f30-0 (-> arg1 damage)) + ) + ) + (set! (-> this hit-points) (- (-> this hit-points) f30-0)) + ) + (if (< (-> this hit-points) 0.0) + (go-explode this) + ) + #t + ) + +(defmethod on-impulse ((this comb-pillar) (arg0 rigid-body-impact)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse)) + (set-attack-vel! this a1-1) + ) + (when (< 286720.0 (-> arg0 impulse)) + (go-explode this) + #t + ) + ) + +(defstate idle (comb-pillar) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((a1-1 (-> block param 0))) + (on-impulse self (the-as rigid-body-impact a1-1)) + ) + ) + (('attack) + (let ((s4-0 (the-as object (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (!= (-> (the-as attack-info s4-0) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (the-as int (-> (the-as attack-info s4-0) id))) + (on-attack self proc (the-as attack-info s4-0) (-> block param 0)) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (update-fade self) + ) + ) + +(defstate explode (comb-pillar) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (sound-play "sentry-explode") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> gp-1 duration) (seconds 4)) + (set! (-> gp-1 gravity) -163840.0) + (set! (-> gp-1 rot-speed) 5.0) + (vector+! + (-> gp-1 fountain-rand-transv-lo) + (new 'static 'vector :x -40960.0 :y 40960.0 :z -40960.0 :w 1.0) + (-> self attack-vel) + ) + (vector+! + (-> gp-1 fountain-rand-transv-hi) + (new 'static 'vector :x 40960.0 :y 122880.0 :z 40960.0 :w 1.0) + (-> self attack-vel) + ) + (process-spawn + joint-exploder + (-> self exploder-skel) + (-> self exploder-anim) + gp-1 + (-> self exploder-params) + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 2)) + (suspend) + ) + ) + (cleanup-for-death self) + ) + :post #f + ) + +(deftype comb-block (process-focusable) + ((attack-vel vector :inline) + (exploder-params joint-exploder-static-params) + (exploder-skel skeleton-group) + (exploder-anim uint32) + (hit-points float) + (incoming-attack-id int32) + (parts sparticle-launch-control 4) + ) + (:state-methods + idle + explode + ) + (:methods + (spawn-parts (_type_) none) + (set-cspec! (_type_) none) + (go-explode (_type_) none) + (set-attack-vel! (_type_ vector) none) + (on-attack (_type_ process attack-info object) symbol) + (on-impact (_type_ rigid-body-impact) symbol) + ) + ) + + +(defskelgroup skel-comb-block comb-obstacle comb-obstacle-lod0-jg comb-obstacle-idle-ja + ((comb-obstacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 5 + ) + +(defskelgroup skel-comb-block-explode comb-obstacle comb-obstacle-explode-lod0-jg comb-obstacle-explode-idle-ja + ((comb-obstacle-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6.5 0 7) + ) + +(define *comb-block-explode-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defmethod relocate ((this comb-block) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) offset) + ) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this comb-block)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (dotimes (s5-0 4) + (let ((a0-1 (-> this parts s5-0))) + (if (nonzero? a0-1) + (kill-particles a0-1) + ) + ) + ) + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this comb-block) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 61440.0) + ) + (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! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-block" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this hit-points) 0.1) + (set! (-> this exploder-params) *comb-block-explode-params*) + (set! (-> this exploder-skel) + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-block-explode" (the-as (pointer level) #f))) + ) + (set! (-> this exploder-anim) (the-as uint 6)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (dotimes (s5-2 4) + (set! (-> this parts s5-2) (create-launch-control (-> *part-group-id-table* 1235) this)) + ) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +(defmethod set-cspec! ((this comb-block)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +(defmethod spawn-parts ((this comb-block)) + (dotimes (s5-0 4) + (let ((v1-0 (+ s5-0 5))) + (spawn (-> this parts s5-0) (-> this node-list data v1-0 bone transform trans)) + ) + ) + (ja-post) + 0 + (none) + ) + +(defmethod go-explode ((this comb-block)) + (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 + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this explode)) + 0 + (none) + ) + +(defmethod get-inv-mass ((this comb-block)) + 0.5 + ) + +(defmethod set-attack-vel! ((this comb-block) (arg0 vector)) + (set! (-> this attack-vel quad) (-> arg0 quad)) + (if (< 81920.0 (vector-length (-> this attack-vel))) + (vector-normalize! (-> this attack-vel) 81920.0) + ) + 0 + (none) + ) + +(defmethod on-attack ((this comb-block) (arg0 process) (arg1 attack-info) (arg2 object)) + (vector-reset! (-> this attack-vel)) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (f30-0 1.0) + ) + (vector-reset! a1-1) + (when (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0) + (set-attack-vel! this a1-1) + ) + (if (logtest? (attack-mask damage) (-> arg1 mask)) + (set! f30-0 (-> arg1 damage)) + ) + (set! (-> this hit-points) (- (-> this hit-points) f30-0)) + ) + (if (< (-> this hit-points) 0.0) + (go-explode this) + ) + #t + ) + +(defmethod on-impact ((this comb-block) (arg0 rigid-body-impact)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse)) + (set-attack-vel! this a1-1) + ) + (when (< 286720.0 (-> arg0 impulse)) + (go-explode this) + #t + ) + ) + +(defstate idle (comb-block) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((a1-1 (-> block param 0))) + (on-impact self (the-as rigid-body-impact a1-1)) + ) + ) + (('attack) + (let ((s4-0 (the-as object (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (!= (-> (the-as attack-info s4-0) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (the-as int (-> (the-as attack-info s4-0) id))) + (on-attack self proc (the-as attack-info s4-0) (-> block param 0)) + ) + ) + ) + ) + ) + :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 () + (spawn-parts self) + ) + ) + +(defstate explode (comb-block) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (sound-play "sentry-explode") + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self node-list data 5 bone transform trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 40960.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 217)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 damage) 7.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (the-as process-drawable *default-pool*)) + ) + (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> gp-2 duration) (seconds 4)) + (set! (-> gp-2 gravity) -163840.0) + (set! (-> gp-2 rot-speed) 10.0) + (vector+! + (-> gp-2 fountain-rand-transv-lo) + (new 'static 'vector :x -245760.0 :y 245760.0 :z -245760.0 :w 1.0) + (-> self attack-vel) + ) + (vector+! + (-> gp-2 fountain-rand-transv-hi) + (new 'static 'vector :x 245760.0 :y 245760.0 :z 245760.0 :w 1.0) + (-> self attack-vel) + ) + (process-spawn + joint-exploder + (-> self exploder-skel) + (-> self exploder-anim) + gp-2 + (-> self exploder-params) + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 2)) + (suspend) + ) + ) + (cleanup-for-death self) + ) + :post #f + ) + +(deftype comb-energy-ring (process-focusable) + ((speed float) + (hum-id sound-id) + (bolt lightning-bolt) + (shocked-player symbol) + ) + (:state-methods + idle + ) + (:methods + (update-sound-and-bolt (_type_) none) + (set-cspec! (_type_) none) + (comb-energy-ring-method-31 (_type_) none) + (init-bolt! (_type_) none) + (update-bolt (_type_ vector vector) none) + ) + ) + + +(defskelgroup skel-comb-energy-ring comb-energy-ring comb-energy-ring-lod0-jg comb-energy-ring-idle-ja + ((comb-energy-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 29) + ) + +(if #t + (set! *comb-energy-ring-lightning-width* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 4.5 :z 5.5 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if (or (zero? *comb-energy-ring-lightning*) (!= loading-level global)) + (set! *comb-energy-ring-lightning* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *comb-energy-ring-lightning* base-alpha) 1.0) + +(set! (-> *comb-energy-ring-lightning* tex-id) (the-as uint #x403f00)) + +(set! (-> *comb-energy-ring-lightning* blend-mode) (the-as uint 1)) + +(set! (-> *comb-energy-ring-lightning* alpha-1-curve) *curve-unity*) + +(set! (-> *comb-energy-ring-lightning* alpha-1-mode) (the-as uint 3)) + +(set! (-> *comb-energy-ring-lightning* alpha-1-repeat-dist) 262144.0) + +(set! (-> *comb-energy-ring-lightning* alpha-2-curve) #f) + +(set! (-> *comb-energy-ring-lightning* alpha-2-mode) (the-as uint 3)) + +(set! (-> *comb-energy-ring-lightning* alpha-2-repeat-dist) 4096.0) + +(set! (-> *comb-energy-ring-lightning* width-curve) *comb-energy-ring-lightning-width*) + +(set! (-> *comb-energy-ring-lightning* width-mode) (the-as uint 2)) + +(set! (-> *comb-energy-ring-lightning* width-repeat-dist) 4096.0) + +(set! (-> *comb-energy-ring-lightning* uv-repeat-dist) 28672.0) + +(set! (-> *comb-energy-ring-lightning* regenerate-time-start) (seconds 0.167)) + +(set! (-> *comb-energy-ring-lightning* regenerate-time-end) (seconds 0.25)) + +(set! (-> *comb-energy-ring-lightning* width-range-start) 18841.6) + +(set! (-> *comb-energy-ring-lightning* width-range-end) 20480.0) + +(set! (-> *comb-energy-ring-lightning* fade-time) (seconds 0.1)) + +(set! (-> *comb-energy-ring-lightning* uv-shift?) #f) + +(set! (-> *comb-energy-ring-lightning* uv-shift-speed) (seconds 0.1)) + +(set! (-> *comb-energy-ring-lightning* use-sprite-bucket?) #t) + +(set! (-> *comb-energy-ring-lightning* use-accurate-interp?) #t) + +(defmethod init-bolt! ((this comb-energy-ring)) + (set! (-> this bolt) (new 'process 'lightning-bolt)) + (init! (-> this bolt) 4 16 *comb-energy-ring-lightning*) + 0 + (none) + ) + +(defmethod update-bolt ((this comb-energy-ring) (arg0 vector) (arg1 vector)) + (let ((gp-0 (-> this bolt))) + (set! (-> gp-0 inner-point-travel-time) (seconds 1)) + (set! (-> gp-0 snap-inner-points?) #t) + (set! (-> gp-0 fractal-reduction) 0.4) + (set! (-> gp-0 generate-mode) (the-as uint 1)) + (set! (-> gp-0 appearance) *comb-energy-ring-lightning*) + (set! (-> gp-0 num-active-spans) 1) + (dotimes (v1-6 4) + (set! (-> gp-0 spans data v1-6 random-offset-size-start) 4096.0) + (set! (-> gp-0 spans-internal data v1-6 num-inner-points) 14) + (set! (-> gp-0 spans data v1-6 inner-random-offset-size) 4096.0) + ) + (set! (-> gp-0 span-pts-start data 0 quad) (-> arg0 quad)) + (set! (-> gp-0 span-pts-start data 2 quad) (-> arg0 quad)) + (set! (-> gp-0 span-pts-start data 1 quad) (-> arg1 quad)) + (set! (-> gp-0 span-pts-start data 3 quad) (-> arg1 quad)) + (set! (-> gp-0 spans data 0 random-offset-size-start) 0.0) + (set! (-> gp-0 spans data 1 random-offset-size-start) 0.0) + (set! (-> gp-0 spans data 2 random-offset-size-start) 0.0) + (set! (-> gp-0 spans data 3 random-offset-size-start) 0.0) + (set! (-> gp-0 spans-internal data 3 num-inner-points) 0) + (if (and (!= (lightning-bolt-method-14 gp-0) 0) (!= (lightning-bolt-method-14 gp-0) 1)) + (lightning-bolt-method-13 gp-0 1) + ) + (lightning-bolt-method-11 gp-0) + (lightning-bolt-method-12 gp-0) + ) + 0 + (none) + ) + +(defmethod init-from-entity! ((this comb-energy-ring) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 114688.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 6) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 5) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-energy-ring" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (init-bolt! this) + (set! (-> this shocked-player) #f) + (set! (-> this speed) (rand-vu-float-range 0.25 0.5)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set! (-> this hum-id) (new 'static 'sound-id)) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +;; WARN: Return type mismatch process-focusable vs comb-energy-ring. +(defmethod relocate ((this comb-energy-ring) (offset int)) + (if (nonzero? (-> this bolt)) + (&+! (-> this bolt) offset) + ) + (the-as comb-energy-ring ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod set-cspec! ((this comb-energy-ring)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :w 16384.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :w 16384.0)) + 16 + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +(defmethod update-sound-and-bolt ((this comb-energy-ring)) + (cond + ((< (vector-vector-distance (-> this root trans) (target-pos 0)) 409600.0) + (if (zero? (-> this hum-id)) + (set! (-> this hum-id) (new-sound-id)) + ) + (sound-play "rotating-arc" :id (-> this hum-id)) + ) + (else + (when (nonzero? (-> this hum-id)) + (sound-stop (-> this hum-id)) + (set! (-> this hum-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (ja-post) + (update-transforms (-> this root)) + (let ((v1-13 (-> this root root-prim))) + (update-bolt + this + (the-as vector (-> (the-as collide-shape-prim-group v1-13) child 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group v1-13) child 1 prim-core)) + ) + ) + 0 + (none) + ) + +(defmethod get-inv-mass ((this comb-energy-ring)) + 0.125 + ) + +(defstate idle (comb-energy-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (format #t "energy-ring got touched event from ~s~%" proc) + (when (not (-> self shocked-player)) + (set! (-> self shocked-player) #t) + (sound-play "ring-shock") + (send-event + proc + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 32.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 0.0)) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek! max (-> self speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed))) + ) + ) + #f + ) + :post (behavior () + (update-sound-and-bolt self) + ) + ) + +(deftype comb-turbo (process-drawable) + ((root collide-shape :override) + (touch-time time-frame) + (player-got symbol) + (boost float) + (plane vector :inline) + (mat matrix :inline) + ) + (:state-methods + idle + die + ) + (:methods + (init-collision! (_type_) none) + (init-fields! (_type_) none) + (comb-turbo-method-24 (_type_) none) + ) + ) + + +(defstate idle (comb-turbo) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (format #t "comb-turbo: got event ~s from ~s~%" message proc) + (when (= message 'touched) + (let ((s5-1 proc)) + (when (and (if (type? s5-1 vehicle) + s5-1 + ) + (not (-> self player-got)) + ) + (set! (-> self player-got) #t) + (send-event proc 'turbo-pad (-> self boost)) + (let ((v0-1 (current-time))) + (set! (-> self touch-time) v0-1) + v0-1 + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (if (and (-> self player-got) (time-elapsed? (-> self touch-time) (seconds 3))) + (go-virtual die) + ) + 0 + ) + ) + +(defstate die (comb-turbo) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + ) + ) + +(defmethod init-collision! ((this comb-turbo)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) + (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 32768.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! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-fields! ((this comb-turbo)) + (let ((s5-0 (-> this mat))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) + (quaternion->matrix s5-0 s4-0) + ) + (set! (-> s5-0 trans quad) (-> this root trans quad)) + (set! (-> this plane quad) (-> s5-0 rvec quad)) + ) + (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) + (update-transforms (-> this root)) + (set! (-> this player-got) #f) + (set! (-> this boost) 1.0) + (set-time! (-> this touch-time)) + 0 + (none) + ) + +(defmethod init-from-entity! ((this comb-turbo) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (init-fields! this) + (go (method-of-object this idle)) + ) + +(deftype task-manager-lightjak-training-shield (task-manager) + ((gui-id sound-id) + ) + (:methods + (print-text (_type_ text-id) none) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod print-text ((this task-manager-lightjak-training-shield) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-4 s5-1)) + (set! (-> v1-4 width) (the float 440)) + ) + (let ((v1-5 s5-1)) + (set! (-> v1-5 height) (the float 80)) + ) + (let ((v1-6 s5-1)) + (set! (-> v1-6 scale) 0.8) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* arg0 #f)) + (s4-0 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (none) + ) + +(defstate active (task-manager-lightjak-training-shield) + :virtual #t + :enter (behavior () + (if *target* + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + ) + (set! (-> self gui-id) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (let ((t1-1 (the-as uint #x3810000040020))) + (set-setting! 'features 'clear (shr t1-1 32) t1-1) + ) + ) + :exit (behavior () + (send-event *target* 'get-pickup (pickup-type health) 100.0) + ) + :code (behavior () + (while (not (and *target* + (focus-test? *target* light) + (and (focus-test? *target* light) (nonzero? (-> *target* lightjak))) + (nonzero? (-> *target* lightjak shield-start-time)) + ) + ) + (if (not (and *target* (focus-test? *target* light))) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + ) + (print-text self (text-id text-05f8)) + (suspend) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 6)) + (print-text self (text-id text-0776)) + (suspend) + ) + ) + (send-event *target* 'end-mode 'lightjak) + (go-virtual complete) + ) + ) diff --git a/goal_src/jak3/levels/comb/comb-part.gc b/goal_src/jak3/levels/comb/comb-part.gc index 1b74c24dc2..3c5ce11691 100644 --- a/goal_src/jak3/levels/comb/comb-part.gc +++ b/goal_src/jak3/levels/comb/comb-part.gc @@ -7,3 +7,1020 @@ ;; DECOMP BEGINS +(defpartgroup group-comb-hover-vehicle-exhaust-glow + :id 1233 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4192 :fade-after (meters 120) :flags (sp6)) (sp-item 4193 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4192 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 15.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4193 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 20.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-comb-hover-vehicle-exhaust-distortion + :id 1234 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4194 :flags (sp6 sp7))) + ) + +(defpart 4194 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters 3)) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 20.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-comb-obstacle-glow + :id 1235 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4195 :flags (sp6)) (sp-item 4196 :flags (sp6))) + ) + +(defpart 4195 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 5.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4196 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 4)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 60.0 5.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-comb-arch-yellow-glow + :id 1236 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4197 :fade-after (meters 120) :flags (sp6)) (sp-item 4198 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4197 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4198 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-hugelight-big-yellow-glow + :id 1237 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4199 :fade-after (meters 120) :flags (sp6)) (sp-item 4200 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4199 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4200 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 18) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-hugelight-small-yellow-glow + :id 1238 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4201 :fade-after (meters 120) :flags (sp6)) (sp-item 4202 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4201 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4202 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-supp-blue-glow + :id 1239 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4203 :fade-after (meters 120) :flags (sp6)) (sp-item 4204 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4203 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 64.0) + (:b 128.0) + (:a 50.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4204 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpartgroup group-comb-bigblue-glow + :id 1240 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4205 :fade-after (meters 120) :flags (sp6)) (sp-item 4206 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4205 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 64.0) + (:b 255.0) + (:a 80.0 20.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4206 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 50.0 30.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpartgroup group-comb-marker-red-glow + :id 1241 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4207 :flags (sp6) :period (seconds 0.135) :length (seconds 0.035)) + (sp-item 4208 :flags (sp6) :period (seconds 0.135) :length (seconds 0.035)) + ) + ) + +(defpart 4207 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 2.0) + (:omega (degrees 22511.25)) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4208 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-marker-small-red-glow + :id 1242 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4209 :fade-after (meters 120) :flags (sp6)) (sp-item 4210 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4209 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 15.0 5.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4210 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 9)) + (:rot-z (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 20.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-shelltube-yellow-glow + :id 1243 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4211 :fade-after (meters 120) :flags (sp6)) (sp-item 4212 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4211 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 8.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4212 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15) (meters 2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-sphere-yellow-glow + :id 1244 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4213 :fade-after (meters 120) :flags (sp6)) (sp-item 4214 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4213 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 120.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4214 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-light-yellow-glow + :id 1245 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4215 :flags (sp6)) (sp-item 4216 :flags (sp6)) (sp-item 4217 :flags (sp6))) + ) + +(defpart 4215 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4216 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 4217 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-brightlight-big-yellow-glow + :id 1246 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4218 :flags (sp6)) (sp-item 4219 :flags (sp6)) (sp-item 4220 :flags (sp6))) + ) + +(defpart 4218 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 6.0 2.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4219 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 4220 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-powerdisc-blue-glow + :id 1247 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4221 :flags (sp6)) (sp-item 4222 :flags (sp6))) + ) + +(defpart 4221 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 5.0 2.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4222 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-lighttube-yellow-glow + :id 1248 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4223 :flags (sp6)) (sp-item 4224 :flags (sp6))) + ) + +(defpart 4223 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 5.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4224 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-widetube-yellow-glow + :id 1249 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4225 :fade-after (meters 120) :flags (sp6)) (sp-item 4226 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4225 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4226 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-mainwall-blue-glow + :id 1250 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4227 :fade-after (meters 120) :flags (sp6)) (sp-item 4228 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4227 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 8.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4228 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 150.0) + (:b 255.0) + (:a 20.0 3.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-comb-ceiling-panel-yellow-glow + :id 1251 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4229 :fade-after (meters 120) :flags (sp6)) (sp-item 4230 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4229 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 8.0 1.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4230 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 30.0 5.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 4231 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 30)) + (:r 0.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 4232 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 4233 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g 0.8) + (:fade-b 1.6) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4234 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 0.0) + (:g 0.0 128.0) + (:b 128.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 4235 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 4515.75)) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-a -7.285714) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 1024.0) + ) + ) + +(defpart 4236 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.25)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 0.0 16.0) + (:b 0.0 16.0) + (:a 128.0) + (:scalevel-x (meters 0.0016666667)) + (:fade-a -2.1333334) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 4237 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.6) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4238 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4239 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 8.0 8.0) + (:z (meters 0) (meters -3)) + (:scale-x (meters 0.4) (meters 0.4)) + (:scale-y (meters 0.4) (meters 0.4)) + (:r 192.0) + (:g 0.0 16.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.00234375)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.2 -2.4) + (:fade-a -0.53333336 -2.1333334) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4240 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 4241 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 4515.75)) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-a -7.285714) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 1024.0) + ) + ) diff --git a/goal_src/jak3/levels/comb/comb-scenes.gc b/goal_src/jak3/levels/comb/comb-scenes.gc index 8b247377b7..5862dc195d 100644 --- a/goal_src/jak3/levels/comb/comb-scenes.gc +++ b/goal_src/jak3/levels/comb/comb-scenes.gc @@ -7,3 +7,917 @@ ;; DECOMP BEGINS +(load-scene + (new 'static 'scene + :name "temple-tests-res-b" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-173" + :art-group "scenecamera" + :anim "temple-tests-res-b" + :parts 8 + :command-list '((0 + (fadein (frame-time-30 5)) + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)) 'hide) + (none) + ) + ) + ) + (2 + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)) 'hide) + (none) + ) + ) + ) + (750 + (part-tracker + "group-fma-medallion-car-charge" + entity + "kidmedallion" + joint + "main" + track + #t + duration + (frame-range 750 810) + ) + ) + (860 (fadeout (frame-time-30 15))) + (10000 + (task-close! "comb-travel-introduction") + (apply ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)) 'unhide) + (none) + ) + ) + ) + ) + :cut-list '(51 151 280 335 417 474 541 671 763 805) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'combx + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'combx + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'comba + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min 954)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "comb-rail-rider-fma" + :level 'comba + :art-group "skel-comb-rail-rider-fma" + :prefix "" + :draw-frames '((min 151) (280 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kidmedallion" + :level 'comba + :art-group "skel-kidmedallion" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "comba-elevator" + :end-point "comba-movie-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "launch-amb-mov") + :on-complete #f + ) + ) + +(defbehavior comb-lightjak-do-effect process-drawable () + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + (logior! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + (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) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 3)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 4)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 5)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 6)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 8)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 13)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 17)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 14)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 18)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 15)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 19)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 25)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 26)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 32)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 27)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 33)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 28)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 34)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 31)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 37)) :rate f30-0) + ) + (none) + ) + +(load-scene (new 'static 'scene + :name "catacomb-get-shield" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-224" + :art-group "scenecamera" + :anim "catacomb-get-shield" + :parts 5 + :command-list '((0 (fadein (frame-time-30 5))) + (1 + (joint-eval start-precursor-effect entity "precursor") + (send-event + "precursor" + 'eval + ,(lambda :behavior scene-player + () + (let* ((v1-3 (-> self draw lod-set lod (-> self draw cur-lod) geo length)) + (gp-0 3) + (s5-0 (+ v1-3 1)) + ) + (while (>= s5-0 gp-0) + (when (not (or (and (>= gp-0 13) (>= 21 gp-0)) (and (>= gp-0 26) (>= 34 gp-0)))) + (if (logtest? (-> *part-group-id-table* 1252 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1252) + :duration (seconds 17.135) + :target self + :mat-joint gp-0 + ) + (part-tracker-spawn + part-tracker + :to self + :group (-> *part-group-id-table* 1252) + :duration (seconds 17.135) + :target self + :mat-joint gp-0 + ) + ) + ) + (+! gp-0 1) + ) + ) + (none) + ) + ) + (part-tracker + "group-fma-precursor-entrance-flash" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 1 27) + ) + ) + (300 + (part-tracker + "group-fma-lightjak-getshield-gravitate" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 300 480) + ) + (part-tracker + "group-fma-lightjak-getshield" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-range 300 480) + ) + ) + (440 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + (part-tracker + "group-fma-lightjak-getshield-flash" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 440 441) + ) + ) + (445 + (send-event "jakc-highres" 'trans-hook comb-lightjak-do-effect) + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (520 (fadeout (frame-time-30 20))) + (10000 (task-close! "comb-travel-resolution") (kill "pecker-ingame-2")) + ) + :cut-list '(396) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'comba + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'comba + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'comba + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor" + :level 'comba + :art-group "skel-precursor" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'comba + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "combn-start" + :end-point "combn-lightjak" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "launch-amb-mov") (sound-play-loop "tunnel-amb-mov")) + :on-complete #f + ) + ) + +(define death-precursor (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x1092)) + +(defun start-precursor-effect ((arg0 manipy)) + (let ((v1-0 (-> arg0 draw)) + (a1-0 death-precursor) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-0 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-0 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-0 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-0 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior scene-player + () + (set! (-> self draw death-timer) (the-as uint 200)) + (set! (-> self draw death-vertex-skip) (the-as uint (the int (rand-vu-float-range 8.0 24.0)))) + (none) + ) + ) + 0 + (none) + ) + +(defpart 4242 + :init-specs ((:scale-x (meters 0.08)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 196.0) + (:b 255.0) + (:a 64.0) + (:accel-y (meters 0) (meters 0.00066666666)) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-texture-glow-soft) + (:next-time (seconds 0.035)) + (:next-launcher 4243) + ) + ) + +(defpart 4243 + :init-specs ((:r 64.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.0008)) + (:scalevel-y (meters 0) (meters 0.0026666666)) + ) + ) + +(defpartgroup group-outro-precursor-entity + :id 1252 + :duration (seconds 0.017) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4244 :flags (sp6))) + ) + +(defpart 4244 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 8.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-fma-medallion-car-beam + :id 1253 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4245 :flags (sp7))) + ) + +(defpart 4245 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 3.0 3.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:scale-y (meters 0.1) (meters 0.4)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-z (meters 0.05)) + (:scalevel-x (meters 0.006666667)) + (:timer (seconds 0.667) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 20) (degrees -50.000004)) + (:conerot-y (degrees 0) (degrees -50.000004)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fma-medallion-car-charge + :id 1254 + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4246 :flags (sp7)) + (sp-item 4247 :flags (sp7)) + (sp-item 4248 :flags (sp6)) + (sp-item 4249 :flags (sp6)) + (sp-item 4250 :flags (sp6)) + ) + ) + +(defpart 4246 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:x (meters 0.6) (meters 0.1)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'spt-func-relative-pos) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defpart 4247 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 20.0) + (:b 32.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334) (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.335)) + (:next-launcher 4251) + ) + ) + +(defpart 4251 + :init-specs ((:fade-a 0.0)) + ) + +(defpart 4248 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 128.0) + (:a 20.0 40.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.167)) + (:flags (glow)) + (:userdata 409.6) + (:func 'spt-func-relative-pos) + ) + ) + +(defpart 4249 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 64.0) + (:a 60.0 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:func 'spt-func-relative-pos) + ) + ) + +(defpart 4250 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 10.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:func 'spt-func-relative-pos) + ) + ) + +(defpartgroup group-fma-precursor-entrance-flash + :id 1255 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4252 :flags (sp3)) (sp-item 4253 :flags (sp3))) + ) + +(defpart 4252 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow left-multiply-quat)) + (:userdata 4096.0) + (:next-time (seconds 0.335)) + (:next-launcher 4254) + ) + ) + +(defpart 4254 + :init-specs ((:scalevel-x (meters -0.06666667)) (:scalevel-y :copy scalevel-x) (:fade-a -1.28)) + ) + +(defpart 4253 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 4255) + ) + ) + +(defpart 4255 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.85333335)) + ) + +(defpartgroup group-fma-lightjak-getshield + :id 1256 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4256 :flags (is-3d)) + (sp-item 4257 :flags (is-3d)) + (sp-item 4258 :flags (is-3d)) + (sp-item 4259 :flags (is-3d)) + (sp-item 4260) + ) + ) + +(defpart 4256 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4261 + :init-specs ((:fade-a -1.28)) + ) + +(defpart 4257 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4258 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4259 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4260 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters -20)) + (: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 4262) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4262 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpartgroup group-fma-lightjak-getshield-gravitate + :id 1257 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4263)) + ) + +(defpart 4263 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (: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)) + ) + ) + +(defpartgroup group-fma-lightjak-getshield-flash + :id 1258 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4264 :flags (sp3))) + ) + +(defpart 4264 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.23333333)) + (:scalevel-y (meters 0.033333335)) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow left-multiply-quat)) + (:userdata 409.6) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.167)) + (:next-launcher 4265) + ) + ) + +(defpart 4265 + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y (meters -0.02)) (:fade-a -1.7)) + ) diff --git a/goal_src/jak3/levels/comb/comb-sentry.gc b/goal_src/jak3/levels/comb/comb-sentry.gc index 791d6698a4..8ad096ee02 100644 --- a/goal_src/jak3/levels/comb/comb-sentry.gc +++ b/goal_src/jak3/levels/comb/comb-sentry.gc @@ -5,5 +5,743 @@ ;; name in dgo: comb-sentry ;; dgos: RAILA, COMBA +(deftype comb-sentry-stack-var0 (structure) + ((params projectile-init-by-other-params :inline :offset 0) + (mat matrix :inline :offset 128) + (vec2 vector :inline :offset 192) + (vec3 vector :inline :offset 208) + (vec4 vector :inline :offset 224) + (byte0 int8 :offset 240) + ) + ) + +(deftype comb-sentry-stack-var1 (structure) + ((glow sprite-glow-data :inline :offset 0) + (mat matrix :inline :offset 64) + (vec vector :inline :offset 128) + ) + ) + ;; DECOMP BEGINS +(deftype comb-sentry-shot (guard-shot) + () + ) + + +(defmethod projectile-method-24 ((this comb-sentry-shot)) + (draw-beam (-> *part-id-table* 4240) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4241)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this comb-sentry-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 4236 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 4236) a1-0 s5-1 #f) + (set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 4237) s4-0) + (launch-particles (-> *part-id-table* 4238) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000027126736 f30-0)) + (f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef)) + (f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1)) + (launch-particles (-> *part-id-table* 4239) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) f28-1) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this comb-sentry-shot)) + (let* ((s4-0 (-> this root)) + (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector+! gp-0 gp-0 v1-1) + (cond + ((-> this hit-actor?) + (sound-play "sentry-hit") + (cond + ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this comb-sentry-shot)) + (let ((t9-0 (method-of-type guard-shot init-proj-settings!))) + (t9-0 this) + ) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this max-speed) 2048000.0) + (set! (-> this damage) 3.0) + (set! (-> this timeout) (seconds 0.4)) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + +(deftype comb-sentry (process-focusable) + ((target-pos vector :inline) + (up-dir vector :inline) + (attack-vel vector :inline) + (exploder-params joint-exploder-static-params) + (exploder-skel skeleton-group) + (exploder-anim uint32) + (target-dist float) + (path-t float) + (path-dt float) + (hit-points float) + (incoming-attack-id int32) + (angle float) + (spin float) + (shooting symbol) + (should-attack symbol) + (i-barrel int8) + (hum-id sound-id) + (shot-time time-frame) + (attack-time time-frame) + (in-range-time time-frame) + (player-vehicle handle) + ) + (:state-methods + idle + path-follow + explode + ) + (:methods + (stop-hum (_type_) none) + (sentry-post (_type_) none) + (set-cspec! (_type_) none) + (go-explode (_type_) none) + (set-attack-vel! (_type_ vector) none) + (on-attack (_type_ process attack-info object) symbol) + (on-impact (_type_ rigid-body-impact) symbol) + (fire-shot (_type_) (pointer comb-sentry-shot)) + (draw-glow-sprites (_type_) none) + ) + ) + + +(defskelgroup skel-comb-sentry comb-sentinel comb-sentinel-lod0-jg comb-sentinel-idle-ja + ((comb-sentinel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + ) + +(defskelgroup skel-comb-sentry-explode comb-sentinel comb-sentinel-explode-lod0-jg comb-sentinel-explode-idle-ja + ((comb-sentinel-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6.5 0 7) + ) + +(define *comb-sentry-explode-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defmethod init-from-entity! ((this comb-sentry) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (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! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-sentry" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this up-dir quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (if (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (set! (-> this path-t) 0.0) + (set! (-> this path-dt) 0.0) + (set! (-> this hit-points) 6.0) + (set! (-> this shooting) #f) + (set! (-> this hum-id) (new 'static 'sound-id)) + (set! (-> this should-attack) #f) + (set! (-> this exploder-params) *comb-sentry-explode-params*) + (set! (-> this exploder-skel) + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-sentry-explode" (the-as (pointer level) #f))) + ) + (set! (-> this exploder-anim) (the-as uint 5)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set! (-> this player-vehicle) (the-as handle #f)) + (set! (-> this target-dist) 4096000.0) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +(defmethod set-cspec! ((this comb-sentry)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (let ((v1-3 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group v1-3) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :y 6144.0 :w 40960.0)) + 16 + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +(define *comb-sentry-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 20480.0) + :size-probe 655.36 + :z-offset 819.2 + :size-y 20480.0 + :color (new 'static 'rgbaf :x 255.0 :y 64.0 :z 64.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xd :page #x4) + ) + ) + +(define *comb-sentry-glow-ring-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 20480.0) + :size-probe 655.36 + :z-offset 819.2 + :size-y 20480.0 + :color (new 'static 'rgbaf :x 255.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #x9c :page #x4) + ) + ) + +(defmethod draw-glow-sprites ((this comb-sentry)) + (let ((gp-0 (new 'stack-no-clear 'comb-sentry-stack-var1))) + (matrix<-transformq! (-> gp-0 mat) (the-as transformq (-> this root trans))) + (let ((s5-0 (new 'static 'inline-array vector 3 + (new 'static 'vector :z 30720.0 :w 1.0) + (new 'static 'vector :x 9420.8 :y 9420.8 :z 24985.6 :w 1.0) + (new 'static 'vector :x -10240.0 :z 24576.0 :w 1.0) + ) + ) + (s4-0 *comb-sentry-glow-template*) + (s3-0 *comb-sentry-glow-ring-template*) + ) + (dotimes (s2-0 3) + (quad-copy! (the-as pointer (-> gp-0 glow)) (the-as pointer s4-0) 4) + (vector-matrix*! (-> gp-0 vec) (-> s5-0 s2-0) (-> gp-0 mat)) + (let* ((v1-2 (-> gp-0 glow)) + (a1-3 (-> gp-0 vec)) + (f0-0 (-> v1-2 position w)) + ) + (set! (-> v1-2 position quad) (-> a1-3 quad)) + (set! (-> v1-2 position w) f0-0) + ) + 0 + (set! (-> gp-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> gp-0 glow color w) (* 4.0 (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> gp-0 glow)) + (quad-copy! (the-as pointer (-> gp-0 glow)) (the-as pointer s3-0) 4) + (vector-matrix*! (-> gp-0 vec) (-> s5-0 s2-0) (-> gp-0 mat)) + (let* ((v1-10 (-> gp-0 glow)) + (a1-10 (-> gp-0 vec)) + (f0-5 (-> v1-10 position w)) + ) + (set! (-> v1-10 position quad) (-> a1-10 quad)) + (set! (-> v1-10 position w) f0-5) + ) + 0 + (set! (-> gp-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> gp-0 glow color w) (* 0.5 (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> gp-0 glow)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer comb-sentry-shot). +(defmethod fire-shot ((this comb-sentry)) + (sound-play "sentry-fire") + (let ((s5-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) + (set! (-> s5-1 byte0) 0) + (let* ((v1-1 (-> s5-1 mat)) + (a3-1 (-> this node-list data 0 bone transform)) + (a0-5 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-1 rvec quad) a0-5) + (set! (-> v1-1 uvec quad) a1-1) + (set! (-> v1-1 fvec quad) a2-1) + (set! (-> v1-1 trans quad) a3-2) + ) + (let ((v1-2 (new 'static 'inline-array vector 1 (new 'static 'vector :z 14336.0 :w 1.0)))) + (vector-matrix*! (-> s5-1 vec2) (-> v1-2 (-> s5-1 byte0)) (-> s5-1 mat)) + ) + 0 + (set! (-> s5-1 vec3 quad) (-> s5-1 mat fvec quad)) + (vector-float*! (-> s5-1 vec4) (-> s5-1 vec3) 2048000.0) + (set! (-> s5-1 params ent) (-> this entity)) + (set! (-> s5-1 params charge) 1.0) + (set! (-> s5-1 params options) (projectile-options)) + (logclear! (-> s5-1 params options) (projectile-options po14 po15 po16)) + (set! (-> s5-1 params pos quad) (-> s5-1 vec2 quad)) + (set! (-> s5-1 params vel quad) (-> s5-1 vec4 quad)) + (set! (-> s5-1 params notify-handle) (the-as handle #f)) + (set! (-> s5-1 params owner-handle) (the-as handle #f)) + (set! (-> s5-1 params target-handle) (the-as handle #f)) + (set! (-> s5-1 params target-pos quad) (the-as uint128 0)) + (set! (-> s5-1 params ignore-handle) (process->handle this)) + (let* ((v1-17 *game-info*) + (a0-20 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-20) + (set! (-> s5-1 params attack-id) a0-20) + ) + (set! (-> s5-1 params timeout) (seconds 4)) + (the-as + (pointer comb-sentry-shot) + (spawn-projectile comb-sentry-shot (-> s5-1 params) this *default-dead-pool*) + ) + ) + ) + +(defmethod stop-hum ((this comb-sentry)) + (sound-stop (-> this hum-id)) + 0 + (none) + ) + +(defmethod deactivate ((this comb-sentry)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (stop-hum this) + (call-parent-method this) + (none) + ) + +(defmethod sentry-post ((this comb-sentry)) + (local-vars (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (if (and (= (-> this player-vehicle) #f) *target* (focus-test? *target* pilot-riding)) + (set! (-> this player-vehicle) (-> *target* pilot vehicle)) + ) + (set! (-> this should-attack) #f) + (let ((s5-0 (the-as process-focusable (handle->process (-> this player-vehicle))))) + (when s5-0 + (if (and (not (focus-test? s5-0 dead)) + (not (focus-test? s5-0 ignore)) + (let ((f0-0 (vector-vector-distance-squared (-> s5-0 root trans) (-> this root trans))) + (f1-0 409600.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (set! (-> this should-attack) #t) + ) + (let ((v1-23 (new 'stack-no-clear 'matrix))) + (set! (-> v1-23 rvec quad) (-> s5-0 root trans quad)) + (set! (-> v1-23 uvec quad) (-> s5-0 root transv quad)) + (vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1) + (set! (-> v1-23 fvec quad) (-> s5-0 node-list data 0 bone transform fvec quad)) + (vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec)) + (set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans))) + (let* ((v1-24 (-> v1-23 trans)) + (f0-4 409600.0) + (f0-6 (* f0-4 f0-4)) + ) + (.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) + (if (< f0-6 v1-25) + (set! (-> this target-dist) 4096000.0) + ) + ) + ) + ) + ) + (if (not (-> this should-attack)) + (set-time! (-> this in-range-time)) + ) + (set! (-> this path-dt) (* 0.00024414062 (- 163840.0 (-> this target-dist)))) + (set! (-> this path-dt) (fmax -8.0 (fmin 8.0 (-> this path-dt)))) + (+! (-> this path-t) (* (-> this path-dt) (seconds-per-frame))) + (set! (-> this path-t) (fmax 0.0 (fmin (-> this path-t) (get-num-segments (-> this path))))) + (if (= (-> this path-t) (get-num-segments (-> this path))) + (go-explode this) + ) + (get-point-in-path! (-> this path) (-> this root trans) (-> this path-t) 'interp) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5))) + (vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans)) + (vector-normalize! (-> s5-1 0) 1.0) + (set! (-> s5-1 1 quad) (-> this up-dir quad)) + (set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1))) + (vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x))) + (vector-normalize! (-> s5-1 1) 1.0) + (set! (-> this up-dir quad) (-> s5-1 1 quad)) + (forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1)) + (+! (-> this angle) (* (-> this spin) (seconds-per-frame))) + (set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48))) + (quaternion-axis-angle! (the-as quaternion (-> s5-1 3)) 0.0 0.0 1.0 (-> this angle)) + (quaternion*! (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 3))) + (quaternion-copy! (-> this root quat) (the-as quaternion (-> s5-1 2))) + ) + (cond + ((-> this shooting) + (seek! (-> this spin) 131072.0 (* 262144.0 (seconds-per-frame))) + (when (time-elapsed? (-> this shot-time) (seconds 0.2)) + (set-time! (-> this shot-time)) + (fire-shot this) + ) + (when (or (time-elapsed? (-> this attack-time) (seconds 1)) (not (-> this should-attack))) + (set-time! (-> this attack-time)) + (set! (-> this shooting) #f) + ) + ) + (else + (seek! (-> this spin) 32768.0 (* 65536.0 (seconds-per-frame))) + (when (and (time-elapsed? (-> this attack-time) (seconds 3)) + (time-elapsed? (-> this in-range-time) (seconds 4)) + (-> this should-attack) + ) + (set-time! (-> this attack-time)) + (set! (-> this shooting) #t) + ) + ) + ) + (cond + ((-> this should-attack) + (if (zero? (-> this hum-id)) + (set! (-> this hum-id) (new-sound-id)) + ) + (sound-play "sentry-engine" :id (-> this hum-id)) + ) + (else + (when (nonzero? (-> this hum-id)) + (sound-stop (-> this hum-id)) + (set! (-> this hum-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (transform-post) + (draw-glow-sprites this) + 0 + (none) + ) + ) + +(defmethod go-explode ((this comb-sentry)) + (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 + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this explode)) + 0 + (none) + ) + +(defmethod get-inv-mass ((this comb-sentry)) + 0.125 + ) + +(defmethod set-attack-vel! ((this comb-sentry) (arg0 vector)) + (set! (-> this attack-vel quad) (-> arg0 quad)) + (if (< 81920.0 (vector-length (-> this attack-vel))) + (vector-normalize! (-> this attack-vel) 81920.0) + ) + 0 + (none) + ) + +(defmethod on-attack ((this comb-sentry) (arg0 process) (arg1 attack-info) (arg2 object)) + (vector-reset! (-> this attack-vel)) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (f30-0 1.0) + ) + (vector-reset! a1-1) + (when (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0) + (set-attack-vel! this a1-1) + ) + (if (logtest? (attack-mask damage) (-> arg1 mask)) + (set! f30-0 (-> arg1 damage)) + ) + (sound-play "impact-med") + (set! (-> this hit-points) (- (-> this hit-points) f30-0)) + ) + (if (< (-> this hit-points) 0.0) + (go-explode this) + ) + #t + ) + +(defmethod on-impact ((this comb-sentry) (arg0 rigid-body-impact)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse)) + (set-attack-vel! this a1-1) + ) + (when (< 286720.0 (-> arg0 impulse)) + (go-explode this) + #t + ) + ) + +(defstate idle (comb-sentry) + :virtual #t + :trans (behavior () + (set! (-> self path-dt) 0.0) + (go-virtual path-follow) + ) + :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 () + (sentry-post self) + ) + ) + +(defstate path-follow (comb-sentry) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((a1-1 (-> block param 0))) + (on-impact self (the-as rigid-body-impact a1-1)) + ) + ) + (('attack) + (let ((s4-0 (the-as attack-info (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (!= (-> s4-0 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (the-as int (-> s4-0 id))) + (on-attack self proc s4-0 (-> block param 0)) + ) + ) + ) + ) + ) + :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 () + (sentry-post self) + ) + ) + +(defstate explode (comb-sentry) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (stop-hum self) + (sound-play "sentry-expl") + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + ) + (let ((gp-3 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> gp-3 duration) (seconds 4)) + (set! (-> gp-3 gravity) -163840.0) + (set! (-> gp-3 rot-speed) 10.0) + (vector+! + (-> gp-3 fountain-rand-transv-lo) + (new 'static 'vector :x -245760.0 :y 245760.0 :z -245760.0 :w 1.0) + (-> self attack-vel) + ) + (vector+! + (-> gp-3 fountain-rand-transv-hi) + (new 'static 'vector :x 245760.0 :y 245760.0 :z 245760.0 :w 1.0) + (-> self attack-vel) + ) + (process-spawn + joint-exploder + (-> self exploder-skel) + (-> self exploder-anim) + gp-3 + (-> self exploder-params) + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 2)) + (suspend) + ) + ) + (cleanup-for-death self) + ) + :post #f + ) + +(deftype comb-sentinel (comb-sentry) + () + ) + + +(deftype rail-sentinel (comb-sentry) + () + ) diff --git a/goal_src/jak3/levels/comb/comb-travel.gc b/goal_src/jak3/levels/comb/comb-travel.gc index d97765530a..7f657723b7 100644 --- a/goal_src/jak3/levels/comb/comb-travel.gc +++ b/goal_src/jak3/levels/comb/comb-travel.gc @@ -7,3 +7,317 @@ ;; DECOMP BEGINS +(deftype task-manager-tube-ride (task-manager) + ((suck-factor float) + (hp-scale float) + (intro-sequence basic) + (outro-sequence basic) + (no-shoot-time time-frame) + (end-sphere sphere :inline) + (end-plane vector :inline) + (intro-sphere sphere :inline) + (outro-sphere sphere :inline) + (intro-target vector :inline) + (outro-target vector :inline) + (outro-plane2 vector :inline) + (outro-target2 vector :inline) + ) + (:methods + (set-sbanks (_type_) none) + ) + ) + + +(defmethod task-manager-method-26 ((this task-manager-tube-ride)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (let* ((s4-0 (handle->process (-> this player-vehicle))) + (s5-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when s5-0 + (if (focus-test? s5-0 dead) + (send-event this 'fail) + ) + (if (time-elapsed? (-> this no-shoot-time) (seconds 0.1)) + (logclear! (-> s5-0 focus-status) (focus-status ignore)) + (logior! (-> s5-0 focus-status) (focus-status ignore)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-tube-ride)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this hp-scale) 1.0) + (set! (-> this intro-sequence) #f) + (set! (-> this outro-sequence) #f) + (let ((a2-0 (-> this node-info death-count))) + (set! (-> this suck-factor) (cond + ((< a2-0 (the-as uint 5)) + 0.0 + ) + ((< a2-0 (the-as uint 10)) + 0.25 + ) + (else + (fmin 1.0 (* 0.05 (the float a2-0))) + ) + ) + ) + (format #t "tube-ride::initialize death-count ~d, suck-factor ~f~%" a2-0 (-> this suck-factor)) + ) + (none) + ) + +(defmethod set-sbanks ((this task-manager-tube-ride)) + (set-setting! 'music 'combs 0.0 0) + 0 + (none) + ) + +(defmethod taskman-event-handler ((this task-manager-tube-ride) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('no-shoot) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> this no-shoot-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate active (task-manager-tube-ride) + :virtual #t + :code (behavior () + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + (until #f + (if (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (goto cfg-8) + ) + (suspend) + ) + #f + (label cfg-8) + (suspend) + (until #f + (let ((v1-13 (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)))) + (when v1-13 + (set! (-> self player-vehicle) (process->handle v1-13)) + (goto cfg-23) + ) + ) + (suspend) + ) + #f + (label cfg-23) + (cond + ((-> self intro-sequence) + (send-event (handle->process (-> self player-vehicle)) 'ignore-impulse #t) + (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #t) + (until #f + (if (and *target* (focus-test? *target* pilot-riding)) + (goto cfg-46) + ) + (suspend) + ) + #f + (label cfg-46) + (set-sbanks self) + (send-event (handle->process (-> self player-vehicle)) 'ignore-impulse #f) + (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #f) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-speed 0) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-position (-> self intro-target)) + (until #f + (let* ((s5-0 (handle->process (-> self player-vehicle))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when gp-0 + (send-event gp-0 'set-control-hook-ai) + (if (< (vector-vector-distance (-> gp-0 root trans) (-> self intro-sphere)) (-> self intro-sphere r)) + (goto cfg-89) + ) + ) + ) + (suspend) + ) + #f + (label cfg-89) + (send-event (handle->process (-> self player-vehicle)) 'set-control-hook-player) + (send-event (handle->process (-> self player-vehicle)) 'in-tunnel #t) + ) + (else + (set-sbanks self) + ) + ) + (send-event + (handle->process (-> self player-vehicle)) + 'scale-max-hit-points + (* (-> self hp-scale) (+ 1.0 (-> self suck-factor))) + ) + (send-event (handle->process (-> self player-vehicle)) 'ignore-impulse #f) + (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #f) + (when (-> self outro-sequence) + (until #f + (let* ((gp-1 (handle->process (-> self player-vehicle))) + (v1-134 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when v1-134 + (if (< (vector-vector-distance (-> (the-as process-focusable v1-134) root trans) (-> self outro-sphere)) + (-> self outro-sphere r) + ) + (goto cfg-139) + ) + ) + ) + (suspend) + ) + #f + (label cfg-139) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-position (-> self outro-target)) + (send-event (handle->process (-> self player-vehicle)) 'set-control-hook-ai) + (until #f + (let* ((gp-2 (handle->process (-> self player-vehicle))) + (v1-156 (if (type? gp-2 process-focusable) + gp-2 + ) + ) + ) + (when v1-156 + (if (< 0.0 (vector4-dot (-> (the-as process-focusable v1-156) root trans) (-> self outro-plane2))) + (goto cfg-166) + ) + ) + ) + (suspend) + ) + #f + (label cfg-166) + (send-event (handle->process (-> self player-vehicle)) 'in-tunnel #f) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-position (-> self outro-target2)) + ) + (until #f + (let* ((s5-1 (handle->process (-> self player-vehicle))) + (gp-3 (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + ) + (when gp-3 + (if (and (< (vector-vector-distance (-> gp-3 root trans) (-> self end-sphere)) (-> self end-sphere r)) + (< 0.0 (vector4-dot (-> gp-3 root trans) (-> self end-plane))) + ) + (send-event self 'complete) + ) + ) + ) + (suspend) + ) + #f + (let ((t9-29 (-> (find-parent-state) code))) + (if t9-29 + ((the-as (function none) t9-29)) + ) + ) + ) + ) + +(defstate complete (task-manager-tube-ride) + :virtual #t + :code (behavior () + (remove-setting! 'pilot-exit) + (set-setting! 'pilot #f 0.0 0) + (let ((t9-3 (-> (find-parent-state) code))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + +(deftype task-manager-comb-travel (task-manager-tube-ride) + () + ) + + +(defmethod set-time-limit ((this task-manager-comb-travel)) + (call-parent-method this) + (set! (-> this end-sphere quad) + (-> (new 'static 'vector :x 14454784.0 :y -163840.0 :z 607027.2 :w 409600.0) quad) + ) + (set! (-> this end-plane quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) + (set! (-> this intro-sequence) (the-as basic #t)) + (set! (-> this intro-sphere quad) + (-> (new 'static 'vector :x 1083801.6 :y -81920.0 :z 45056.0 :w 122880.0) quad) + ) + (set! (-> this intro-target quad) (-> this intro-sphere quad)) + (set! (-> this outro-sequence) (the-as basic #t)) + (set! (-> this outro-sphere quad) + (-> (new 'static 'vector :x 13798605.0 :y -226099.2 :z 614400.0 :w 491520.0) quad) + ) + (set! (-> this outro-target quad) + (-> (new 'static 'vector :x 13798605.0 :y -4096000.0 :z 614400.0 :w 1.0) quad) + ) + (set! (-> this outro-target2 quad) + (-> (new 'static 'vector :x 13549568.0 :y -225280.0 :z 614400.0 :w 1.0) quad) + ) + (set! (-> this outro-plane2 quad) (-> this end-plane quad)) + (set! (-> this outro-plane2 w) (- (vector-dot (-> this outro-plane2) (-> this outro-target2)))) + 0 + (none) + ) + +(defstate complete (task-manager-comb-travel) + :virtual #t + :code (behavior () + (send-event *target* 'end-mode 'pilot) + (send-event (handle->process (-> self player-vehicle)) 'sled-disable) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (let ((t9-3 (-> (find-parent-state) code))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + +(deftype task-manager-comb-wild-ride (task-manager-tube-ride) + () + ) + + +(defmethod set-time-limit ((this task-manager-comb-wild-ride)) + (call-parent-method this) + (set! (-> this hp-scale) 2.0) + (set! (-> this end-sphere quad) + (-> (new 'static 'vector :x 68403.2 :y -14056653.0 :z -3796582.5 :w 409600.0) quad) + ) + (set! (-> this end-plane quad) (-> (new 'static 'vector :x -0.0162 :y -0.3505 :z -0.9364 :w 1.0) quad)) + (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) + (set-blackout-frames (seconds 0.3)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/comb/comba-init.gc b/goal_src/jak3/levels/comb/comba-init.gc index e291808637..86350094af 100644 --- a/goal_src/jak3/levels/comb/comba-init.gc +++ b/goal_src/jak3/levels/comb/comba-init.gc @@ -7,3 +7,39 @@ ;; DECOMP BEGINS +(defun comba-login ((arg0 level)) + (format 0 "comba-login~%") + 0 + (none) + ) + +(defun comba-activate ((arg0 level)) + (format 0 "comba-activate~%") + (let ((v1-0 *traffic-info*) + (a0-2 (-> arg0 name)) + ) + (set! (-> v1-0 vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 10) a0-2) + (set! (-> v1-0 vehicle-levels 12) a0-2) + (set! (-> v1-0 vehicle-levels 13) a0-2) + (set! (-> v1-0 vehicle-levels 14) a0-2) + (set! (-> v1-0 vehicle-levels 15) a0-2) + (set! (-> v1-0 vehicle-levels 16) a0-2) + (set! (-> v1-0 vehicle-levels 17) a0-2) + (set! (-> v1-0 vehicle-levels 18) a0-2) + (set! (-> v1-0 vehicle-levels 19) a0-2) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +(defun comba-deactivate ((arg0 level)) + (format 0 "comba-deactivate~%") + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 vehicle-level) (the-as level #f)) + ) + (vehicle-manager-kill) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/comb/combx-scenes.gc b/goal_src/jak3/levels/comb/combx-scenes.gc index 59c087a54c..72e06462b7 100644 --- a/goal_src/jak3/levels/comb/combx-scenes.gc +++ b/goal_src/jak3/levels/comb/combx-scenes.gc @@ -7,3 +7,106 @@ ;; DECOMP BEGINS +(defskelgroup skel-tpl-elevator-movie tpl-elevator tpl-elevator-lod0-jg tpl-elevator-idle-ja + ((tpl-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 3 + ) + +(load-scene + (new 'static 'scene + :name "comb-entrance-temple" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-206" + :art-group "scenecamera" + :anim "comb-entrance-temple" + :parts 5 + :command-list '((0 + (fadein (frame-time-30 10)) + (kill "tpl-mardoor-5") + (kill "tpl-elevator-2") + (kill "combx-elevator-1") + (send-event "tpl-elevator-movie" 'segment 1 2) + ) + (65 (send-event "tpl-elevator-movie" 'segment 3)) + (91 (want-load 'comba 'combx 'combb)) + (450 (want-display 'comba 'display)) + (532 (send-event "tpl-elevator-movie" 'segment 1 2)) + (555 (fadeout (frame-time-30 15))) + (10000 (restore "tpl-elevator-2") (restore "combx-elevator-1") (task-close! "temple-tests-resolution") (save)) + ) + :cut-list '(91 211 391) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'combx + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '(((90 500) set-flags local-space)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'combx + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tpl-elevator-movie" + :level 'combx + :art-group "skel-tpl-elevator-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x1 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "temple-comb-entrance" + :end-point "comba-elevator" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "tunnel-amb-mov") (sound-play-loop "launch-amb-mov")) + :on-complete #f + ) + ) diff --git a/goal_src/jak3/levels/comb/h-sled.gc b/goal_src/jak3/levels/comb/h-sled.gc index edc9febba6..f901006537 100644 --- a/goal_src/jak3/levels/comb/h-sled.gc +++ b/goal_src/jak3/levels/comb/h-sled.gc @@ -5,5 +5,1939 @@ ;; name in dgo: h-sled ;; dgos: RAILA, COMBA +(deftype h-sled-stack-var0 (structure) + ((vec vector 3 :inline :offset 0) + (vec1 vector 2 :inline :offset 64) + (byte0 int8 :offset 128) + (float0 float :offset 132) + (float1 float :offset 136) + ) + ) + +(deftype h-sled-stack-var1 (structure) + ((vec0 vector :inline :offset 0) + (mat matrix :inline :offset 16) + (glow sprite-glow-data :inline :offset 80) + ) + ) + ;; DECOMP BEGINS +(deftype hud-sled-health (hud) + () + ) + + +(defmethod draw ((this hud-sled-health)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 5 366) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 4 6) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-1 (fmax 0.0 (fmin 1.0 (-> *game-info* health-bar-vehicle))))) + (set! (-> this sprites 1 color x) (the int (* 255.0 (- 1.0 f0-1)))) + (set! (-> this sprites 1 color y) (the int (* 255.0 f0-1))) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* 20.5 f0-1)) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-sled-health)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-sled-health)) + (vehicle-entity-hack 27) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action play) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (lookup-texture-by-name + "hud-small-vehicle-health-bar-02" + (the-as string #f) + (the-as (pointer texture-page) #f) + ) + ) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags)) + (set! (-> this sprites 0 scale-x) 1.43) + (set! (-> this sprites 0 scale-y) 1.3) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 2.5) + (set! (-> this sprites 1 color w) 48) + 0 + (none) + ) + +(defun hud-sled-health-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn hud-sled-health :init hud-init-by-other :name "hud-sled-health" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +(deftype pre-sled (process-drawable) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this pre-sled) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :w 1.0)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 32768.0) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 behavior) (the-as uint 0)) + (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)) + (set! (-> s4-0 guard-type) (the-as uint 11)) + (set! (-> s4-0 entity) arg0) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) + (vehicle-spawn (vehicle-type h-sled) s4-0) + ) + (cleanup-for-death this) + ) + +(defun sled-find-mesh-dir ((arg0 vector) (arg1 vector) (arg2 collide-tri-result)) + (local-vars (a0-8 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'h-sled-stack-var0))) + (vector-! (the-as vector (-> s4-0 vec)) (-> arg2 vertex 2) (-> arg2 vertex 1)) + (vector-! (-> s4-0 vec 1) (the-as vector (-> arg2 vertex)) (-> arg2 vertex 2)) + (vector-! (-> s4-0 vec 2) (-> arg2 vertex 1) (the-as vector (-> arg2 vertex))) + (set! (-> s4-0 byte0) -1) + (set! (-> s4-0 float1) -1.0) + (dotimes (v1-5 3) + (.lvf vf1 (&-> (-> s4-0 vec v1-5) 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 a0-8 vf1) + (set! (-> s4-0 float0) a0-8) + (when (< (-> s4-0 float1) (-> s4-0 float0)) + (set! (-> s4-0 float1) (-> s4-0 float0)) + (set! (-> s4-0 byte0) v1-5) + ) + ) + (if (< (-> s4-0 byte0) 2) + (set! (-> s4-0 vec (-> s4-0 byte0) quad) (-> s4-0 vec 2 quad)) + ) + (dotimes (s3-0 2) + (let ((s2-0 (-> s4-0 vec1 s3-0))) + (vector-normalize-copy! s2-0 (-> s4-0 vec s3-0) 1.0) + (let ((f0-5 (vector-dot s2-0 arg1))) + (when (< f0-5 0.0) + (vector-float*! s2-0 s2-0 -1.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (if (>= f0-5 0.866) + (set! (-> arg0 quad) (-> s2-0 quad)) + ) + ) + ) + ) + ) + 0 + 0 + (none) + ) + ) + +(deftype sled-shot (projectile) + ((tail-pos vector :inline) + ) + ) + + +(defmethod projectile-method-24 ((this sled-shot)) + (draw-beam (-> *part-id-table* 4234) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4235)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this sled-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 4231 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 4231) a1-0 s5-1 #f) + (set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 4232) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix))) + (* 0.000027126736 f30-0) + (-> *part-id-table* 4233 init-specs 3 initial-valuef) + (-> *part-id-table* 4233 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (launch-particles (-> *part-id-table* 4233) s4-1 :origin-is-matrix #t) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this sled-shot)) + (let* ((gp-0 (-> this root)) + (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) + (v1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector+! v1-2 v1-2 a0-3) + (cond + ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + ) + ) + 0 + (none) + ) + +(defun sled-shot-move ((arg0 sled-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s4-0 (-> arg0 root)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s5-0 (-> arg0 tail-pos) (-> s4-0 trans)) + (let ((f0-0 (vector-length s5-0))) + (when (< 36864.0 f0-0) + (vector-normalize! s5-0 36864.0) + (vector+! (-> arg0 tail-pos) (-> s4-0 trans) s5-0) + ) + ) + ) + (if (or (logtest? (-> arg0 root status) (collide-status touch-actor)) (< 0.5 (-> arg0 root touch-angle))) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +(defun sled-shot-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 1))) + (vector+float*! + (-> s4-0 0) + arg3 + (-> arg0 surface-normal) + (* -1.01 (vector-dot arg3 (-> arg0 surface-normal))) + ) + (vector-normalize! (-> s4-0 0) 1024000.0) + (set! (-> arg2 quad) (-> s4-0 0 quad)) + ) + (-> arg0 status) + ) + +(defmethod setup-collision! ((this sled-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) sled-shot-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 4)) + (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) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod init-proj-settings! ((this sled-shot)) + (let ((t9-0 (method-of-type projectile init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this attack-mode) 'sled-shot) + (set! (-> this move) sled-shot-move) + (set! (-> this max-speed) 1024000.0) + (set! (-> this damage) 1.0) + (set! (-> this timeout) (seconds 1)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (none) + ) + +(defskelgroup skel-h-sled comb-rail-rider comb-rail-rider-lod0-jg comb-rail-rider-idle-ja + ((comb-rail-rider-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + :shadow comb-rail-rider-shadow-mg + ) + +(define *h-sled-explosion-info* + (new 'static 'vehicle-explosion-info + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'comba + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +(define *h-sled-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.1 + :friction-factor 0.05 + :cm-offset-joint (new 'static 'vector :y 4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 2) (meters 10)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 72) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*h-sled-constants* + :flags #x4009 + :object-type #x14 + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 20.0 + :engine-intake-factor 1.0 + :brake-factor 1.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 400) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 2.0 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 3.5 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-angle 1274.3112 + :tire-steering-speed-factor 61440.0 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :drag-force-factor 0.7 + :speed-scrubbing-drag 10.0 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 16384.0 :z -41779.2 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.09 + :engine-pitch-mod-amp 0.01 + :engine-sound-select 5 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "car-scrape-stn") + :glance-sound (static-sound-name "impact-soft") + :impact-sound (static-sound-name "impact-hard") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "combveh-start") + :engine-sound (static-sound-name "combveh-engine") + :engine-load-sound (static-sound-name "combveh-high") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -3072.0 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 40.0 + :inv-hit-points 0.025 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 4 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.25 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :y 819.2 :z 12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :y 819.2 :z 12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :y 819.2 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :y 819.2 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 4096.0 :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 4915.2 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x1 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 5734.4 :z -1146.88 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 5734.4 :z -1146.88 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2252.8 :y 8192.0 :z 2375.68 :w 1.0) + (new 'static 'vector :x -2252.8 :y 8192.0 :z 2375.68 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +(set! (-> *h-sled-constants* explosion) *h-sled-explosion-info*) + +(deftype h-sled-probe-work (structure) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (probe-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (velocity vector :inline) + (u-dir vector :inline) + (probe-uu float) + ) + ) + + +(deftype h-sled-physics-work (structure) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (lift-dir vector :inline) + (normal vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal vector :inline) + (edges vector 3 :inline) + (edge-dirs vector 3 :inline) + (impulse float) + (vel-dot-norm float) + (friction-coef float) + (speed-factor float) + (best-len float) + (len float) + (i-longest int8) + (probe-work-array h-sled-probe-work 4 :inline) + ) + ) + + +(deftype h-sled (vehicle) + ((health-hud handle) + (overturned-time time-frame) + (shoot-time time-frame) + (shoot-delay uint16) + (rider-hand-joint-array int8 2) + (i-barrel int8) + (ai-target-speed float) + (engine-thrust float) + (engine-sound-envelope float) + (engine-sound-id sound-id) + (steer-sound-id sound-id) + (turbo-sound-id sound-id) + (in-tunnel symbol :offset 756) + (whoosh-time time-frame) + (parts sparticle-launch-control 4) + (gravity-dir vector :inline) + (path-pos vector :inline) + (path-dir vector :inline) + (tunnel-dir vector :inline) + (prev-tunnel-dir vector :inline) + (sum-ground-normal vector :inline) + (normal-dir vector :inline) + (impact-normal vector :inline) + (side-dir vector :inline) + (ai-target-pos vector :inline) + (whoosh-pos vector :inline) + (ground-pos-array vector 4 :inline) + ) + (:methods + (fire-shot (_type_) none) + ) + ) + + +(defmethod relocate ((this h-sled) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) offset) + ) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this h-sled)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (dotimes (s5-0 4) + (let ((a0-1 (-> this parts s5-0))) + (if (nonzero? a0-1) + (kill-particles a0-1) + ) + ) + ) + (call-parent-method this) + (none) + ) + +(defmethod vehicle-method-113 ((this h-sled) (arg0 vector) (arg1 int) (arg2 int)) + (vector-matrix*! + arg0 + (-> this info rider rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod fire-shot ((this h-sled)) + (sound-play "combveh-fire") + (dotimes (s5-1 2) + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((s4-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) + (set! (-> s4-1 byte0) (-> this i-barrel)) + (let* ((v1-5 (-> s4-1 mat)) + (a3-1 (-> this rbody matrix)) + (a0-4 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-5 rvec quad) a0-4) + (set! (-> v1-5 uvec quad) a1-1) + (set! (-> v1-5 fvec quad) a2-1) + (set! (-> v1-5 trans quad) a3-2) + ) + (let ((v1-6 (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) + ) + ) + ) + (vector-matrix*! (-> s4-1 vec2) (-> v1-6 (-> s4-1 byte0)) (-> s4-1 mat)) + ) + 0 + (let ((v1-8 (new 'static 'inline-array vector 2 + (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) + (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) + ) + ) + ) + (vector-rotate*! (-> s4-1 vec3) (-> v1-8 (-> s4-1 byte0)) (-> s4-1 mat)) + ) + (vector-float*! (-> s4-1 vec4) (-> s4-1 vec3) 1024000.0) + (vector+! (-> s4-1 vec4) (-> s4-1 vec4) (-> this rbody lin-velocity)) + (set! (-> s4-1 params ent) (-> this entity)) + (set! (-> s4-1 params charge) 1.0) + (set! (-> s4-1 params options) (projectile-options)) + (logclear! (-> s4-1 params options) (projectile-options po14 po15 po16)) + (set! (-> s4-1 params pos quad) (-> s4-1 vec2 quad)) + (set! (-> s4-1 params vel quad) (-> s4-1 vec4 quad)) + (set! (-> s4-1 params notify-handle) (the-as handle #f)) + (set! (-> s4-1 params owner-handle) (the-as handle #f)) + (set! (-> s4-1 params target-handle) (the-as handle #f)) + (set! (-> s4-1 params target-pos quad) (the-as uint128 0)) + (set! (-> s4-1 params ignore-handle) (process->handle this)) + (let* ((v1-23 *game-info*) + (a0-20 (+ (-> v1-23 attack-id) 1)) + ) + (set! (-> v1-23 attack-id) a0-20) + (set! (-> s4-1 params attack-id) a0-20) + ) + (set! (-> s4-1 params timeout) (seconds 4)) + (spawn-projectile sled-shot (-> s4-1 params) this *default-dead-pool*) + ) + ) + (none) + ) + +(defmethod init-collision! ((this h-sled)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 80)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-22 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-22 transform-index) 0) + (set! (-> v1-22 nav-radius) 20480.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod vehicle-method-62 ((this h-sled)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 6144.0 :y 5324.8 :z 7864.32 :w 5324.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -6144.0 :y 5324.8 :z 7864.32 :w 5324.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 7372.8 :y 4096.0 :z -11878.4 :w 4096.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -7372.8 :y 4096.0 :z -11878.4 :w 4096.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 4505.6 :z 15155.2 :w 4505.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 6144.0 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 5734.4 :z -13516.8 :w 5734.4)) + 16 + ) + ) + (call-parent-method this) + 0 + (none) + ) + +(defmethod alloc-rbody-control! ((this h-sled) (arg0 rigid-body-object-constants)) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 2))) + (vector-y-quaternion! (-> s4-0 0) (-> this root quat)) + (vector+float*! + (-> this root trans) + (-> this root trans) + (-> s4-0 0) + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-height) + ) + (quaternion-axis-angle! + (the-as quaternion (-> s4-0 1)) + 1.0 + 0.0 + 0.0 + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-rot-x) + ) + (quaternion*! (-> this root quat) (-> this root quat) (the-as quaternion (-> s4-0 1))) + ) + ((method-of-type vehicle alloc-rbody-control!) this (the-as rigid-body-vehicle-constants arg0)) + (none) + ) + +(defmethod init-rbody-control! ((this h-sled)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-sled" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-sled-constants*) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this draw lod-set lod 0 dist) 2457600.0) + (set! (-> this draw lod-set lod 1 dist) 2457600.0) + (set! (-> this draw lod-set lod 2 dist) 2457600.0) + (set! (-> this draw lod-set lod 3 dist) 2457600.0) + (set! (-> this rider-hand-joint-array 0) 3) + (set! (-> this rider-hand-joint-array 1) 3) + (set! (-> this path-pos quad) (-> this root trans quad)) + (set! (-> this shoot-delay) (the-as uint 30)) + (set! (-> this in-tunnel) #f) + (dotimes (s5-1 4) + (set! (-> this parts s5-1) (create-launch-control (-> *part-group-id-table* 1234) this)) + ) + (set! (-> this health-hud) (the-as handle #f)) + (set! (-> this max-time-step) 0.02) + 0 + (none) + ) + +(defmethod vehicle-method-132 ((this h-sled) (arg0 traffic-object-spawn-params)) + (set! (-> this entity) (the-as entity-actor (-> arg0 entity))) + (if (not (-> this entity)) + (set! (-> this entity) (entity-by-type pre-sled)) + ) + (set! (-> this v-flags) + (the-as vehicle-flag (logior (vehicle-flag ignore-damage ignore-impulse) (-> this v-flags))) + ) + (when (-> this entity) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (if (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + ) + (call-parent-method this arg0) + 0 + (none) + ) + +(defmethod vehicle-method-92 ((this h-sled) (arg0 vehicle-controls)) + (seek! (-> this controls steering) (-> arg0 steering) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 lean-z) (* 8.0 (seconds-per-frame))) + (let ((f0-10 (-> arg0 throttle)) + (f30-0 (-> arg0 brake)) + ) + (seek! (-> this controls throttle) f0-10 (* 4.0 (seconds-per-frame))) + (set! (-> this controls brake) f30-0) + ) + (set! (-> this controls prev-flags) (-> this controls flags)) + (set! (-> this controls flags) (-> arg0 flags)) + 0 + (none) + ) + +(defmethod vehicle-method-88 ((this h-sled) (arg0 vehicle-controls)) + (set! (-> arg0 steering) (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 lean-z) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 throttle) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6))))) + (set! (-> arg0 brake) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7))))) + (if (cpad-pressed? 0 r1) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf1)) + ) + 0 + (none) + ) + +(defmethod control-hook-ai ((this h-sled) (arg0 vehicle-controls)) + (let ((gp-0 (new 'stack-no-clear 'h-sled-physics-work))) + (mem-set32! (the-as pointer (-> gp-0 mat)) 6 0) + (set! (-> gp-0 p-body y) (seconds-per-frame)) + (set! (-> gp-0 mat fvec quad) (-> this rbody position quad)) + (set! (-> gp-0 mat trans quad) (-> this rbody lin-velocity quad)) + (set! (-> gp-0 steering-axis quad) (-> this rbody matrix fvec quad)) + (set! (-> gp-0 local-pos quad) (-> this rbody matrix rvec quad)) + (set! (-> gp-0 tmp x) (vector-length (-> gp-0 mat trans))) + (set! (-> gp-0 p-body x) (vector-dot (-> gp-0 mat trans) (-> gp-0 steering-axis))) + (set! (-> gp-0 tmp z) (-> this ai-target-speed)) + (set! (-> gp-0 world-pos quad) (-> this ai-target-pos quad)) + (vector-! (-> gp-0 lift-dir) (-> gp-0 world-pos) (-> gp-0 mat fvec)) + (set! (-> gp-0 tmp w) (* 0.00036621094 + (- (-> gp-0 tmp z) (-> gp-0 p-body x)) + (-> this info handling ai-throttle-factor) + (-> gp-0 p-body y) + ) + ) + (set! (-> gp-0 mat rvec y) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) (-> gp-0 tmp w))))) + (set! (-> gp-0 mat rvec x) (fmax -1.0 (fmin 1.0 (* 0.000012207031 + (-> this info handling ai-steering-factor) + (vector-dot (-> gp-0 local-pos) (-> gp-0 lift-dir)) + ) + ) + ) + ) + (vehicle-method-92 this (the-as vehicle-controls (-> gp-0 mat))) + ) + 0 + (none) + ) + +(defmethod vehicle-method-82 ((this h-sled)) + 0 + (none) + ) + +(defmethod vehicle-method-83 ((this h-sled)) + 0 + (none) + ) + +(defmethod vehicle-method-94 ((this h-sled)) + 0 + (none) + ) + +(defmethod on-impact ((this h-sled) (arg0 rigid-body-impact)) + (set! (-> this impact-normal quad) (-> arg0 normal quad)) + (call-parent-method this arg0) + (none) + ) + +(defmethod rbody-event-handler ((this h-sled) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 object)) + (case arg2 + (('turbo-pad) + (when (not (logtest? (vehicle-flag turbo-boost) (-> this v-flags))) + (sound-play "special-pickup") + (sound-play "launch-whoosh") + ) + (the-as float (-> arg3 param 0)) + (set! (-> this turbo-boost-factor) 4.0) + (set! (-> this turbo-boost-time) (the-as uint (current-time))) + (set! (-> this turbo-boost-duration) (the-as uint 60)) + (set! v0-4 (logior (vehicle-flag turbo-boost) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-4)) + v0-4 + ) + (('sled-disable) + (set! v0-4 (logior (-> this v-flags) (vehicle-flag dead))) + (set! (-> this v-flags) (the-as vehicle-flag v0-4)) + v0-4 + ) + (('ai-set-target-speed) + (set! (-> this ai-target-speed) (the-as float (-> arg3 param 0))) + ) + (('ai-set-target-position) + (let ((v1-15 (the-as object (-> arg3 param 0)))) + (set! v0-4 (-> this ai-target-pos)) + (set! (-> (the-as vector v0-4) quad) (-> (the-as vector v1-15) quad)) + ) + v0-4 + ) + (('hide) + (set! v0-4 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-4)) + v0-4 + ) + (('unhide) + (set! v0-4 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-4)) + v0-4 + ) + (('in-tunnel) + (set! (-> this in-tunnel) (the-as symbol (-> arg3 param 0))) + (set! (-> this whoosh-pos quad) (-> this root trans quad)) + (set! v0-4 (current-time)) + (set! (-> this whoosh-time) (the-as time-frame v0-4)) + v0-4 + ) + (else + ((method-of-type vehicle rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod vehicle-method-93 ((this h-sled)) + (let ((t9-0 (method-of-type vehicle vehicle-method-93))) + (t9-0 this) + ) + (let ((f0-0 (vector-vector-distance (-> this path-pos) (-> this root trans)))) + (when (-> this in-tunnel) + (if (or (< 204800.0 f0-0) (< (vector-dot (-> this tunnel-dir) (-> this rbody lin-velocity)) 40960.0)) + (set! (-> this hit-points) -1.0) + ) + ) + ) + 0 + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((a0-4 (camera-matrix))) + (vector-float*! (-> s5-0 rvec) (-> a0-4 uvec) -1.0) + ) + (set! (-> s5-0 uvec quad) (-> this tunnel-dir quad)) + (vector+float*! (-> s5-0 rvec) (-> s5-0 rvec) (-> s5-0 uvec) (- (vector-dot (-> s5-0 rvec) (-> s5-0 uvec)))) + (vector-normalize! (-> s5-0 rvec) 1.0) + (set! (-> this gravity-dir quad) (-> s5-0 rvec quad)) + ) + (if (or (not (logtest? (-> this v-flags) (vehicle-flag on-ground))) + (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + ) + (set! (-> this gravity-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) + ) + (cond + ((logtest? (vehicle-flag ignition) (-> this v-flags)) + (let ((f1-4 (+ 0.75 (* 0.25 (-> this controls throttle))))) + (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (set! f1-4 (+ 1.0 (* (-> this turbo-boost-factor) (-> this info handling turbo-boost-factor)))) + ) + (if (< (-> this engine-thrust) f1-4) + (+! (-> this engine-thrust) + (* (- f1-4 (-> this engine-thrust)) + (fmin 1.0 (* (-> this info handling engine-response-rate) (seconds-per-frame))) + ) + ) + (seek! (-> this engine-thrust) f1-4 (seconds-per-frame)) + ) + ) + ) + (else + (set! (-> this engine-thrust) 0.0) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-77 ((this h-sled)) + (local-vars (v1-10 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds particles) (-> this v-flags)))) + (let ((v1-3 (-> this rbody))) + (cond + ((logtest? (vehicle-flag overturned) (-> this v-flags)) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag in-air))) (< 0.0 (-> v1-3 matrix uvec y))) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag overturned)))) + ) + ) + (else + (when (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (-> v1-3 matrix uvec y) 0.0) + (let ((v1-9 (-> v1-3 ang-velocity)) + (f1-2 4.0) + ) + (.lvf vf1 (&-> v1-9 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-10 vf1) + (< v1-10 (* f1-2 f1-2)) + ) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag overturned) (-> this v-flags)))) + (set-time! (-> this overturned-time)) + ) + ) + ) + ) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf1)) + (time-elapsed? (-> this shoot-time) (the-as time-frame (-> this shoot-delay))) + ) + (set-time! (-> this shoot-time)) + (fire-shot this) + ) + (set! (-> *game-info* health-bar-vehicle) (-> this hit-points)) + ) + ((method-of-type vehicle vehicle-method-77) this) + (none) + ) + ) + +(defmethod vehicle-method-106 ((this h-sled)) + (let ((t9-0 (method-of-type vehicle vehicle-method-106))) + (t9-0 this) + ) + (sound-stop (-> this engine-sound-id)) + (sound-stop (-> this steer-sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this engine-sound-envelope) 0.0) + 0 + (none) + ) + +(defmethod rigid-body-object-method-38 ((this h-sled)) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-38))) + (t9-0 this) + ) + (if (logtest? (vehicle-flag ignition) (-> this v-flags)) + (seek! (-> this engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this engine-sound-envelope) 0.0 (seconds-per-frame)) + ) + (when (-> this in-tunnel) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 fvec x) + (fmax 0.0 (fmin 2.0 (* 0.0000030517579 (vector-dot (-> this tunnel-dir) (-> this root transv))))) + ) + (set! (-> s5-0 uvec quad) (-> this root trans quad)) + (vector-! (-> s5-0 rvec) (-> s5-0 uvec) (-> this whoosh-pos)) + (when (< 131072.0 (vector-dot (-> this tunnel-dir) (-> s5-0 rvec))) + (sound-play-by-name + (static-sound-name "pass-whoosh1") + (new-sound-id) + 1024 + (the int (* 1524.0 (-> s5-0 fvec x))) + 0 + (sound-group) + #t + ) + (set! (-> this whoosh-pos quad) (-> s5-0 uvec quad)) + (set-time! (-> this whoosh-time)) + ) + (set! (-> s5-0 fvec x) + (fmax 0.0 (fmin 2.0 (* 0.000002325149 (vector-dot (-> this tunnel-dir) (-> this root transv))))) + ) + ) + ) + (cond + ((< 0.0 (-> this engine-sound-envelope)) + (when (zero? (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this steer-sound-id) (new-sound-id)) + (set! (-> this turbo-sound-id) (new-sound-id)) + ) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (set! (-> s5-1 0 x) + (fmax 0.0 (fmin 2.0 (* 0.000002325149 (vector-dot (-> this tunnel-dir) (-> this root transv))))) + ) + (set! (-> s5-1 0 y) + (fmax 0.0 (fmin 1.0 (* 0.0000048828124 (fabs (vector-dot (-> this side-dir) (-> this root transv)))))) + ) + (set! (-> s5-1 0 z) (fmin 1.0 (* (-> this engine-sound-envelope) (+ 0.6 (* 0.4 (-> s5-1 0 x)))))) + (set! (-> s5-1 0 w) (fmin 1.0 (-> s5-1 0 x))) + (set! (-> s5-1 1 x) (fmax 0.0 (fmin 1.0 (+ -1.0 (-> s5-1 0 x))))) + (set! (-> s5-1 1 y) (* 0.0 (-> s5-1 1 x))) + (set! (-> s5-1 1 z) (-> s5-1 0 y)) + (set! (-> s5-1 1 w) (* 0.5 (-> s5-1 0 y))) + (set! (-> s5-1 0 z) (cube-root (-> s5-1 0 z))) + (set! (-> s5-1 1 x) (cube-root (-> s5-1 1 x))) + (set! (-> s5-1 1 z) (cube-root (-> s5-1 1 z))) + (sound-play-by-name + (static-sound-name "combveh-engine") + (-> this engine-sound-id) + (the int (* 1024.0 (-> s5-1 0 z))) + (the int (* 1524.0 (-> s5-1 0 w))) + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "combveh-airloop") + (-> this steer-sound-id) + (the int (* 1024.0 (-> s5-1 1 z))) + (the int (* 1524.0 (-> s5-1 1 w))) + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "combveh-high") + (-> this turbo-sound-id) + (the int (* 1024.0 (-> s5-1 1 x))) + (the int (* 1524.0 (-> s5-1 1 y))) + 0 + (sound-group) + #t + ) + ) + ) + (else + (when (nonzero? (-> this engine-sound-id)) + (sound-stop (-> this engine-sound-id)) + (sound-stop (-> this steer-sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + 0 + (none) + ) + +(defmethod vehicle-method-97 ((this h-sled) (arg0 float) (arg1 vehicle-physics-work)) + (local-vars (v1-59 float) (v1-63 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (-> this rbody))) + (mem-copy! (the-as pointer (-> (the-as h-sled-physics-work arg1) mat)) (the-as pointer (-> s3-0 matrix)) 64) + (logior! (-> this v-flags) (vehicle-flag in-air)) + (logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (vector-reset! (-> this sum-ground-normal)) + (let ((f30-0 (-> this info handling ground-probe-distance)) + (s2-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> (the-as h-sled-physics-work arg1) speed-factor) + (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 lin-velocity)))))) + ) + (vector-float*! + (-> (the-as h-sled-physics-work arg1) lift-dir) + (-> (the-as h-sled-physics-work arg1) mat uvec) + -1.0 + ) + (vector-float*! (-> s2-0 move-dist) (-> (the-as h-sled-physics-work arg1) lift-dir) (the-as float f30-0)) + (let ((v1-15 s2-0)) + (set! (-> v1-15 radius) 409.6) + (set! (-> v1-15 collide-with) (collide-spec + backgnd + bot + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-15 ignore-process0) #f) + (set! (-> v1-15 ignore-process1) #f) + (set! (-> v1-15 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-15 action-mask) (collide-action solid)) + ) + (dotimes (s1-0 (-> this info physics-model lift-thruster-count)) + (let ((v1-18 (-> this info physics-model lift-thruster-array s1-0)) + (s0-0 (-> (the-as h-sled-physics-work arg1) probe-work-array s1-0)) + ) + (set! (-> s0-0 local-pos quad) (-> v1-18 local-pos quad)) + (set! (-> s0-0 local-normal quad) (-> v1-18 rot quad)) + (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> (the-as h-sled-physics-work arg1) mat)) + (set! (-> s0-0 probe-pos quad) (-> s0-0 world-pos quad)) + (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) + (vector-reset! (-> s0-0 ground-normal)) + (vector-reset! (-> s0-0 u-dir)) + (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) + (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (set! (-> s0-0 probe-uu) (probe-using-line-sphere *collide-cache* s2-0)) + (cond + ((and (>= (-> s0-0 probe-uu) 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) + (logclear! (-> this v-flags) (vehicle-flag in-air)) + (logior! (-> this v-flags) (vehicle-flag on-ground)) + (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) + (vector+! (-> this sum-ground-normal) (-> this sum-ground-normal) (-> s0-0 ground-normal)) + (sled-find-mesh-dir (-> s0-0 u-dir) (-> this path-dir) (-> s2-0 best-other-tri)) + ) + (else + (set! (-> s0-0 probe-uu) 1.0) + ) + ) + (vector+float*! + (-> s0-0 ground-pos) + (-> s0-0 probe-pos) + (-> (the-as h-sled-physics-work arg1) lift-dir) + (the-as float f30-0) + ) + 0 + ) + ) + ) + ) + (set! (-> this prev-tunnel-dir quad) (-> this tunnel-dir quad)) + (vector-reset! (-> this tunnel-dir)) + (dotimes (v1-55 (-> this info physics-model lift-thruster-count)) + (let ((a2-5 (-> (the-as h-sled-physics-work arg1) probe-work-array v1-55))) + (vector+! (-> this tunnel-dir) (-> this tunnel-dir) (-> a2-5 u-dir)) + ) + ) + (let ((f0-9 0.0)) + (.lvf vf1 (&-> (-> this tunnel-dir) 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-59 vf1) + (if (< f0-9 v1-59) + (vector-normalize! (-> this tunnel-dir) 1.0) + (set! (-> this tunnel-dir quad) (-> this path-dir quad)) + ) + ) + (let ((f0-10 0.0)) + (.lvf vf1 (&-> (-> this sum-ground-normal) 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-63 vf1) + (when (< f0-10 v1-63) + (set! (-> this normal-dir quad) (-> this sum-ground-normal quad)) + (vector-normalize! (-> this normal-dir) 1.0) + (vector-float*! (-> this gravity-dir) (-> this normal-dir) -1.0) + (vector-cross! (-> this side-dir) (-> this normal-dir) (-> this tunnel-dir)) + (vector-normalize! (-> this side-dir) 1.0) + ) + ) + (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) + (let ((s2-1 (new 'stack-no-clear 'inline-array 'vector 1))) + (matrix-from-two-vectors! (the-as matrix (-> s2-1 0)) (-> this prev-tunnel-dir) (-> this tunnel-dir)) + (vector-rotate*! (-> s3-0 lin-momentum) (-> s3-0 lin-momentum) (the-as matrix (-> s2-1 0))) + ) + (init-velocities! (-> this rbody)) + ) + (dotimes (s2-2 (-> this info physics-model lift-thruster-count)) + (let ((v1-78 (-> (the-as h-sled-physics-work arg1) probe-work-array s2-2))) + (set! (-> (the-as h-sled-physics-work arg1) world-pos quad) (-> v1-78 world-pos quad)) + (set! (-> (the-as h-sled-physics-work arg1) velocity quad) (-> v1-78 velocity quad)) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (when (< (-> v1-78 probe-uu) 1.0) + (set! (-> s1-1 x) (- 0.5 (-> v1-78 probe-uu))) + (let ((a0-54 (-> (the-as h-sled-physics-work arg1) force)) + (a1-26 (-> v1-78 ground-normal)) + (f0-15 0.5) + (f1-7 arg0) + ) + (vector-float*! + a0-54 + a1-26 + (* f0-15 + (/ 1.0 f1-7) + (-> this info physics-model inv-lift-thruster-count) + (-> this info info mass) + (- (vector-dot (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 ground-normal))) + ) + ) + ) + (apply-impact! + s3-0 + (-> (the-as h-sled-physics-work arg1) world-pos) + (-> (the-as h-sled-physics-work arg1) force) + ) + (let ((f0-25 + (* 16.0 + (-> this info info mass) + (-> this info extra gravity) + (-> this info physics-model inv-lift-thruster-count) + (-> s1-1 x) + (-> this info handling spring-lift-factor) + ) + ) + ) + (vector-float*! + (-> (the-as h-sled-physics-work arg1) force) + (-> (the-as h-sled-physics-work arg1) lift-dir) + (* -1.0 f0-25) + ) + ) + (apply-impact! + s3-0 + (-> (the-as h-sled-physics-work arg1) world-pos) + (-> (the-as h-sled-physics-work arg1) force) + ) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + ) + +(defmethod apply-gravity! ((this h-sled) (arg0 float)) + (let ((s4-0 (new 'stack-no-clear 'h-sled-physics-work)) + (s3-0 (-> this rbody)) + ) + (let ((s2-0 (-> this info))) + (mem-copy! (the-as pointer (-> s4-0 mat)) (the-as pointer (-> s3-0 matrix)) 64) + (when (nonzero? (-> this path)) + (let ((s1-0 (new 'stack-no-clear 'matrix))) + (set! (-> s1-0 fvec x) (path-control-method-24 (-> this path) (-> s3-0 position))) + (displacement-between-two-points-normalized! (-> this path) (-> s1-0 rvec) (-> s1-0 fvec x)) + (get-point-in-path! (-> this path) (-> s1-0 uvec) (-> s1-0 fvec x) 'interp) + (set! (-> this path-pos quad) (-> s1-0 uvec quad)) + (vector-float*! (-> this path-dir) (-> s1-0 rvec) -1.0) + ) + 0 + ) + (dotimes (v1-12 4) + (vector-reset! (-> this ground-pos-array v1-12)) + ) + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (vehicle-method-97 this arg0 (the-as vehicle-physics-work s4-0)) + (dotimes (v1-20 4) + (let ((a0-15 (-> s4-0 probe-work-array v1-20))) + (if (< (-> a0-15 probe-uu) 1.0) + (set! (-> this ground-pos-array v1-20 quad) (-> a0-15 ground-pos quad)) + ) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'matrix))) + (set! (-> s1-1 fvec quad) (-> s3-0 matrix fvec quad)) + (set! (-> s1-1 uvec quad) (-> s3-0 matrix uvec quad)) + (set! (-> s1-1 trans quad) (-> s3-0 matrix rvec quad)) + (vector-! (-> s1-1 rvec) (-> this tunnel-dir) (-> s1-1 fvec)) + (vector+float*! (-> s1-1 rvec) (-> s1-1 rvec) (-> s1-1 uvec) (- (vector-dot (-> s1-1 rvec) (-> s1-1 uvec)))) + (vector+float*! (-> s4-0 world-pos) (-> s3-0 position) (-> s1-1 fvec) 4096.0) + (vector-float*! + (-> s4-0 force) + (-> s1-1 trans) + (+ (* 8192000.0 (vector-dot (-> s1-1 trans) (-> s1-1 rvec))) + (* -1638400.0 (vector-dot (-> s1-1 uvec) (-> s3-0 ang-velocity))) + ) + ) + (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s4-0 world-pos) (-> s1-1 rvec) (meters 1) *color-red*) + ) + (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) + (let ((v1-39 (new 'stack-no-clear 'matrix))) + (set! (-> v1-39 rvec quad) (-> s3-0 matrix rvec quad)) + (set! (-> v1-39 rvec quad) (-> this side-dir quad)) + (set! (-> v1-39 uvec w) (vector-dot (-> v1-39 rvec) (-> s3-0 lin-velocity))) + (set! (-> v1-39 uvec z) (* (fabs (-> v1-39 uvec w)) (-> s2-0 info mass) (/ 1.0 arg0))) + (set! (-> v1-39 uvec y) + (fmax (fmin (* -4.0 (-> s2-0 info mass) (-> v1-39 uvec w)) (-> v1-39 uvec z)) (- (-> v1-39 uvec z))) + ) + (set! (-> v1-39 uvec x) (* 4.8 (-> s2-0 extra gravity) (-> s2-0 info mass) (-> this controls steering))) + (vector-float*! (-> s4-0 force) (-> v1-39 rvec) (+ (-> v1-39 uvec x) (-> v1-39 uvec y))) + ) + (add-force! s3-0 (-> s4-0 force)) + ) + (when (or (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (logtest? (-> this v-flags) (vehicle-flag impact)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (vector-dot (-> s3-0 matrix uvec) (-> this impact-normal)) 0.0) + ) + (logtest? (vehicle-flag overturned) (-> this v-flags)) + ) + (vector-reset! (-> s4-0 local-pos)) + (set! (-> s4-0 local-pos y) -6144.0) + (when (logtest? (vehicle-flag overturned) (-> this v-flags)) + (let ((f0-33 (* 0.0033333334 (the float (- (current-time) (-> this overturned-time)))))) + (set! (-> s4-0 local-pos y) (* (+ -32768.0 (* -16384.0 f0-33)) (fmax 0.1 (- (-> s3-0 matrix uvec y))))) + ) + ) + (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) + (vector-float*! (-> s4-0 force) (-> this impact-normal) (* -0.5 (-> s2-0 extra gravity) (-> s2-0 info mass))) + (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (vector-matrix*! (-> s4-0 world-pos) (-> s2-0 physics-model engine-thrust-local-pos) (-> s4-0 mat)) + (set! (-> s4-0 dir quad) (-> s4-0 mat fvec quad)) + (let ((f0-42 (* (-> this engine-thrust) (-> s2-0 handling max-engine-thrust) (-> s2-0 info mass)))) + (vector-float*! (-> s4-0 force) (-> s4-0 dir) f0-42) + ) + (apply-impact! s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (when (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + (vector-matrix*! (-> s4-0 world-pos) (-> s2-0 physics-model brake-local-pos) (-> s4-0 mat)) + (rigid-body-control-method-23 s3-0 (-> s4-0 world-pos) (-> s4-0 velocity)) + (let* ((f3-0 (vector-length (-> s4-0 velocity))) + (f0-43 (-> s2-0 info mass)) + (f1-28 (/ 0.5 arg0)) + (f2-7 98304.0) + (f3-1 (fmax 16384.0 f3-0)) + (f0-44 (* f0-43 (fmin f1-28 (* f2-7 (/ 1.0 f3-1) (-> s2-0 handling brake-factor))))) + ) + (vector-float*! (-> s4-0 force) (-> s4-0 velocity) (- f0-44)) + ) + (apply-impact! s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (set! (-> s4-0 dir quad) (-> this tunnel-dir quad)) + (let ((f0-47 (vector-dot (-> s4-0 dir) (-> s3-0 lin-velocity)))) + (vector-float*! + (-> s4-0 force) + (-> s4-0 dir) + (* -0.000012207031 (fabs f0-47) f0-47 (-> s2-0 handling drag-force-factor)) + ) + ) + (add-force! s3-0 (-> s4-0 force)) + ) + (set! (-> s4-0 local-pos quad) (-> (new 'static 'vector :z -16384.0 :w 1.0) quad)) + (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) + (rigid-body-control-method-23 s3-0 (-> s4-0 world-pos) (-> s4-0 velocity)) + (vector-reset! (-> s4-0 force)) + (set! (-> s4-0 dir quad) (-> s4-0 mat uvec quad)) + (vector+float*! + (-> s4-0 force) + (-> s4-0 force) + (-> s4-0 dir) + (* -1.0 (vector-dot (-> s4-0 dir) (-> s4-0 velocity))) + ) + (set! (-> s4-0 dir quad) (-> s4-0 mat rvec quad)) + (vector+float*! + (-> s4-0 force) + (-> s4-0 force) + (-> s4-0 dir) + (* -1.0 (vector-dot (-> s4-0 dir) (-> s4-0 velocity))) + ) + (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (vector-float*! (-> s4-0 force) (-> this gravity-dir) (* (-> s2-0 info mass) (-> s2-0 extra gravity))) + ) + (add-force! s3-0 (-> s4-0 force)) + ) + (rigid-body-object-method-53 this arg0) + 0 + (none) + ) + +(defstate explode (h-sled) + :virtual #t + :enter (behavior () + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (logior! (-> self draw status) (draw-control-status no-draw)) + (send-event (vehicle-method-68 self) 'draw #f) + (let ((t9-2 (-> (method-of-type vehicle explode) enter))) + (if t9-2 + (t9-2) + ) + ) + (sound-play "combveh-explode") + (let ((a0-6 (-> self draw color-mult))) + (vector-float*! (the-as vector a0-6) (the-as vector a0-6) 0.25) + ) + (disable-physics! self) + (rigid-body-object-method-43 self) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-2 spawn-quat)) + (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) + (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) + (set! (-> gp-2 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-2 damage) 2.0) + (set! (-> gp-2 damage-scale) 1.0) + (set! (-> gp-2 vehicle-damage-factor) 1.0) + (set! (-> gp-2 vehicle-impulse-factor) 1.0) + (set! (-> gp-2 ignore-proc) (process->handle #f)) + (explosion-spawn gp-2 (the-as process-drawable *default-pool*)) + ) + (let ((gp-3 (-> self info explosion))) + (when gp-3 + (set! (-> gp-3 skel) + (the-as skeleton-group (art-group-get-by-name *level* (-> gp-3 skel-name) (the-as (pointer level) #f))) + ) + (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> s5-2 duration) (seconds 4)) + (set! (-> s5-2 gravity) -327680.0) + (set! (-> s5-2 rot-speed) 10.2) + (set-vector! (-> s5-2 fountain-rand-transv-lo) -81920.0 61440.0 -81920.0 1.0) + (set-vector! (-> s5-2 fountain-rand-transv-hi) 81920.0 131072.0 81920.0 1.0) + (let ((v1-51 + (process-spawn joint-exploder (-> gp-3 skel) (-> gp-3 anim) s5-2 gp-3 :name "joint-exploder" :to self :unk 0) + ) + ) + (when v1-51 + (let ((v1-54 (-> (the-as joint-exploder (-> v1-51 0)) draw))) + (if v1-54 + (.svf (&-> (-> v1-54 color-mult) quad) vf0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +(defstate player-control (h-sled) + :virtual #t + :enter (behavior () + (set! (-> self health-hud) (process->handle (hud-sled-health-spawn self))) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + (send-event (handle->process (-> self health-hud)) 'hide-and-die) + (set! (-> self health-hud) (the-as handle #f)) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod vehicle-method-78 ((this h-sled)) + (local-vars (a0-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'h-sled-stack-var1))) + (let* ((v1-0 (-> s5-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-0 rvec quad) a0-3) + (set! (-> v1-0 uvec quad) a1-0) + (set! (-> v1-0 fvec quad) a2-0) + (set! (-> v1-0 trans quad) a3-1) + ) + (let ((s4-0 (new 'static 'inline-array vector 8 + (new 'static 'vector :x 6144.0 :y 4096.0 :z -20480.0 :w 1.0) + (new 'static 'vector :x -6144.0 :y 4096.0 :z -20480.0 :w 1.0) + (new 'static 'vector :x 1638.4 :y 4096.0 :z -17203.2 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -17203.2 :w 1.0) + (new 'static 'vector :x 7782.4 :y 7782.4 :z -12288.0 :w 1.0) + (new 'static 'vector :x -7782.4 :y 7782.4 :z -12288.0 :w 1.0) + (new 'static 'vector :x 11059.2 :y 5734.4 :z -1638.4 :w 1.0) + (new 'static 'vector :x -11059.2 :y 5734.4 :z -1638.4 :w 1.0) + ) + ) + ) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (dotimes (s3-0 8) + (quad-copy! + (the-as pointer (-> s5-0 glow)) + (the-as pointer (-> this info particle-common headlight-glow-template)) + 4 + ) + (vector-matrix*! (-> s5-0 vec0) (-> s4-0 s3-0) (-> s5-0 mat)) + (let* ((v1-7 (-> s5-0 glow)) + (a1-3 (-> s5-0 vec0)) + (f0-0 (-> v1-7 position w)) + ) + (set! (-> v1-7 position quad) (-> a1-3 quad)) + (set! (-> v1-7 position w) f0-0) + ) + 0 + (set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> s5-0 glow color x) 0.0) + (set! (-> s5-0 glow color y) 0.0) + (set! (-> s5-0 glow color z) 255.0) + (set! (-> s5-0 glow color w) (* 2.0 (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + ) + ) + ) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (dotimes (s4-1 4) + (let ((v1-21 (-> this ground-pos-array s4-1)) + (f0-8 0.0) + ) + (.lvf vf1 (&-> v1-21 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 a0-13 vf1) + (when (< f0-8 a0-13) + (set! (-> s5-0 mat trans quad) (-> v1-21 quad)) + (spawn-from-mat (-> this parts s4-1) (-> s5-0 mat)) + ) + ) + ) + ) + ) + (none) + ) + ) diff --git a/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc b/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc index 20747059ab..1e31e0907a 100644 --- a/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc +++ b/goal_src/jak3/levels/comb/pecker/pecker-ingame.gc @@ -7,3 +7,121 @@ ;; DECOMP BEGINS +(deftype pecker-ingame (process-drawable) + ((path-u float) + ) + (:state-methods + idle + active + die + ) + ) + + +(defskelgroup skel-pecker-ingame pecker-ingame pecker-ingame-lod0-jg pecker-ingame-fly-ja + ((pecker-ingame-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow pecker-ingame-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +(defbehavior pecker-ingame-handler pecker-ingame ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die) + (go-virtual die) + ) + ) + ) + +(defstate idle (pecker-ingame) + :virtual #t + :event pecker-ingame-handler + :trans (behavior () + (let ((v1-1 (res-lump-value (-> self entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (cond + ((zero? v1-1) + (if (task-node-closed? (game-task-node comb-travel-introduction)) + (go-virtual active) + ) + ) + ((= (the-as uint v1-1) 1) + (if (task-node-closed? (game-task-node comb-travel-resolution)) + (go-virtual active) + ) + ) + (else + (go-virtual active) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate active (pecker-ingame) + :virtual #t + :event pecker-ingame-handler + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek! max 0.78) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.78)) + ) + ) + #f + ) + :post (behavior () + (let* ((f0-0 (path-control-method-23 (-> self path) (target-pos 0))) + (f0-3 (lerp-scale 0.01 0.1 (fmax 0.0 (- (-> self path-u) f0-0)) 0.1 0.0)) + ) + (seek! (-> self path-u) 1.0 (* f0-3 (seconds-per-frame))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (displacement-between-points-at-percent-normalized! (-> self path) gp-1 (-> self path-u)) + (forward-up-nopitch->quaternion (-> self root quat) gp-1 *y-vector*) + ) + (debug-draw (-> self path)) + (ja-post) + ) + ) + +(defstate die (pecker-ingame) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +(defmethod init-from-entity! ((this pecker-ingame) (arg0 entity-actor)) + (let ((v1-1 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (cond + ((zero? v1-1) + (when (task-node-closed? (game-task-node comb-travel-resolution)) + (cleanup-for-death this) + (deactivate this) + ) + ) + ((= (the-as uint v1-1) 1) + (when (task-node-closed? (game-task-node mine-explore-introduction)) + (cleanup-for-death this) + (deactivate this) + ) + ) + ) + ) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-pecker-ingame" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 30)) + (logior! (-> this skel status) (joint-control-status eye-anim)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this path-u) 0.0) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/comb/railx-mood.gc b/goal_src/jak3/levels/comb/railx-mood.gc index 96ed7e08fb..baea16b406 100644 --- a/goal_src/jak3/levels/comb/railx-mood.gc +++ b/goal_src/jak3/levels/comb/railx-mood.gc @@ -7,3 +7,149 @@ ;; DECOMP BEGINS +(deftype railx-states (structure) + ((pulses pulse-state 6 :inline) + (blue pulse-state :inline :overlay-at (-> pulses 0)) + (yellow pulse-state :inline :overlay-at (-> pulses 1)) + (warp pulse-state :inline :overlay-at (-> pulses 2)) + (spill pulse-state :inline :overlay-at (-> pulses 3)) + (egg pulse-state :inline :overlay-at (-> pulses 4)) + (transform pulse-state :inline :overlay-at (-> pulses 5)) + (flicker float) + ) + ) + + +;; WARN: Return type mismatch vector vs float. +(defun init-mood-railx ((arg0 mood-context)) + (-> arg0 state) + (set-vector! (-> arg0 times 1) 0.0 0.5 1.0 1.0) + (let ((v0-0 (-> arg0 times 2))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 0.5) + (set! (-> v0-0 w) 1.0) + (the-as float v0-0) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun update-railx-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 0.0) + (set! (-> v1-0 fog-color y) 0.0) + (set! (-> v1-0 fog-color z) 0.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (set! (-> arg0 current-fog fog-dists x) 819200.0) + (set! (-> arg0 current-fog fog-dists y) 1392640.0) + (set! (-> arg0 current-fog fog-dists w) 128.0) + (set! (-> arg0 current-fog fog-dists z) 255.0) + (let ((s1-0 (-> arg0 light-group)) + (gp-0 (-> arg0 light-group 1)) + ) + (let ((s4-0 (new 'static 'vector :z 1.0)) + (s2-0 (new 'static 'vector :x 1.0 :y 1.0)) + (s3-0 (the-as object (-> arg0 state))) + (s5-0 (-> *math-camera* inv-camera-rot)) + ) + (vector-float*! + (the-as vector (-> s1-0 0 ambi color)) + s4-0 + (fmax 0.333 (-> (the-as railx-states s3-0) blue brightness)) + ) + (vector+float*! + (the-as vector (-> s1-0 0 ambi color)) + (the-as vector (-> s1-0 0 ambi color)) + s2-0 + (fmax 0.333 (-> (the-as railx-states s3-0) yellow brightness)) + ) + (set! (-> s1-0 0 dir0 color quad) (-> s1-0 0 ambi color quad)) + (set! (-> s1-0 0 dir1 color quad) (-> s1-0 0 ambi color quad)) + (let ((a1-3 (new 'static 'vector :x 0.834 :y 0.4815 :z 0.2691)) + (s0-0 (new 'static 'vector :x -0.8451 :y -0.2182 :z -0.488)) + ) + (vector-matrix*! (the-as vector (-> s1-0 0)) a1-3 s5-0) + (vector-matrix*! (the-as vector (-> s1-0 0 dir1)) s0-0 s5-0) + ) + (set! (-> s1-0 0 ambi extra x) 0.2) + (set! (-> s1-0 0 dir0 extra x) 0.8) + (set! (-> s1-0 0 dir1 extra x) 0.8) + (set! (-> s1-0 0 dir2 extra x) 0.0) + (vector-float*! (the-as vector (-> gp-0 ambi color)) s4-0 (-> (the-as railx-states s3-0) blue brightness)) + (vector+float*! + (the-as vector (-> gp-0 ambi color)) + (the-as vector (-> gp-0 ambi color)) + s2-0 + (* 0.5 (-> (the-as railx-states s3-0) yellow brightness)) + ) + (vector-float*! (the-as vector (-> gp-0 dir0 color)) s4-0 (-> (the-as railx-states s3-0) blue brightness)) + (set! (-> gp-0 dir1 color quad) (-> gp-0 ambi color quad)) + (let ((a1-6 (new 'static 'vector :x 0.44725248 :y 0.77455187 :z 0.44725248)) + (s4-1 (new 'static 'vector :x -0.44725248 :y -0.77455187 :z -0.44725248)) + ) + (vector-matrix*! (the-as vector (-> gp-0 dir0)) a1-6 s5-0) + (vector-matrix*! (the-as vector (-> gp-0 dir1)) s4-1 s5-0) + ) + ) + (set! (-> gp-0 ambi extra x) 0.2) + (set! (-> gp-0 dir0 extra x) 0.5) + (set! (-> gp-0 dir1 extra x) 0.4) + (set! (-> gp-0 dir2 extra x) 0.0) + ) + (none) + ) + +(defbehavior update-mood-railx time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-railx-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as object (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (update-mood-pulse arg0 1 0 0.0 1.0 0.0 0.0) + (update-mood-pulse arg0 2 16 0.0 1.0 0.0 0.0) + (update-mood-pulse arg0 3 32 0.875 0.125 (* 65536.0 (seconds-per-frame)) 0.0) + (update-mood-pulse arg0 4 48 0.0 1.0 0.0 0.0) + (set! (-> arg0 times 5 w) (if (< 36408.89 (-> (the-as railx-states gp-0) flicker)) + 0.475 + 0.55 + ) + ) + (update-mood-pulse arg0 6 64 0.0 1.0 0.0 0.0) + (update-mood-pulse arg0 7 80 0.0 1.0 0.0 0.0) + (when (not (paused?)) + (let ((f0-6 (+ (-> (the-as railx-states gp-0) flicker) (* 393216.0 (seconds-per-frame))))) + (set! (-> (the-as railx-states gp-0) flicker) (- f0-6 (* (the float (the int (/ f0-6 65536.0))) 65536.0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-railx-light-brightness! ((arg0 int) (arg1 float) (arg2 float)) + (let ((v1-1 (level-get *level* 'railx))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as railx-states v1-2) pulses arg0 target-brightness) arg1) + (set! (-> (the-as railx-states (+ (the-as uint v1-2) (* arg0 16))) blue speed) arg2) + ) + ) + ) + (let ((v1-5 (level-get *level* 'railcst))) + (when v1-5 + (let ((v1-6 (the-as object (-> v1-5 mood-context state)))) + (set! (-> (the-as railx-states v1-6) pulses arg0 target-brightness) arg1) + (set! (-> (the-as railx-states (+ (the-as uint v1-6) (* arg0 16))) blue speed) arg2) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/comb/railx-obs.gc b/goal_src/jak3/levels/comb/railx-obs.gc index db55373b30..d0cb46a2ad 100644 --- a/goal_src/jak3/levels/comb/railx-obs.gc +++ b/goal_src/jak3/levels/comb/railx-obs.gc @@ -7,3 +7,590 @@ ;; DECOMP BEGINS +(deftype rail-warp-gate (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-rail-warp-gate rail-warp-gate rail-warp-gate-lod0-jg rail-warp-gate-idle-ja + ((rail-warp-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 125) + ) + +(defstate idle (rail-warp-gate) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! rail-warp-gate-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this rail-warp-gate) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-rail-warp-gate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 11)) + (go (method-of-object this idle)) + ) + +(defpartgroup group-combx-big-yellow-glow + :id 1259 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4266 :flags (sp6)) (sp-item 4267 :flags (sp6))) + ) + +(defpart 4266 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +(defpart 4267 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +(defpartgroup group-combx-medium-yellow-glow + :id 1260 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4268 :flags (sp6)) (sp-item 4269 :flags (sp6))) + ) + +(defpart 4268 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +(defpart 4269 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 25) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +(defpartgroup group-combx-small-yellow-glow + :id 1261 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4270 :flags (sp6)) (sp-item 4271 :flags (sp6))) + ) + +(defpart 4270 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +(defpart 4271 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 18) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +(defpartgroup group-pedestal-blue-glow + :id 1262 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4272 :flags (sp6)) (sp-item 4273 :flags (sp6))) + ) + +(defpart 4272 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 5.0 1.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +(defpart 4273 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-yellowoval + :id 1263 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4274 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4274 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-blueoval + :id 1264 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4275 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4275 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 128.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-yellowled + :id 1265 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4276 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4276 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.6) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-blueled + :id 1266 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4277 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4277 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-yellowledglow + :id 1267 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4278 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4278 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-rimlight + :id 1268 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4279 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4279 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-orbblueglow + :id 1269 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4280 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4280 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-yellowstrip + :id 1270 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4281 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 4281 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-combx-bigscreen + :id 1271 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4282 :flags (is-3d sp7)) (sp-item 4283 :flags (is-3d sp7)) (sp-item 4284 :flags (sp7))) + ) + +(defpart 4282 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 0.5) + (:x (meters -4.5) (meters 8.5)) + (:y (meters -0.2)) + (:z (meters -1)) + (:scale-x (meters 0.3) (meters 0.5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 4.6)) + (:r 128.0) + (:g 40.0) + (:b 20.0) + (:a 0.0) + (:fade-a 0.32 0.32) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4285) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4285 + :init-specs ((:fade-a -0.128 -0.128)) + ) + +(defpart 4283 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 0.05) + (:x (meters -4.8)) + (:y (meters 1) 6 (meters -0.5)) + (:z (meters -1)) + (:scale-x (meters 1.2)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.35)) + (:r 200.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-x (meters 0.008)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4284 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 0.1) + (:x (meters -4.8)) + (:y (meters 1.5) 11 (meters -0.3)) + (:z (meters -1)) + (:scale-x (meters 0.3)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 32.0 64.0) + (:b 0.0) + (:a 64.0) + (:vel-x (meters 0.004)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-combx-mediumscreen + :id 1272 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4286 :flags (is-3d sp7)) (sp-item 4287 :flags (is-3d sp7))) + ) + +(defpart 4286 + :init-specs ((:texture (laser-hit level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.8) 2 (meters 1.2)) + (:rot-x (degrees 0) 3 (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:rotvel-y (degrees -0.16666667) 1 (degrees 0.33333334)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 4287 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 0.015) + (:y (meters 1.5)) + (:scale-x (meters 0.3) (meters 0.5)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 3.4)) + (:r 0.0) + (:g 50.0) + (:b 128.0) + (:a 32.0) + (:vel-y (meters -0.01)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-combx-smallscreen + :id 1273 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4288 :flags (is-3d sp7))) + ) + +(defpart 4288 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:num 0.1) + (:scale-x (meters 1.2)) + (:rot-x (degrees 0) 3 (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0 64.0) + (:b 0.0 2.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:rotvel-y (degrees -1) (degrees 2)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpartgroup group-combx-capsulescreen + :id 1274 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4289 :flags (is-3d sp6 sp7))) + ) + +(defpart 4289 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'spt-birth-func-capsulescreen) + (:num 20.0) + (:x (meters 0.1)) + (:y (meters -0.2) (meters 0.4)) + (:z (meters -0.7) (meters 1.4)) + (:scale-x (meters 1)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters -2) 1 (meters 4)) + (:r 30.0) + (:g 64.0 64.0) + (:b 128.0) + (:a 8.0 100.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x404a00 #x40b000 #x40b100)) + (:rotate-y (degrees 90)) + ) + ) + +(defun spt-birth-func-capsulescreen ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 object) (arg3 object) (arg4 object)) + (birth-func-texture-group (the-as int arg0) arg1 (the-as sparticle-launchinfo arg2)) + (birth-func-flip-based-on-scale + arg0 + arg1 + (the-as sprite-vec-data-3d arg2) + (the-as sparticle-launcher arg3) + (the-as sparticle-launch-state arg4) + ) + (none) + ) diff --git a/goal_src/jak3/levels/comb/railx-scenes.gc b/goal_src/jak3/levels/comb/railx-scenes.gc index 8d1c442bc6..e3a02b2d46 100644 --- a/goal_src/jak3/levels/comb/railx-scenes.gc +++ b/goal_src/jak3/levels/comb/railx-scenes.gc @@ -7,3 +7,2203 @@ ;; DECOMP BEGINS +(defskelgroup skel-fma-gun fma-gun fma-gun-lod0-jg fma-gun-idle-ja + ((fma-gun-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +(defskelgroup skel-rail-oracle-door-fma rail-oracle-door rail-oracle-door-lod0-jg rail-oracle-door-idle-ja + ((rail-oracle-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :origin-joint-index 3 + ) + +(defskelgroup skel-rail-warp-gate-fma rail-warp-gate rail-warp-gate-lod0-jg rail-warp-gate-idle-ja + ((rail-warp-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 145) + :origin-joint-index 3 + ) + +(defskelgroup skel-eco-crystal-sphere-fma eco-crystal-sphere eco-crystal-sphere-lod0-jg eco-crystal-sphere-idle-ja + ((eco-crystal-sphere-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :origin-joint-index 3 + ) + +(defskelgroup skel-rail-gun-light-fma rail-gun-light 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 70) + :origin-joint-index 3 + ) + +(defskelgroup skel-rail-gun-dark-fma rail-gun-dark rail-gun-dark-lod0-jg rail-gun-dark-idle-ja + ((rail-gun-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + :origin-joint-index 3 + ) + +(defskelgroup skel-rail-oracle-eyes-fma rail-oracle-eyes rail-oracle-eyes-lod0-jg rail-oracle-eyes-idle-ja + ((rail-oracle-eyes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + :origin-joint-index 3 + ) + +(defskelgroup skel-plat-fma plat-fma plat-fma-lod0-jg plat-fma-idle-ja + ((plat-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-precursor-controller precursor-controller precursor-controller-lod0-jg precursor-controller-idle-ja + ((precursor-controller-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-pre-mike pre-mike pre-mike-lod0-jg pre-mike-idle-ja + ((pre-mike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defpartgroup group-fma-railx-precursor-entrance-flash + :id 1275 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4290 :flags (sp3)) (sp-item 4291 :flags (sp3))) + ) + +(defpart 4290 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow left-multiply-quat)) + (:userdata 4096.0) + (:next-time (seconds 0.335)) + (:next-launcher 4292) + ) + ) + +(defpart 4292 + :init-specs ((:scalevel-x (meters -0.06666667)) (:scalevel-y :copy scalevel-x) (:fade-a -1.28)) + ) + +(defpart 4291 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 4293) + ) + ) + +(defpart 4293 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.85333335)) + ) + +(define railx-death-precursor + (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x10c6) + ) + +(defun start-railx-precursor-effect ((arg0 process-drawable)) + (let ((v1-0 (-> arg0 draw)) + (a1-0 railx-death-precursor) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-0 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-0 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-0 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-0 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior scene-player + () + (set! (-> self draw death-timer) (the-as uint 200)) + (set! (-> self draw death-vertex-skip) (the-as uint (the int (rand-vu-float-range 8.0 24.0)))) + (none) + ) + ) + 0 + (none) + ) + +(defpart 4294 + :init-specs ((:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 196.0) + (:b 255.0) + (:a 64.0) + (:accel-y (meters 0) (meters 0.00066666666)) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-texture-glow-soft) + (:next-time (seconds 0.035)) + (:next-launcher 4295) + ) + ) + +(defpart 4295 + :init-specs ((:r 64.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.0008)) + (:scalevel-y (meters 0) (meters 0.0026666666)) + ) + ) + +(defpartgroup group-railx-precursor-entity + :id 1276 + :duration (seconds 0.017) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4296 :flags (sp6))) + ) + +(defpart 4296 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 8.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + ) + ) + +(load-scene + (new 'static 'scene + :name "catacombs-wild-ride-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-194" + :art-group "scenecamera" + :anim "catacombs-wild-ride-res" + :parts #x73 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 18)) + (kill "rail-warp-gate-2") + (kill "rail-oracle-door-2") + (kill "rail-oracle-eyes-2") + (kill "rail-gun-dark-2") + (kill "rail-gun-dark-3") + (apply + ,(lambda :behavior scene-player + () + (set-railx-light-brightness! 0 0.0 100000.0) + (set-railx-light-brightness! 1 0.0 100000.0) + (set-railx-light-brightness! 2 0.0 100000.0) + (set-railx-light-brightness! 3 0.0 100000.0) + (set-railx-light-brightness! 4 0.0 100000.0) + (set-railx-light-brightness! 5 0.0 100000.0) + (none) + ) + ) + ) + (1 + (part-tracker + "group-fma-hover-vehicle-exhaust-glow" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1 578) + ) + (part-tracker + "group-fma-hover-vehicle-exhaust-glow" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 1 578) + ) + ) + (141 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 0 1.0 0.2521) (none)))) + (261 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 1 1.0 0.43478) (none)))) + (155 (want-load 'railx 'precura 'railcst)) + (156 (hide-cloth "jakc-highres")) + (281 (show-cloth "jakc-highres")) + (466 + (part-tracker + "group-railx-oracle-eye-open" + entity + "rail-oracle-eyes-fma" + joint + "rightlowerlid" + track + #t + duration + (frame-range 466 467) + ) + (part-tracker + "group-railx-oracle-eye-open" + entity + "rail-oracle-eyes-fma" + joint + "leftlowerlid" + track + #t + duration + (frame-range 466 467) + ) + ) + (478 + (part-tracker + "group-railx-oracle-eye-glow" + entity + "rail-oracle-eyes-fma" + joint + "rightlowerlid" + track + #t + duration + (frame-range 478 6770) + ) + (part-tracker + "group-railx-oracle-eye-glow" + entity + "rail-oracle-eyes-fma" + joint + "leftlowerlid" + track + #t + duration + (frame-range 478 6770) + ) + ) + (536 + (part-tracker + "group-railcst-dust-landing" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 536 590) + ) + ) + (740 + (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 4 2.0 1.0) (none))) + (part-tracker + "group-railx-eco-sphere-glow-ramp-up" + entity + "eco-crystal-sphere-fma" + joint + "main" + track + #t + duration + (frame-range 740 800) + ) + ) + (800 + (part-tracker + "group-railx-eco-sphere-glow" + entity + "eco-crystal-sphere-fma" + joint + "main" + track + #t + duration + (frame-range 800 6770) + ) + ) + (865 + (part-tracker + "group-dark-eco-cannon-charge" + entity + "particleman" + joint + "particleZ" + track + #t + duration + (frame-range 865 6770) + ) + ) + (870 + (part-tracker + "group-light-eco-cannon-charge" + entity + "particleman" + joint + "particleY" + track + #t + duration + (frame-range 870 6770) + ) + ) + (1081 + (joint-eval start-railx-precursor-effect entity "precursor") + (send-event + "precursor" + 'eval + ,(lambda :behavior scene-player + () + (let* ((v1-3 (-> self draw lod-set lod (-> self draw cur-lod) geo length)) + (gp-0 3) + (s5-0 (+ v1-3 1)) + ) + (while (>= s5-0 gp-0) + (when (not (or (and (>= gp-0 13) (>= 21 gp-0)) (and (>= gp-0 26) (>= 34 gp-0)))) + (if (logtest? (-> *part-group-id-table* 1276 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1276) + :duration (seconds 56.867) + :target self + :mat-joint gp-0 + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1276) + :duration (seconds 56.867) + :target self + :mat-joint gp-0 + ) + ) + ) + (+! gp-0 1) + ) + ) + (none) + ) + ) + ) + (1328 + (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 5 2.0 1.0) (none))) + (part-tracker + "group-railx-rod-of-god" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 1328 1870) + ) + ) + (1812 + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "main" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "chest" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "neck" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "head" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Lshoulder" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Rshoulder" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Lelbow" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Relbow" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "hips" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Lcollar" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Rcollar" + track + #t + duration + (frame-range 1812 2000) + ) + ) + (2000 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 5 0.0 1.0) (none)))) + (2932 + (part-tracker + "group-railx-room-light" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 2932 3165) + ) + ) + (2938 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 3 2.0 0.8108) (none)))) + (3100 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 3 0.0 0.5) (none)))) + (3151 + (part-tracker + "group-leader-staff-shot-glow" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 3151 6770) + ) + ) + (4736 + (part-tracker + "group-railx-shoot-at-veger" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 4736 4738) + ) + ) + (4745 + (part-tracker + "group-railx-veger-bubble" + entity + "veger-highres" + joint + "main" + track + #t + duration + (frame-range 4745 5848) + ) + ) + (5849 + (part-tracker + "group-railx-veger-bubble" + entity + "veger-highres" + joint + "main" + track + #f + duration + (frame-range 5849 5890) + ) + ) + (5830 + (part-tracker + "group-railx-veger-transform" + entity + "veger-highres" + joint + "main" + track + #t + duration + (frame-range 5830 5900) + ) + ) + (5860 + (part-tracker + "group-veger-to-otsel-zap" + entity + "veger-highres" + joint + "main" + track + #f + duration + (frame-range 5860 5890) + ) + ) + (5891 + (part-tracker + "group-railx-ottsel-bubble" + entity + "ottsel-veger" + joint + "main" + track + #t + duration + (frame-range 5891 6770) + ) + ) + (6241 + (part-tracker + "group-railx-warpgate" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 6241 6770) + ) + ) + (6250 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 2 1.0 1.0) (none)))) + (10000 (task-close! "comb-wild-ride-resolution") (task-close! "precursor-destroy-ship-introduction")) + ) + :cut-list '(76 + 166 + 281 + 401 + 461 + 546 + 621 + 701 + 761 + 836 + 896 + 966 + 1081 + 1231 + 1316 + 1411 + 1583 + 1661 + 1731 + 1801 + 1861 + 1919 + 1961 + 2006 + 2071 + 2161 + 2233 + 2371 + 2506 + 2651 + 2711 + 2776 + 2861 + 2961 + 3016 + 3081 + 3151 + 3221 + 3381 + 3491 + 3591 + 3701 + 3761 + 3841 + 3985 + 4036 + 4156 + 4226 + 4306 + 4396 + 4466 + 4611 + 4656 + 4701 + 4781 + 4861 + 5011 + 5116 + 5191 + 5261 + 5401 + 5441 + 5591 + 5656 + 5731 + 5826 + 5931 + 6036 + 6111 + 6316 + 6381 + 6606 + 6650 + 6755 + 6802 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'railcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'railcst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '(76 165 166 167 281 621 1081 1643 2157 2161 2307 4988 6298 6590) + :cloth-commands '((2161 reset)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "veger-highres" + :level 'railcst + :art-group "skel-veger-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((965 1081) (1550 5866)) + :shadow-frames '((min max)) + :cloth-reset-frames '(970 1544 1661 1781 1914 2060 4701 (5866 max)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'railcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-leader" + :level 'railcst + :art-group "skel-ottsel-leader" + :prefix "" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(3753 4010 4215 4400 4642 4743 5090 5565 6390) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-surfer" + :level 'railcst + :art-group "skel-ottsel-surfer" + :prefix "" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-veger" + :level 'railcst + :art-group "skel-ottsel-veger" + :prefix "" + :draw-frames '((5866 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-dummy" + :level 'railcst + :art-group "skel-ottsel-dummy" + :prefix "" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor" + :level 'railcst + :art-group "skel-precursor" + :prefix "" + :draw-frames '((1080 2915)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "comb-rail-rider-fma" + :level 'railcst + :art-group "skel-comb-rail-rider-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fma-gun" + :level 'railcst + :art-group "skel-fma-gun" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-oracle-door-fma" + :level 'railx + :art-group "skel-rail-oracle-door-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-warp-gate-fma" + :level 'railx + :art-group "skel-rail-warp-gate-fma" + :prefix "" + :draw-frames '((min 701) + (895 966) + (1410 1583) + (1660 1731) + (1800 1861) + (2070 2233) + (2370 2651) + (2710 2776) + (2960 3016) + (3080 3151) + (3380 3491) + (3590 3701) + (4155 4226) + (4305 4396) + (4610 4656) + (4700 4781) + (5010 5116) + (5260 5401) + (5440 5591) + (5655 5931) + (6110 6316) + (6605 6755) + ) + :scissor-frames '((min 483)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xb + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-gun-dark-fma" + :level 'railx + :art-group "skel-rail-gun-dark-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-gun-dark-fma" + :level 'railx + :art-group "skel-rail-gun-dark-fma" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "eco-crystal-sphere-fma" + :level 'railcst + :art-group "skel-eco-crystal-sphere-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-oracle-eyes-fma" + :level 'railx + :art-group "skel-rail-oracle-eyes-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pre-mike" + :level 'railcst + :art-group "skel-pre-mike" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-controller" + :level 'railcst + :art-group "skel-precursor-controller" + :prefix "" + :draw-frames '((3150 3985)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-controller" + :level 'railcst + :art-group "skel-precursor-controller" + :prefix "b-" + :draw-frames '((3150 3985)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "plat-fma" + :level 'railcst + :art-group "skel-plat-fma" + :prefix "a-" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "plat-fma" + :level 'railcst + :art-group "skel-plat-fma" + :prefix "b-" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "plat-fma" + :level 'railcst + :art-group "skel-plat-fma" + :prefix "c-" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "railx-start" + :end-point "precura-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "launch-amb-mov2") + :on-complete #f + ) + ) + +(defpartgroup group-leader-staff-shot-glow + :id 1277 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4297)) + ) + +(defpart 4297 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0.6) (meters 0.3)) + (:rot-x (degrees 45)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:fade-a 0.6) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.167)) + (:next-launcher 4298) + ) + ) + +(defpart 4298 + :init-specs ((:fade-a -0.6)) + ) + +(defpartgroup group-fma-hover-vehicle-exhaust-glow + :id 1278 + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4299 :flags (sp6))) + ) + +(defpart 4299 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 80.0 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-railcst-dust-landing + :id 1279 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4300 :flags (sp7))) + ) + +(defpart 4300 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 3)) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0 60.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28) + (:accel-y (meters 0) (meters 0.00016666666)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.167)) + (:next-launcher 4301) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4301 + :init-specs ((:fade-a -0.256 -0.256)) + ) + +(defpartgroup group-railx-oracle-eye-open + :id 1280 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4302 :flags (sp3 sp7))) + ) + +(defpart 4302 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.1)) + (:rot-x (degrees 225)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 120.0) + (:b 120.0) + (:a 40.0) + (:scalevel-x (meters 0.033333335)) + (:fade-g -0.26666668) + (:fade-b -0.26666668) + (:timer (seconds 1.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:next-time (seconds 0.3)) + (:next-launcher 4303) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4303 + :init-specs ((:scale-x (meters 6)) + (:scale-y (meters 40)) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + ) + ) + +(defpartgroup group-railx-oracle-eye-glow + :id 1281 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4304 :flags (sp6 sp7))) + ) + +(defpart 4304 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 15) (meters 0.1)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 20.0) + (:b 20.0) + (:a 50.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4305 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0.2)) + (:y (meters 0)) + (:z (meters 3)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (: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 4306) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -40)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4306 + :init-specs ((:fade-a -1.28)) + ) + +(defpartgroup group-railx-eco-sphere-glow-ramp-up + :id 1282 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4307 :flags (sp3 sp7))) + ) + +(defpart 4307 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.033333335) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:func 'spt-func-relative-pos) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-railx-eco-sphere-glow + :id 1283 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4308 :flags (sp6 sp7))) + ) + +(defpart 4308 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-light-eco-cannon-charge + :id 1284 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4309 :flags (sp7)) + (sp-item 4310 :flags (sp7)) + (sp-item 4311 :flags (sp6)) + (sp-item 4312 :flags (sp6)) + ) + ) + +(defpart 4309 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters 10)) + (:scale-x (meters 25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 60.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g 0.4) + (:fade-a 0.07111111) + (:accel-x (meters -0.0013333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defpart 4310 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 25) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 80.0 80.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.06666667) (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 4313) + ) + ) + +(defpart 4313 + :init-specs ((:fade-a 0.0)) + ) + +(defpart 4311 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 40.0) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4312 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 80.0) + (:b 255.0) + (:a 5.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpartgroup group-dark-eco-cannon-charge + :id 1285 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4314 :flags (sp6)) (sp-item 4315 :flags (sp6)) (sp-item 4316) (sp-item 4317)) + ) + +(defpart 4314 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 40.0) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4315 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 64.0 20.0) + (:g 64.0) + (:b 255.0) + (:a 60.0 10.0) + (:omega (degrees 13511.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4316 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 20.0) + (:scale-x (meters 1) (meters 3)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 5) (meters 2.5)) + (:r 50.0 100.0) + (:g 60.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.035)) + (:next-launcher 4318) + ) + ) + +(defpart 4317 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 5.0) + (:scale-x (meters 5) (meters 5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 5) (meters 2.5)) + (:r 50.0 100.0) + (:g 60.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:next-time (seconds 0.035)) + (:next-launcher 4318) + ) + ) + +(defpart 4318 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -2.0) (:fade-g -0.8) (:fade-a -4.0)) + ) + +(defpartgroup group-railx-rod-of-god + :id 1286 + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4319 :flags (is-3d)) + (sp-item 4320 :flags (is-3d)) + (sp-item 4321 :flags (is-3d)) + (sp-item 4322 :flags (is-3d)) + (sp-item 4323) + ) + ) + +(defpart 4319 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4324 + :init-specs ((:fade-a -1.28)) + ) + +(defpart 4320 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4321 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4322 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4323 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 30)) + (: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 4325) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4325 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpartgroup group-railx-veger-glow + :id 1287 + :flags (sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4326 :flags (sp3))) + ) + +(defpart 4326 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 60.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:fade-a 0.10666667) + (:timer (seconds 6.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + (:func 'spt-func-relative-pos) + (:next-time (seconds 1)) + (:next-launcher 4327) + ) + ) + +(defpart 4327 + :init-specs ((:fade-a -0.013333334) (:next-time (seconds 4)) (:next-launcher 4328)) + ) + +(defpart 4328 + :init-specs ((:fade-a -0.08)) + ) + +(defpartgroup group-railx-room-light + :id 1288 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4329 :period (seconds 1) :length (seconds 0.017)) + (sp-item 4330 :flags (is-3d)) + (sp-item 4331 :flags (is-3d)) + (sp-item 4332 :flags (is-3d)) + (sp-item 4333 :flags (is-3d)) + ) + ) + +(defpart 4329 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4330 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 18) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4334) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4334 + :init-specs ((:fade-a -2.56)) + ) + +(defpart 4331 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 16) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 30)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4334) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4332 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 18) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -30)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4334) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +(defpart 4333 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 7) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +(defpartgroup group-railx-shoot-at-veger + :id 1289 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4335 :flags (sp7)) (sp-item 4336 :flags (sp7))) + ) + +(defpart 4335 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.4) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0) + (:b 30.0) + (:a 128.0) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4336 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 30.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.013333334)) + (:scalevel-x (meters -0.00066666666)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.033333335 -0.033333335) + (:fade-a -0.42666668) + (:accel-y (meters -0.001)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-railx-veger-bubble + :id 1290 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4337)) + ) + +(defpart 4337 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 0.3) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 5.12) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 4338) + ) + ) + +(defpart 4338 + :init-specs ((:fade-a -5.12)) + ) + +(defpartgroup group-railx-ottsel-bubble + :id 1291 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4339)) + ) + +(defpart 4339 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 0.3) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 5.12) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 4340) + ) + ) + +(defpart 4340 + :init-specs ((:fade-a -5.12)) + ) + +(defpartgroup group-railx-veger-transform + :id 1292 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4343 :fade-after (meters 100) :period (seconds 0.167) :length (seconds 0.017) :binding 4341) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + ) + ) + +(defpart 4343 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 4341 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0 30.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0) (degrees 3600)) + (:vel-x (meters 0.059259262) (meters 0.0074074077)) + (:vel-y (meters 0)) + (:vel-z (meters 0.0016666667)) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +(defpart 4344 + :init-specs ((:fade-a -0.21333334)) + ) + +(defpart 4342 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-railx-warpgate + :id 1293 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 50) + :parts ((sp-item 4345 :flags (sp7)) + (sp-item 4346 :flags (sp7)) + (sp-item 4347 :flags (sp6)) + (sp-item 4348 :flags (sp7)) + ) + ) + +(defpart 4345 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 50)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 5.12) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 4349) + ) + ) + +(defpart 4349 + :init-specs ((:fade-a -5.12)) + ) + +(defpart 4346 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 0.01) + (:scale-x (meters 50)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 2.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 4350) + ) + ) + +(defpart 4350 + :init-specs ((:fade-a -0.42666668)) + ) + +(defpart 4347 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 0.0) + (:b 255.0) + (:a 100.0 4.0) + (:fade-a -0.10666667) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4348 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 1800)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:fade-a -0.10666667) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-veger-to-otsel-zap + :id 1294 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4351 :flags (sp7))) + ) + +(defpart 4351 + :init-specs ((:texture (laser-hit level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5 0.5) + (:scale-x (meters 0.01)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -10.2) + (:fade-b -10.2) + (:fade-a -1.7) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405400 #x406400 #x40b900 #x404b00)) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/common/ai/ai-task-h.gc b/goal_src/jak3/levels/common/ai/ai-task-h.gc index edbd085e61..00d8799603 100644 --- a/goal_src/jak3/levels/common/ai/ai-task-h.gc +++ b/goal_src/jak3/levels/common/ai/ai-task-h.gc @@ -5,5 +5,245 @@ ;; name in dgo: ai-task-h ;; dgos: DESOASIS +(declare-type ai-task-pool basic) +(declare-type bot nav-enemy) + ;; DECOMP BEGINS +(deftype ai-task (basic) + ((next ai-task) + (prev ai-task) + (pool ai-task-pool) + (unique-id uint32) + (bytes int8 16 :offset 32) + ) + (:methods + (reset-task! (_type_) none) + (ai-task-method-10 (_type_ bot) none) + (ai-task-method-11 (_type_ bot) object) + ) + ) + + +(deftype ai-task-pool (basic) + ((anchor ai-task) + (tasks (pointer uint32)) + (tasks-length uint32) + (unique-id uint32) + ) + (:methods + (assign-ids! (_type_ type) ai-task) + (set-next-task! (_type_ ai-task) ai-task) + (ai-task-pool-method-11 (_type_) ai-task) + ) + ) + + +(deftype ai-task-control (basic) + ((anchor ai-task) + (pool ai-task-pool) + ) + (:methods + (new (symbol type ai-task-pool) _type_) + (ai-task-control-method-9 (_type_) symbol) + (ai-task-control-method-10 (_type_ bot) none) + (get-task-by-type (_type_ type bot) ai-task) + (ai-task-control-method-12 (_type_ bot) symbol) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task) + (ai-task-control-method-14 (_type_ ai-task bot) none) + (init-task! (_type_ type bot) ai-task) + (set-next-task-for-pool! (_type_ ai-task) none) + (set-next-task! (_type_ ai-task) ai-task) + ) + ) + + +;; WARN: Return type mismatch int vs object. +(defmethod ai-task-method-11 ((this ai-task) (arg0 bot)) + 0 + ) + +(defmethod ai-task-method-10 ((this ai-task) (arg0 bot)) + 0 + (none) + ) + +(defmethod reset-task! ((this ai-task)) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer uint32) vs ai-task. +(defmethod ai-task-pool-method-11 ((this ai-task-pool)) + (set! (-> this unique-id) (the-as uint 0)) + (let ((t0-0 (the-as (pointer uint32) #f)) + (a1-0 (the-as (pointer uint32) #f)) + (v1-0 (-> this tasks)) + ) + (let ((a2-0 (-> this tasks-length))) + (dotimes (a3-0 (the-as int a2-0)) + (set! a1-0 (&+ v1-0 (* 48 a3-0))) + (set! (-> a1-0 2) (the-as uint this)) + (set! (-> a1-0 3) (the-as uint 0)) + (set! (-> a1-0 1) (the-as uint t0-0)) + (if t0-0 + (set! (-> t0-0 0) (the-as uint a1-0)) + ) + (set! t0-0 a1-0) + ) + ) + (set! (-> a1-0 0) (the-as uint #f)) + (let ((v0-0 (&-> v1-0 0))) + (set! (-> this anchor) (the-as ai-task v0-0)) + (the-as ai-task v0-0) + ) + ) + ) + +(defmethod assign-ids! ((this ai-task-pool) (arg0 type)) + (let ((v1-1 (-> this anchor next))) + (when v1-1 + (let ((a2-0 (-> v1-1 prev)) + (a3-0 (-> v1-1 next)) + ) + (set! (-> v1-1 prev) #f) + (set! (-> v1-1 next) #f) + (let ((t0-1 (the-as int (+ (-> this unique-id) 1)))) + (if (zero? (the-as uint t0-1)) + (set! t0-1 1) + ) + (set! (-> this unique-id) (the-as uint t0-1)) + (set! (-> v1-1 unique-id) (the-as uint t0-1)) + ) + (set! (-> a2-0 next) a3-0) + (if a3-0 + (set! (-> a3-0 prev) a2-0) + ) + ) + (set! (-> v1-1 type) arg0) + v1-1 + ) + ) + ) + +(defmethod set-next-task! ((this ai-task-pool) (arg0 ai-task)) + (let* ((v1-0 (-> this anchor)) + (v0-0 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) v0-0) + v0-0 + ) + ) + +(defmethod new ai-task-control ((allocation symbol) (type-to-make type) (arg0 ai-task-pool)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 pool) arg0) + (set! (-> s5-0 anchor) (assign-ids! arg0 ai-task)) + s5-0 + ) + ) + +(defmethod ai-task-control-method-12 ((this ai-task-control) (arg0 bot)) + (let ((gp-0 (-> this anchor))) + (let ((s3-0 (-> this anchor next))) + (while s3-0 + (let ((s4-0 (-> s3-0 next))) + (if arg0 + (ai-task-method-10 s3-0 arg0) + ) + (set-next-task! (-> s3-0 pool) s3-0) + (set! s3-0 s4-0) + ) + ) + ) + (set! (-> gp-0 prev) #f) + (set! (-> gp-0 next) #f) + ) + #f + ) + +(defmethod ai-task-control-method-9 ((this ai-task-control)) + (ai-task-control-method-12 this (the-as bot #f)) + (let ((a1-1 (-> this anchor))) + (when a1-1 + (set-next-task! (-> a1-1 pool) a1-1) + (set! (-> this anchor) #f) + #f + ) + ) + ) + +(defmethod init-task! ((this ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (assign-ids! (-> this pool) arg0))) + (if s5-0 + (reset-task! s5-0) + ) + s5-0 + ) + ) + +(defmethod set-next-task! ((this ai-task-control) (arg0 ai-task)) + (let* ((v1-0 (-> this anchor)) + (a0-1 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) a0-1) + ) + arg0 + ) + +;; WARN: Return type mismatch ai-task vs none. +(defmethod set-next-task-for-pool! ((this ai-task-control) (arg0 ai-task)) + (set-next-task! (-> this pool) arg0) + (none) + ) + +(defmethod get-task-by-type ((this ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (init-task! this arg0 arg1))) + (if s5-0 + (set-next-task! this s5-0) + ) + s5-0 + ) + ) + +(defmethod ai-task-control-method-13 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((gp-0 (-> arg0 prev)) + (s5-0 (-> arg0 next)) + ) + (if arg1 + (ai-task-method-10 arg0 arg1) + ) + (set-next-task! (-> this pool) arg0) + (if gp-0 + (set! (-> gp-0 next) s5-0) + ) + (if s5-0 + (set! (-> s5-0 prev) gp-0) + ) + s5-0 + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-control-method-10 ((this ai-task-control) (arg0 bot)) + (let ((a0-1 (-> this anchor next))) + (if a0-1 + (ai-task-method-11 a0-1 arg0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-control-method-14 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((a0-1 (ai-task-control-method-13 this arg0 arg1))) + (if a0-1 + (ai-task-method-11 a0-1 arg1) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash-h.gc b/goal_src/jak3/levels/common/ai/ashelin/ash-h.gc index 750e7009d2..af64376eb8 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash-h.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash-h.gc @@ -7,3 +7,71 @@ ;; DECOMP BEGINS +(deftype ashelin-course (bot-course) + ((ouch-speeches bot-speech-list-shuffle) + (victory-speeches bot-speech-list-shuffle) + ) + ) + + +(deftype ashelin (bot) + ((self ashelin :override) + (course ashelin-course :override) + (knocked-anim art-joint-anim) + (travel-anim-interp float) + (fired-gun-count uint32) + (last-fire-time time-frame) + (victory-speech-time time-frame) + (frontline plane :inline) + ) + (:state-methods + back-spring + cartwheel-left + tumble-right + chase + traveling + traveling-blocked + waiting-idle + standing-idle + standing-turn + standing-blast + ) + (:methods + (ashelin-method-247 (_type_ symbol) symbol) + (ashelin-method-248 (_type_ vector float float float float) symbol) + (fire-shot (_type_ vector) (pointer process)) + (ashelin-method-250 (_type_ symbol symbol) symbol) + (go-dodge-state (_type_ int) object) + (ashelin-method-252 (_type_) int) + (ashelin-method-253 (_type_) int) + (ashelin-method-254 (_type_ float) none) + (ashelin-method-255 (_type_) none) + (ashelin-method-256 (_type_) none) + (ashelin-method-257 (_type_) int) + (ashelin-method-258 (_type_) symbol) + (ashelin-method-259 (_type_) none) + (ashelin-method-260 (_type_) int) + (ashelin-method-261 (_type_ symbol) penetrate) + ) + ) + + +(defskelgroup skel-ashelin ashelin ashelin-lod0-jg ashelin-idle0-ja + ((ashelin-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.7) + :shadow ashelin-shadow-mg + :origin-joint-index 13 + ) + +(deftype asht-wait-spot (ai-task) + ((check-done (function asht-wait-spot ashelin symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) + ) + ) + + +(deftype asht-fight-focus (ai-task) + () + ) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc b/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc index 2987300996..3cc844cc97 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash-shot.gc @@ -7,3 +7,455 @@ ;; DECOMP BEGINS +(defpart 900 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.75)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 901 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 902 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.28) + (:fade-b -1.28) + (:fade-a -0.48) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 903 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-ashelin-shot-hit + :id 222 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 904 :period (seconds 2) :length (seconds 0.017)) + (sp-item 905 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017)) + (sp-item 906 :period (seconds 2) :length (seconds 0.017)) + (sp-item 907 :fade-after (meters 50) :falloff-to (meters 50) :period (seconds 2) :length (seconds 0.667)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.667)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.5)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.417)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.335)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.25)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.217)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.167)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.135)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.085)) + ) + ) + +(defpart 907 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.2) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 32.0 64.0) + (:vel-y (meters 0.06666667) (meters 0.013333334)) + (:scalevel-x (meters -0.001) (meters -0.00033333333)) + (:rotvel-z (degrees -2.4) 1 (degrees 4.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 909) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 908 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 96.0) + (:vel-y (meters 0.006666667) (meters 0.013333334)) + (:scalevel-x (meters -0.0005) (meters -0.0005)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 909) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 909 + :init-specs ((:fade-a -0.96)) + ) + +(defpart 905 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 128.0) + (:rotvel-z (degrees -0.1)) + (:fade-a -0.32) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 910) + ) + ) + +(defpart 910 + :init-specs ((:scale-x (meters 2) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:next-time (seconds 0.017)) + (:next-launcher 910) + ) + ) + +(defpart 906 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 48.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.9142857) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.117)) + (:next-launcher 911) + ) + ) + +(defpart 911 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.010958904)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.38356164) + (:fade-b 0.0) + (:fade-a -0.13150685) + ) + ) + +(defpart 904 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.185)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.05)) + (:next-launcher 912) + ) + ) + +(defpart 912 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.0875)) + (:scalevel-y :copy scalevel-x) + (:fade-b -6.4) + ) + ) + +(deftype ashelin-shot (projectile) + ((parent (pointer ashelin) :override) + (tail-pos vector :inline) + (hit-pos vector :inline) + ) + ) + + +(defmethod projectile-method-24 ((this ashelin-shot)) + (draw-beam (-> *part-id-table* 903) (-> this tail-pos) (-> this starting-dir) #f) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this ashelin-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf6) + (let ((f30-0 (-> *part-id-table* 900 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 900 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1))) + (draw-beam (-> *part-id-table* 900) a1-0 s5-1 #f) + (set! (-> *part-id-table* 900 init-specs 4 initial-valuef) f30-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 901) gp-0) + (let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) fvec)))) + (when (< 0.0 f0-4) + (let ((f0-5 (* f0-4 f0-4)) + (f30-1 (-> *part-id-table* 902 init-specs 8 initial-valuef)) + (f28-0 (-> *part-id-table* 902 init-specs 8 random-rangef)) + ) + (set! (-> *part-id-table* 902 init-specs 8 initial-valuef) (* f30-1 f0-5)) + (set! (-> *part-id-table* 902 init-specs 8 random-rangef) (* f28-0 f0-5)) + (launch-particles (-> *part-id-table* 902) gp-0) + (set! (-> *part-id-table* 902 init-specs 8 initial-valuef) f30-1) + (set! (-> *part-id-table* 902 init-specs 8 random-rangef) f28-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this ashelin-shot)) + (cond + ((logtest? (-> *part-group-id-table* 222 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 222)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 222)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod play-impact-sound ((this ashelin-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "ashelin-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "ashelin-shot-hi") + ) + ((= v1-0 (projectile-options po0 po1)) + ((method-of-type projectile play-impact-sound) this arg0) + ) + ) + ) + (none) + ) + +(defmethod made-impact? ((this ashelin-shot)) + (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) (ppointer->process (-> this parent))) + (set! (-> a1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + ) + ) + +(defun ashelin-shot-move ((arg0 ashelin-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 40960.0 f0-0) + (vector-normalize! s4-0 40960.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-9) + (move-to-point! (-> arg0 root) a1-5) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod setup-collision! ((this ashelin-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (when (not (logtest? (-> (ppointer->process (-> this parent)) bot-flags) (bot-flag attacked))) + (let* ((a0-17 (-> this root)) + (v1-27 (-> a0-17 root-prim)) + ) + (countdown (a0-18 (-> a0-17 total-prims)) + (logclear! (-> v1-27 prim-core collide-with) (collide-spec jak)) + (&+! v1-27 80) + ) + ) + ) + (none) + ) + +(defmethod init-proj-settings! ((this ashelin-shot)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 307200.0) + (set! (-> this move) ashelin-shot-move) + (set! (-> this timeout) (seconds 1.335)) + (none) + ) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc b/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc index de1ae8b5c2..9610e43c76 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash-states.gc @@ -7,3 +7,1075 @@ ;; DECOMP BEGINS +(defstate waiting-idle (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (bot-method-235 self #f) + (when (not (focus-test? self grabbed)) + (cond + ((bot-method-226 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + 0 + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 ashelin-idle0-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 ashelin-standing-idle-ja)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + (ja-no-eval :group! ashelin-standing-to-waiting-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (let ((v1-55 (ja-group))) + (cond + ((and v1-55 (= v1-55 ashelin-standing-to-waiting-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! ashelin-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-simple-post + ) + +(defstate standing-idle (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flag bf21)) + ) + :trans (behavior () + (bot-method-235 self #t) + (cond + ((bot-method-226 self) + (cond + ((ashelin-method-250 self #t #t) + (when (and (ashelin-method-247 self #t) (let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 ashelin-standing-idle-ja)) + ) + ) + (cond + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ((ashelin-method-247 self #f) + (go-virtual standing-blast) + ) + (else + (let ((a1-4 (ashelin-method-253 self))) + (if (nonzero? a1-4) + (go-dodge-state self a1-4) + ) + ) + ) + ) + ) + (let ((a1-5 (ashelin-method-257 self))) + (cond + ((nonzero? a1-5) + (go-dodge-state self a1-5) + ) + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ) + ) + ) + (else + (let ((a1-6 (ashelin-method-257 self))) + (cond + ((nonzero? a1-6) + (go-dodge-state self a1-6) + ) + (else + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (ashelin-method-258 self)) + (go-virtual chase) + ) + ) + ) + ) + ) + ) + (when (logtest? (bot-flag bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flag bf21)) + (let ((a1-7 (ashelin-method-252 self))) + (if (nonzero? a1-7) + (go-dodge-state self a1-7) + ) + ) + ) + ) + (else + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) + (go-idle self) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 ashelin-standing-idle-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (or (= v1-16 ashelin-waiting-to-standing-ja) + (= v1-16 ashelin-standing-turn-left-ja) + (= v1-16 ashelin-standing-turn-right-ja) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + ((let ((v1-31 (ja-group))) + (and v1-31 (= v1-31 ashelin-idle0-ja)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ashelin-waiting-to-standing-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + (until #f + (ja-no-eval :group! ashelin-standing-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-simple-post + ) + +(defstate standing-turn (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flag bf21)) + ) + :trans (behavior () + (bot-method-235 self #f) + (when (bot-method-226 self) + (let ((a1-1 (ashelin-method-257 self))) + (if (nonzero? a1-1) + (go-dodge-state self a1-1) + ) + ) + (when (logtest? (bot-flag bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flag bf21)) + (let ((a1-2 (ashelin-method-252 self))) + (if (nonzero? a1-2) + (go-dodge-state self a1-2) + ) + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) + (let ((s5-0 (-> self focus-info fproc))) + (if (not s5-0) + (go-idle self) + ) + (bot-method-194 self gp-0 s5-0 0.335) + ) + (let ((s4-0 (-> self draw art-group data (if (>= (-> gp-0 predicted-ry-diff) 0.0) + 31 + 32 + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-1 (new 'stack-no-clear 'quaternion)) + (f0-1 (-> gp-0 predicted-ry-diff)) + (f30-0 0.0) + (f28-0 10.0) + ) + (quaternion-rotate-y! s5-1 (-> gp-0 src-quat) f0-1) + (ja-no-eval :group! s4-0 :num! (seek! max 2.0) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (ja-aframe-num 0))) + (cond + ((< f0-6 f28-0) + (if (>= f0-6 f30-0) + (quaternion-slerp! (-> self root quat) (-> gp-0 src-quat) s5-1 (/ (- f0-6 f30-0) (- f28-0 f30-0))) + ) + ) + (else + (quaternion-copy! (-> self root quat) s5-1) + ) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + ) + ) + (go-virtual standing-idle) + ) + :post nav-enemy-simple-post + ) + +(defstate traveling (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-176 self) + (set! (-> self player-blocking) 0.0) + ) + :trans (behavior () + (if (focus-test? self grabbed) + (go-virtual waiting-idle) + ) + (bot-method-235 self #f) + (cond + ((bot-method-226 self) + (go-hostile self) + ) + ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) + (go-idle self) + ) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-220 self)) + (go-virtual traveling-blocked) + ) + ((and (nav-enemy-method-174 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) + (go-stare2 self) + ) + ) + 0 + ) + :code (behavior () + (until #f + (ashelin-method-260 self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self spot)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 center quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate traveling-blocked (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (bot-method-235 self #f) + (cond + ((bot-method-226 self) + (go-hostile self) + ) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-220 self))) + (go-virtual traveling) + ) + ) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + :post nav-enemy-simple-post + ) + +(defstate stare (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (bot-method-235 self #f) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (bot-method-226 self) + (if (ashelin-method-250 self #t #f) + (go-virtual standing-idle) + ) + ) + (if (not (nav-enemy-method-174 self)) + (go-virtual traveling) + ) + ) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + ) + +(defstate standing-blast (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (not (handle->process (-> self focus handle))) + (go-best-state self) + ) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :code (behavior () + (bot-method-235 self #t) + (if (or (not (bot-method-226 self)) (not (ashelin-method-247 self #f))) + (go-best-state self) + ) + (let ((v1-12 (ja-group))) + (if (and v1-12 (or (= v1-12 ashelin-standing-idle-ja) (= v1-12 ashelin-standing-fire-ja))) + (ja-channel-push! 1 (seconds 0.03)) + (ja-channel-push! 1 (seconds 0.08)) + ) + ) + (let ((gp-0 #f)) + (ja-no-eval :group! ashelin-standing-fire-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (not gp-0) (>= (ja-aframe-num 0) 7.0)) + (set! gp-0 #t) + (fire-shot self (-> self focus-info bullseye)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (cond + ((logtest? (-> self bot-flags) (bot-flag attacked)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (bot-method-199 self) + ) + ((logtest? (-> self enemy-flags) (enemy-flag victory)) + (ashelin-method-256 self) + ) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +(defstate chase (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (nav-enemy-method-177 self) + ) + :trans (behavior () + (bot-method-235 self #t) + (cond + ((and (nav-enemy-method-174 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) + (go-stare2 self) + ) + ((not (bot-method-226 self)) + (go-virtual traveling) + ) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (or (ashelin-method-250 self #t #f) (ashelin-method-259 self)) + (go-virtual standing-idle) + ) + ) + (let ((gp-0 (-> self nav))) + (set! (-> gp-0 target-speed) (lerp-scale + (-> self enemy-info walk-travel-speed) + (-> self enemy-info run-travel-speed) + (-> self focus-info bullseye-xz-dist) + 81920.0 + 92160.0 + ) + ) + ) + 0 + ) + :code (behavior () + (until #f + (ashelin-method-260 self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-6 (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate back-spring (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-178 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self move-dest)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (ja-no-eval :group! ashelin-back-spring-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-slerp! (-> self root quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-30 *game-info*) + (a0-11 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-11) + (set! (-> self attack-id) a0-11) + ) + (countdown (s5-1 2) + (vector-! gp-1 (-> self move-dest) (-> self root trans)) + (let ((a0-14 (-> self nav state)) + (v1-33 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-33 quad)) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 acceleration) 1638400.0) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-40 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-40 enemy-flags))) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-40 enemy-flags)))) + ) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-40 enemy-flags)))) + (set! (-> v1-40 nav callback-info) (-> v1-40 enemy-info callback-info)) + ) + 0 + (let ((f0-13 (* 1.6153771 (vector-length gp-1)))) + (let ((v1-46 (-> self nav))) + (set! (-> v1-46 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! ashelin-back-spring-loop-ja :num! (seek! max 1.4) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-12 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-12 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-negate! gp-1 gp-1) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root quat)) + (suspend) + (ja :num! (seek! max 1.4)) + ) + (bot-method-235 self #f) + (if (or (not (bot-method-226 self)) (!= (ashelin-method-257 self) 1)) + (goto cfg-15) + ) + ) + ) + (label cfg-15) + (let ((v1-92 self)) + (set! (-> v1-92 enemy-flags) (the-as enemy-flag (logclear (-> v1-92 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-92 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! ashelin-back-spring-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate cartwheel-left (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-178 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 -16384.0) + (ja-no-eval :group! ashelin-cartwheel-left-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-slerp! (-> self root quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info callback-info)) + ) + 0 + (let ((f0-13 (* 1.0714335 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! ashelin-cartwheel-left-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 -16384.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-78 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! ashelin-cartwheel-left-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate tumble-right (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-178 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 16384.0) + (ja-no-eval :group! ashelin-tumble-right-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-slerp! (-> self root quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info callback-info)) + ) + 0 + (let ((f0-13 (* 1.8749386 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! ashelin-tumble-right-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 16384.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-78 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! ashelin-tumble-right-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +(defstate hit (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + 0 + ) + :code (behavior () + (local-vars (v1-7 enemy-flag) (v1-9 enemy-flag) (v1-11 enemy-flag)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? v1-6 (enemy-flag vulnerable-backup)) + (set! v1-7 (logior v1-6 (enemy-flag vulnerable))) + (set! v1-7 (logclear v1-6 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-7) + (let ((v1-8 (-> self enemy-flags))) + (if (logtest? v1-8 (enemy-flag attackable-backup)) + (set! v1-9 (logior v1-8 (enemy-flag attackable))) + (set! v1-9 (logclear v1-8 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-9) + (let ((v1-10 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-10) + (set! v1-11 (logior (enemy-flag trackable) v1-10)) + (set! v1-11 (logclear v1-10 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-11) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-best-state self) + ) + ) + +(defstate knocked (ashelin) + :virtual #t + :enter (behavior () + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + (let ((t9-0 (-> (method-of-type bot knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self bot-flags) (bot-flag bf23)) + (when (and (!= (-> self hit-points) 0.0) (zero? (-> self fated-time))) + (if (logtest? (-> self bot-flags) (bot-flag bf04)) + (logior! (-> self bot-flags) (bot-flag bf12)) + (logior! (-> self bot-flags) (bot-flag bf23)) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type bot knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (bot-flag bf23) (-> self bot-flags)) (!= (-> self state-time) (current-time))) + (logclear! (-> self bot-flags) (bot-flag bf23)) + (ashelin-method-255 self) + ) + ) + ) + +(defstate die-falling (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + ) + :code (behavior () + (play-speech-by-name self "ash117") + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (or (= v1-4 ashelin-knocked-back-die0-ja) (= v1-4 ashelin-knocked-right-die0-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (falling? self) + (-> self enemy-info die-falling-anim) + (-> self enemy-info die-anim) + ) + ) + ) + (f30-0 (rnd-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + (until #f + (when (logtest? (-> self bot-flags) (bot-flag failed)) + (let ((a0-19 (res-lump-struct (-> self entity) 'task-name structure))) + (when a0-19 + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'fail) + (let ((s5-0 send-event-function) + (v1-48 (-> *game-info* sub-task-list (task-node-index-by-name (the-as string a0-19)))) + ) + (s5-0 + (handle->process (if (-> v1-48 manager) + (-> v1-48 manager manager) + (the-as handle #f) + ) + ) + gp-1 + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate failed (ashelin) + :virtual #t + :enter (behavior () + (go-virtual die-falling) + ) + ) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash-task.gc b/goal_src/jak3/levels/common/ai/ashelin/ash-task.gc index 6436b4690b..a7f923d1d3 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash-task.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash-task.gc @@ -7,3 +7,76 @@ ;; DECOMP BEGINS +(defmethod reset-task! ((this asht-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; WARN: Return type mismatch none vs object. +(defmethod ai-task-method-11 ((this asht-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (-> this spot-indexes))) + (set! (-> this which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-method-198 + arg0 + (the-as int (-> this num-spots)) + (-> this spot-indexes) + (the-as int (-> this spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> this check-done) this (the-as ashelin arg0))) + (let ((a1-10 (handle->process (-> arg0 focus handle)))) + (when (and a1-10 + (attacked-by-player? arg0 (the-as process-focusable a1-10)) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) asht-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + ) + +(defmethod ai-task-method-11 ((this asht-fight-focus) (arg0 bot)) + (let ((a1-1 (handle->process (-> arg0 focus handle)))) + (cond + ((and a1-1 + (attacked-by-player? arg0 (the-as process-focusable a1-1)) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) + ) + (let ((v0-1 (the-as object (logior (-> arg0 bot-flags) (bot-flag bf00))))) + (set! (-> arg0 bot-flags) (the-as bot-flag v0-1)) + v0-1 + ) + ) + (else + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) + ) + ) + ) + ) + +;; WARN: Return type mismatch bot-flag vs none. +(defmethod ai-task-method-10 ((this asht-fight-focus) (arg0 bot)) + (logclear! (-> arg0 bot-flags) (bot-flag bf00)) + (none) + ) diff --git a/goal_src/jak3/levels/common/ai/ashelin/ash.gc b/goal_src/jak3/levels/common/ai/ashelin/ash.gc index d4cb87bccb..78fefedda2 100644 --- a/goal_src/jak3/levels/common/ai/ashelin/ash.gc +++ b/goal_src/jak3/levels/common/ai/ashelin/ash.gc @@ -7,3 +7,1430 @@ ;; DECOMP BEGINS +(deftype ashelin-anim-info (structure) + ((anim-index int32) + ) + :pack-me + ) + + +(deftype ashelin-global-info (basic) + ((prev-blue-hit int8) + (blue-hit-anim ashelin-anim-info 6 :inline) + (blue-hit-land-anim ashelin-anim-info 6 :inline) + ) + ) + + +(define *ashelin-global-info* (new 'static 'ashelin-global-info + :blue-hit-anim (new 'static 'inline-array ashelin-anim-info 6 + (new 'static 'ashelin-anim-info :anim-index 13) + (new 'static 'ashelin-anim-info :anim-index 14) + (new 'static 'ashelin-anim-info :anim-index 15) + (new 'static 'ashelin-anim-info :anim-index 19) + (new 'static 'ashelin-anim-info :anim-index 20) + (new 'static 'ashelin-anim-info :anim-index 21) + ) + :blue-hit-land-anim (new 'static 'inline-array ashelin-anim-info 6 + (new 'static 'ashelin-anim-info :anim-index 16) + (new 'static 'ashelin-anim-info :anim-index 17) + (new 'static 'ashelin-anim-info :anim-index 18) + (new 'static 'ashelin-anim-info :anim-index 22) + (new 'static 'ashelin-anim-info :anim-index 23) + (new 'static 'ashelin-anim-info :anim-index 24) + ) + ) + ) + +(define *ashelin-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim -1 + :hit-anim 3 + :knocked-anim 10 + :knocked-land-anim 11 + :die-anim 26 + :die-falling-anim 26 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 10.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.7 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 57344.0 + :knocked-soft-vxz-hi 57344.0 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 81920.0 + :knocked-medium-vxz-lo 57344.0 + :knocked-medium-vxz-hi 57344.0 + :knocked-medium-vy-lo 81920.0 + :knocked-medium-vy-hi 81920.0 + :knocked-hard-vxz-lo 57344.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 81920.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 57344.0 + :knocked-yellow-vxz-hi 57344.0 + :knocked-yellow-vy-lo 81920.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 57344.0 + :knocked-red-vxz-hi 57344.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 6 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 25) + :run-turning-acceleration (meters 12) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 5) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 20) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod get-penetrated-by ((this ashelin)) + (let* ((t9-0 (method-of-type bot get-penetrated-by)) + (v0-0 (t9-0 this)) + ) + (if (logtest? (bot-flag bf22) (-> this bot-flags)) + (set! v0-0 (logior (penetrate jak-yellow-shot) v0-0)) + ) + v0-0 + ) + ) + +(defmethod ashelin-method-261 ((this ashelin) (arg0 symbol)) + (if arg0 + (logior! (-> this bot-flags) (bot-flag bf22)) + (logclear! (-> this bot-flags) (bot-flag bf22)) + ) + (let ((v0-0 (get-penetrated-by this))) + (set! (-> this root penetrated-by) v0-0) + v0-0 + ) + ) + +(defmethod bot-method-205 ((this ashelin)) + (let* ((t9-0 (method-of-type bot bot-method-205)) + (v0-0 (t9-0 this)) + ) + (when (and (not v0-0) (logtest? (penetrate jak-yellow-shot) (-> this incoming penetrate-using))) + (if (logtest? (bot-flag bf22) (-> this bot-flags)) + (set! v0-0 #t) + ) + (logior! (-> this bot-flags) (bot-flag bf21)) + ) + v0-0 + ) + ) + +(defmethod get-incoming-attack! ((this ashelin) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + (let ((t9-0 (method-of-type bot get-incoming-attack!))) + (t9-0 this arg0 arg1 arg2 arg3 arg4) + ) + (if (!= (-> this incoming knocked-type) (knocked-type blue-shot)) + (set! (-> this incoming knocked-type) (knocked-type mech-punch)) + ) + (none) + ) + +(defmethod send-attack ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (if (and (= (-> arg0 type) target) + (-> this next-state) + (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'back-spring) (= v1-4 'cartwheel-left) (= v1-4 'tumble-right)) + ) + ) + #f + ((method-of-type bot send-attack) this arg0 arg1 arg2) + ) + ) + +(defmethod find-best-focus ((this ashelin)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> this bot-flags) (bot-flag attacked))) + (time-elapsed? (-> this attacker-time) (seconds 5)) + ) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (bot-method-199 this) + ) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (time-elapsed? (-> this attacker-time) (seconds 2.5)) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> this focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + (else + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + s5-1 + ) + ) + ) + +;; WARN: Return type mismatch object vs symbol. +(defmethod alive? ((this ashelin)) + (let ((t9-0 (method-of-type bot alive?))) + (the-as + symbol + (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) + ) + ) + ) + ) + ) + +(defmethod init-enemy-collision! ((this ashelin)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly)) + (set-vector! (-> v1-12 local-sphere) 0.0 3276.8 0.0 3276.8) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-14 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-14 local-sphere) 0.0 5324.8 0.0 3276.8) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-16 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-16 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-16 local-sphere) 0.0 7372.8 0.0 3276.8) + ) + (set! (-> s5-0 nav-radius) 5120.0) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 7)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this ashelin)) + (init-fields! this) + (set! (-> this channel) (gui-channel ashelin)) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 204800.0) + (logior! (-> this bot-flags) (bot-flag bf02)) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 0)) + (set! (-> this hit-invuln-focus-disable-delay) (the-as uint 750)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *ashelin-nav-enemy-info*) + (let ((v1-12 (-> this neck))) + (set! (-> v1-12 up) (the-as uint 1)) + (set! (-> v1-12 nose) (the-as uint 2)) + (set! (-> v1-12 ear) (the-as uint 0)) + (set-vector! (-> v1-12 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-12 ignore-angle) 30947.555) + ) + (let ((t9-4 (method-of-type bot init-enemy!))) + (t9-4 this) + ) + (set! (-> this my-simple-focus) (process-spawn simple-focus :name "simple-focus" :to this)) + 0 + (none) + ) + +;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod ashelin-method-250 ((this ashelin) (arg0 symbol) (arg1 symbol)) + (cond + ((and (logtest? (-> this bot-flags) (bot-flag attacked)) (= (-> this focus-info fproc type) target)) + #t + ) + (else + (let ((f0-0 81920.0)) + (if arg1 + (set! f0-0 (+ 6144.0 f0-0)) + ) + (when (>= f0-0 (-> this focus-info bullseye-xz-dist)) + (let ((v1-9 (-> this focus-info los))) + (if arg0 + (or (= v1-9 1) (= v1-9 4)) + (= v1-9 1) + ) + ) + ) + ) + ) + ) + ) + +(defmethod ashelin-method-247 ((this ashelin) (arg0 symbol)) + (and (time-elapsed? (-> this last-fire-time) (seconds 1)) + (and (>= 8556.089 (fabs (-> this focus-info ry-diff))) (ashelin-method-250 this arg0 #t)) + ) + ) + +;; WARN: Function (method 254 ashelin) has a return type of none, but the expression builder found a return statement. +(defmethod ashelin-method-254 ((this ashelin) (arg0 float)) + (let ((f30-0 (deg- arg0 (-> this focus-info my-facing-ry)))) + (when (>= 16384.0 (fabs f30-0)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) + (return 1) + ) + (cond + ((< 0.0 f30-0) + (when (ashelin-method-248 this s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) + (return 2) + ) + ) + (else + (when (ashelin-method-248 this s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) + (return 3) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs int. +(defmethod ashelin-method-257 ((this ashelin)) + (when (>= 32768.0 (-> this focus-info bullseye-xz-dist)) + (let ((f0-1 (-> this focus-info bullseye-ry))) + (return (the-as int (ashelin-method-254 this f0-1))) + ) + ) + (when (logtest? (bot-flag bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (when (>= (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)) 12288.0) + (let ((f0-7 (atan (-> this frontline x) (-> this frontline z)))) + (return (the-as int (ashelin-method-254 this f0-7))) + ) + ) + ) + (the-as int 0) + ) + +(defmethod ashelin-method-252 ((this ashelin)) + (let* ((v1-0 (target-pos 0)) + (a1-0 (-> this root trans)) + (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) + (f0-5 (deg- f30-0 (-> this focus-info my-facing-ry))) + (s5-0 0) + ) + (cond + ((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0)) + (let ((s3-1 (zero? (rnd-int this 2))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s2-0 2) + (cond + (s3-1 + (when (ashelin-method-248 this s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) + (set! s5-0 3) + (goto cfg-20) + ) + ) + (else + (when (ashelin-method-248 this s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) + (set! s5-0 2) + (goto cfg-20) + ) + ) + ) + (set! s3-1 (not s3-1)) + ) + ) + (label cfg-20) + ) + (else + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) + (set! s5-0 1) + ) + ) + ) + ) + s5-0 + ) + ) + +(defmethod ashelin-method-253 ((this ashelin)) + (let ((s5-0 0)) + (cond + ((zero? (rnd-int this 2)) + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s4-0 (+ 16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) + (set! s5-0 3) + ) + ) + ) + ) + (else + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s4-1 (+ -16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) + (set! s5-0 2) + ) + ) + ) + ) + ) + s5-0 + ) + ) + +(defmethod go-dodge-state ((this ashelin) (arg0 int)) + (case arg0 + ((3) + (go (method-of-object this cartwheel-left)) + ) + ((2) + (go (method-of-object this tumble-right)) + ) + (else + (go (method-of-object this back-spring)) + ) + ) + ) + +(defmethod ashelin-method-258 ((this ashelin)) + (cond + ((logtest? (bot-flag bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f30-0 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)))) + (let ((f0-4 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye)))) + (if (or (>= 0.0 f0-4) (>= -8192.0 f30-0)) + (return #t) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> this frontline)))) + (return #t) + ) + (if (>= f30-0 0.0) + (return #f) + ) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (a0-8 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a2-0 (the-as vector (-> this frontline)) (- (-> this frontline w))) + (set! (-> a0-8 quad) (-> this root trans quad)) + (set! (-> a0-8 y) 0.0) + (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> this frontline)) 8192.0) + ) + ) + ) + ) + (else + #t + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod ashelin-method-259 ((this ashelin)) + (when (logtest? (bot-flag bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f0-3 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans))) + (f1-1 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye))) + ) + (when (and (< 0.0 f1-1) (< 0.0 f0-3)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s5-0 (the-as vector (-> this frontline))) 0.0) + ) + ) + ) + ) + (none) + ) + +(defmethod go-hostile ((this ashelin)) + (bot-method-235 this #t) + (cond + ((not (bot-method-226 this)) + (go-best-state this) + ) + ((ashelin-method-250 this #t #f) + (go (method-of-object this standing-idle)) + ) + ((ashelin-method-258 this) + (go (method-of-object this chase)) + ) + (else + (go (method-of-object this standing-idle)) + ) + ) + ) + +(defmethod go-best-state ((this ashelin)) + (if (bot-method-226 this) + (go-hostile this) + (go-idle this) + ) + ) + +(defmethod go-idle ((this ashelin)) + (if (bot-method-226 this) + (go (method-of-object this standing-idle)) + (go (method-of-object this waiting-idle)) + ) + ) + +(defmethod go-idle2 ((this ashelin)) + (go (method-of-object this hidden)) + ) + +(defmethod fire-shot ((this ashelin) (arg0 vector)) + (set-time! (-> this last-fire-time)) + (+! (-> this fired-gun-count) 1) + (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-0 ent) (-> this entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options po13 po17)) + (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) + (set! (-> s4-0 notify-handle) (process->handle this)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 target-handle) (the-as handle #f)) + (set! (-> s4-0 target-pos quad) (the-as uint128 0)) + (set! (-> s4-0 ignore-handle) (process->handle this)) + (let* ((v1-16 *game-info*) + (a0-11 (+ (-> v1-16 attack-id) 1)) + ) + (set! (-> v1-16 attack-id) a0-11) + (set! (-> s4-0 attack-id) a0-11) + ) + (set! (-> s4-0 timeout) (seconds 4)) + (vector<-cspace! (-> s4-0 pos) (-> this node-list data 22)) + (set! (-> s4-0 vel quad) (-> arg0 quad)) + (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) + (vector-normalize! (-> s4-0 vel) 307200.0) + (spawn-projectile ashelin-shot s4-0 this *default-dead-pool*) + ) + ) + +(defmethod ashelin-method-260 ((this ashelin)) + (local-vars (v0-6 int)) + (with-pp + (let* ((f30-0 (-> this nav state speed)) + (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) + (f1-0 (-> this travel-anim-interp)) + (v1-5 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-5 (= v1-5 (-> this draw art-group data 5))) + (let ((f28-0 f1-0) + (f0-4 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame)))) + ) + (cond + ((logtest? (bot-flag bf19) (-> this bot-flags)) + (if (< f0-4 1.0) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-17 (-> this skel root-channel 1))) + (set! (-> v1-17 dist) 13107.2) + (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) + ) + (logclear! (-> this bot-flags) (bot-flag bf19)) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + (else + (if (< 1.0 f0-4) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-27 (-> this skel root-channel 1))) + (set! (-> v1-27 dist) 43690.68) + (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) + ) + (logior! (-> this bot-flags) (bot-flag bf19)) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + ) + (set! (-> this travel-anim-interp) f0-4) + (let ((f0-7 (if (logtest? (bot-flag bf19) (-> this bot-flags)) + (+ -1.0 f0-4) + (- 1.0 f0-4) + ) + ) + (v1-39 (-> this skel root-channel 1)) + ) + (set! (-> v1-39 frame-interp 1) f0-7) + (set! (-> v1-39 frame-interp 0) f0-7) + ) + ) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-8 (quaternion-y-angle (-> this root quat))) + (f1-10 (deg- f0-8 (-> this travel-prev-ry))) + (f0-11 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-10)))) + (f0-14 (/ (* 16.0 (fmax f30-0 f0-11)) (* 15.0 f28-1))) + (a0-22 (-> this skel root-channel 0)) + ) + (set! (-> a0-22 param 0) f0-14) + (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-23 (-> this skel root-channel 1))) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (let ((f30-1 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame))))) + (set! (-> this travel-anim-interp) f30-1) + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 dist) 26214.4) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) + (set! (-> a0-26 param 0) 1.0) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) + ) + (cond + ((< f30-1 1.0) + (let ((f0-22 (- 1.0 f30-1)) + (a0-27 (-> this skel root-channel 1)) + ) + (set! (-> a0-27 frame-interp 1) f0-22) + (set! (-> a0-27 frame-interp 0) f0-22) + (set! (-> a0-27 dist) 13107.2) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) + (set! (-> a0-27 param 0) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-chan) + ) + (set! v0-6 (the-as int (logclear (-> this bot-flags) (bot-flag bf19)))) + (set! (-> this bot-flags) (the-as bot-flag v0-6)) + ) + (else + (let ((f0-26 (+ -1.0 f30-1)) + (a0-29 (-> this skel root-channel 1)) + ) + (set! (-> a0-29 frame-interp 1) f0-26) + (set! (-> a0-29 frame-interp 0) f0-26) + (set! (-> a0-29 dist) 43690.68) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) + (set! (-> a0-29 param 0) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) + ) + (set! v0-6 (the-as int (logior (bot-flag bf19) (-> this bot-flags)))) + (set! (-> this bot-flags) (the-as bot-flag v0-6)) + ) + ) + ) + v0-6 + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this ashelin)) + (local-vars (v1-36 art-element)) + (let ((f28-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((a0-4 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-4 + (get-trans a0-4 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f28-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (vector-z-quaternion! s5-1 (-> this root quat)) + (let ((f28-1 (atan (-> s5-1 x) (-> s5-1 z)))) + (get-knockback-dir! this s5-1) + (let* ((f30-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f0-10 (deg- f30-0 f28-1)) + ) + (set! f28-0 (if (>= 16384.0 (fabs f0-10)) + f30-0 + (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48)) + ) + ) + (cond + ((and (>= 8192.0 f0-10) (>= f0-10 -16384.0)) + (set! v1-36 (-> this draw art-group data 10)) + ) + ((>= f0-10 8192.0) + (set! v1-36 (-> this draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ((zero? (rnd-int this 3)) + (set! v1-36 (-> this draw art-group data 10)) + ) + (else + (set! v1-36 (-> this draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ) + ) + ) + ) + (set! (-> this knocked-anim) (the-as art-joint-anim v1-36)) + ) + ) + (the-as degrees f28-0) + ) + ) + +(defmethod knocked-anim ((this ashelin) (arg0 enemy-knocked-info)) + (local-vars (a2-0 int)) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-1 (ash 1 (-> *ashelin-global-info* prev-blue-hit))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s4-0 (-> this root quat)) + (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (get-knockback-dir! this s4-0) + (let* ((f0-6 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-8 (fabs (deg- f0-6 f30-0))) + ) + (if (>= 16384.0 f0-8) + (set! a2-0 (logior s5-1 7)) + (set! a2-0 (logior s5-1 56)) + ) + ) + ) + ) + (let* ((v1-9 (enemy-method-131 this 6 a2-0)) + (s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9 anim-index))) + ) + (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) + (let ((v1-12 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-12 (or (= v1-12 (-> this draw art-group data 16)) + (= v1-12 (-> this draw art-group data 17)) + (= v1-12 (-> this draw art-group data 18)) + (= v1-12 (-> this draw art-group data 22)) + (= v1-12 (-> this draw art-group data 23)) + (= v1-12 (-> this draw art-group data 24)) + ) + ) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-38 (-> this skel root-channel 0))) + (set! (-> a0-38 frame-group) (the-as art-joint-anim s5-2)) + (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) + (set! (-> a0-38 param 1) 1.0) + (set! (-> a0-38 frame-num) 0.0) + (joint-control-channel-group! a0-38 (the-as art-joint-anim s5-2) num-func-seek!) + ) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (-> this knocked-anim)) + (set! (-> a0-40 param 0) (the float (+ (-> this knocked-anim frames num-frames) -1))) + (set! (-> a0-40 param 1) (-> arg0 anim-speed)) + (set! (-> a0-40 frame-num) 0.0) + (joint-control-channel-group! a0-40 (-> this knocked-anim) num-func-seek!) + ) + #t + ) + ) + ) + +(defmethod knocked-land-anim ((this ashelin) (arg0 enemy-knocked-info)) + (let ((v1-0 (-> this incoming knocked-type))) + (cond + ((= v1-0 (knocked-type blue-shot)) + (let* ((v1-1 *ashelin-global-info*) + (s5-0 (-> this draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit) anim-index))) + ) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim s5-0)) + (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) + (set! (-> a0-7 param 1) 1.0) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim s5-0) num-func-seek!) + ) + ) + #t + ) + ((let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (and v1-15 (= v1-15 (-> this draw art-group data 7))) + ) + (cond + ((or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) + (set! (-> a0-14 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 9)) frames num-frames) -1)) + ) + (set! (-> a0-14 param 1) 1.0) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) + (set! (-> a0-16 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 8)) frames num-frames) -1)) + ) + (set! (-> a0-16 param 1) 1.0) + (set! (-> a0-16 frame-num) 0.0) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-seek!) + ) + #t + ) + ) + ) + ((and (or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) (nonzero? (rnd-int this 3))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) + (set! (-> a0-20 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-20 param 1) 1.0) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) + ) + #t + ) + ) + ) + ) + +(defmethod knocked-anim-handler ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) + (cond + ((= arg0 3) + (let ((s5-0 (ja-done? 0))) + (cond + ((and s5-0 (let ((v1-4 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (and v1-4 (or (= v1-4 (-> this draw art-group data 16)) + (= v1-4 (-> this draw art-group data 17)) + (= v1-4 (-> this draw art-group data 18)) + (= v1-4 (-> this draw art-group data 22)) + (= v1-4 (-> this draw art-group data 23)) + (= v1-4 (-> this draw art-group data 24)) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) + (set! (-> a0-21 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) + ) + (set! s5-0 #f) + ) + (else + (let ((v1-25 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-25 (= v1-25 (-> this draw art-group data 8))) + (let ((f0-4 (ja-aframe-num 0))) + (cond + ((>= f0-4 22.0) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-4 16.0) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) + (let* ((v1-42 *game-info*) + (a0-34 (+ (-> v1-42 attack-id) 1)) + ) + (set! (-> v1-42 attack-id) a0-34) + (set! (-> this attack-id) a0-34) + ) + ) + ) + ) + ) + ) + ((let ((v1-45 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (and v1-45 (= v1-45 (-> this draw art-group data 11))) + ) + (let ((f0-5 (ja-aframe-num 0))) + (cond + ((>= f0-5 32.0) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-5 25.0) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) + (let* ((v1-62 *game-info*) + (a0-47 (+ (-> v1-62 attack-id) 1)) + ) + (set! (-> v1-62 attack-id) a0-47) + (set! (-> this attack-id) a0-47) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((a0-48 (-> this skel root-channel 0))) + (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group frames num-frames) -1))) + (set! (-> a0-48 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type bot knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +(defmethod ashelin-method-248 ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (v1-23 float) (sv-272 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let* ((v1-0 (-> this nav)) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a1-1 (-> v1-0 sphere-id-array)) + (a2-2 (-> v1-0 state mesh bounds)) + (a3-1 (-> v1-0 root-nav-sphere)) + (t0-1 (-> v1-0 sphere-count)) + ) + (dotimes (t1-1 t0-1) + (let ((t3-0 (-> a0-3 (-> a1-1 t1-1))) + (t2-4 (-> v1-0 sphere-array t1-1)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-2)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-1 w))) + ) + ) + ) + 0 + (let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (vector-! (-> s0-0 current-pos) (-> this root trans) (the-as vector (-> this nav state mesh bounds))) + (set! sv-272 (-> s0-0 travel)) + (set! (-> sv-272 x) (sin arg1)) + (set! (-> sv-272 y) 0.0) + (set! (-> sv-272 z) (cos arg1)) + (set! (-> sv-272 w) 1.0) + (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) + (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) + (avoid-spheres-1! (-> this nav) s0-0) + (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) + ) + 0 + (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) + (let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) (-> this nav state current-poly) arg0 t0-2) + ) + (.lvf vf1 (&-> arg0 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-23 vf1) + (let ((f0-11 v1-23) + (f1-1 arg4) + ) + (>= f0-11 (* f1-1 f1-1)) + ) + ) + ) + ) + +(defmethod normalize-heading! ((this ashelin) (arg0 nav-control)) + (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) + ) + ) + ) + ((method-of-type bot normalize-heading!) this arg0) + ) + (none) + ) + +(defmethod bot-method-228 ((this ashelin)) + (set! (-> this health-handle) + (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :name "hud-ashelin" :to this)) + ) + 0 + (none) + ) + +(defmethod play-next-speech ((this ashelin)) + (local-vars (v1-3 int) (a3-0 int)) + (when (not (channel-active? this (gui-channel none))) + (let ((v1-2 0)) + (if (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) + (-> this incoming penetrate-using) + ) + (set! v1-3 (logior v1-2 128)) + (set! v1-3 (logior v1-2 64)) + ) + ) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (set! a3-0 (logior v1-3 256)) + (set! a3-0 (logior v1-3 512)) + ) + (let ((a1-3 (get-next-speech-idx + (-> this course attack-player-speeches) + this + (-> this course speeches) + (the-as bot-speech-info-flag a3-0) + ) + ) + ) + (if (>= a1-3 0) + (play-speech-by-id this a1-3) + ) + ) + ) + ) + +;; WARN: Return type mismatch gui-connection vs none. +(defmethod ashelin-method-255 ((this ashelin)) + (when (not (channel-active? this (gui-channel none))) + (let ((a1-2 + (get-next-speech-idx (-> this course ouch-speeches) this (-> this course speeches) (bot-speech-info-flag)) + ) + ) + (if (>= a1-2 0) + (play-speech-by-id this a1-2) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch gui-connection vs none. +(defmethod ashelin-method-256 ((this ashelin)) + (when (and (not (channel-active? this (gui-channel none))) (>= (current-time) (-> this victory-speech-time))) + (let ((s5-0 + (get-next-speech-idx (-> this course victory-speeches) this (-> this course speeches) (bot-speech-info-flag)) + ) + ) + (when (>= s5-0 0) + (set! (-> this victory-speech-time) (+ (set-reaction-time! this (seconds 4) (seconds 7)) (current-time))) + (play-speech-by-id this s5-0) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch enemy-flag vs none. +(defmethod check-victory ((this ashelin)) + (if (time-elapsed? (-> this hit-focus-time) (seconds 2)) + (logclear! (-> this enemy-flags) (enemy-flag victory)) + ) + (none) + ) + +;; WARN: Return type mismatch enemy-flag vs gui-connection. +(defmethod play-speech-by-id ((this ashelin) (arg0 int)) + (let ((t9-0 (method-of-type bot play-speech-by-id))) + (t9-0 this arg0) + ) + (let ((v0-1 (logclear (-> this enemy-flags) (enemy-flag victory)))) + (set! (-> this enemy-flags) v0-1) + (the-as gui-connection v0-1) + ) + ) + +(defmethod draw ((this hud-ashelin)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 8 2) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-ashelin)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-ashelin)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-transparent-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-npcring-bar-01 level-default-minimap))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-npcring-01 level-default-minimap))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-ashlyn-head" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/common/ai/bot-h.gc b/goal_src/jak3/levels/common/ai/bot-h.gc index 4872e1d003..e1209f67cd 100644 --- a/goal_src/jak3/levels/common/ai/bot-h.gc +++ b/goal_src/jak3/levels/common/ai/bot-h.gc @@ -5,5 +5,732 @@ ;; name in dgo: bot-h ;; dgos: DESOASIS +(declare-type bot-speech-list basic) +(declare-type bot-speech-list-shuffle bot-speech-list) + +;; +++bot-task-bits +(defenum bot-task-bits + :type uint32 + :bitfield #t + (bb0) + (bb1) + (bb2) + (bb3) + (bb4) + (bb5) + (bb6) + (bb7) + ) +;; ---bot-task-bits + + +;; +++bot-speech-info-flag +(defenum bot-speech-info-flag + :type uint16 + :bitfield #t + (playing) + (sf01) + (sf02) + (sf03) + (sf04) + (sf05) + (sf06) + (sf08) + (sf09) + (sf10) + (sf11) + (sf12) + (sf13) + (sf14) + (sf15) + ) +;; ---bot-speech-info-flag + + +;; +++bot-flag +(defenum bot-flag + :type uint32 + :bitfield #t + (bf00 0) + (failed 1) + (bf02 2) + (bf03 3) + (bf04 4) + (bf05 5) + (bf06 6) + (attacked 7) + (too-far-fail 8) + (bf09 9) + (bf10 10) + (bf11 11) + (bf12 12) + (bf13 13) + (bf14 14) + (bf15 15) + (bf16 16) + (bf17 17) + (bf18 18) + (bf19 19) + (bf20 20) + (bf21 21) + (bf22 22) + (bf23 23) + (bf24 24) + (bf25 25) + (bf26 26) + (bf27 27) + (bf28 28) + (bf29 29) + (bf30 30) + (bf31 31) + ) +;; ---bot-flag + + +;; +++waypoint-bits +(defenum waypoint-bits + :bitfield #t + :type uint32 + (wb0) + (wb1) + (wb2) + (wb3) + (wb4) + (wb5) + (wb6) + (wb7) + ) +;; ---waypoint-bits + + +;; +++waypoint-bits-s32 +(defenum waypoint-bits-s32 + :bitfield #t + :type int32 + :copy-entries waypoint-bits + ) +;; ---waypoint-bits-s32 + + +;; +++bot-speech-list-flag +(defenum bot-speech-list-flag + :type uint8 + :bitfield #t + (bsl0 0) + (bsl1 1) + (bsl2 2) + (bsl3 3) + ) +;; ---bot-speech-list-flag + + ;; DECOMP BEGINS +(deftype bot-focus-info (structure) + ((max-los-dist float) + (fproc process-focusable) + (bullseye-xz-dist float) + (ry-diff float) + (my-facing-ry float) + (bullseye-ry float) + (los int8) + (update-time time-frame) + (bullseye vector :inline) + (pos vector :inline) + (my-facing-xz-dir vector :inline) + (bullseye-xz-dir vector :inline) + ) + ) + + +(deftype bot-turn-info (structure) + ((facing-ry float) + (targ-ry float) + (ry-diff float) + (predicted-ry-diff float) + (predicted-targ-ry float) + (facing-dir vector :inline) + (targ-pos vector :inline) + (predicted-targ-pos vector :inline) + (src-quat quaternion :inline) + ) + ) + + +(deftype bot-speech-tuning (structure) + ((fo-min int32) + (fo-max int32) + (fo-curve int8) + (trans? symbol) + ) + ) + + +(deftype bot-speech-info (structure) + ((flags bot-speech-info-flag) + (hold-time uint16) + (slave-id int8) + (tuning-id int8) + (name string) + ) + ) + + +(deftype bot-spot (structure) + ((center vector :inline) + (center-x float :overlay-at (-> center data 0)) + (center-y float :overlay-at (-> center data 1)) + (center-z float :overlay-at (-> center data 2)) + (inside-xz-dist float :overlay-at (-> center data 3)) + (blocked-xz-dist float) + ) + ) + + +(deftype bot-waypoint (basic) + ((waypoint-id int16) + (nav-mesh-index int8) + (skip-to int8) + (on-set (function bot object)) + (on-update (function bot object)) + (on-skipping-here (function bot object)) + (check-too-far symbol) + (warn-dist float) + (fail-dist-delta float) + ) + ) + + +(deftype bot-course (basic) + ((course-id uint8) + (speech-count uint16) + (spot-count uint16) + (retry-cookie uint8) + (too-far-warn-speeches bot-speech-list-shuffle) + (too-far-fail-speeches bot-speech-list) + (attack-player-speeches bot-speech-list) + (default-check-too-far symbol) + (waypoints (array bot-waypoint)) + (speeches (inline-array bot-speech-info)) + (speech-tunings (inline-array bot-speech-tuning)) + (dirs (inline-array vector)) + (spots (inline-array bot-spot)) + ) + ) + + +(deftype bot (nav-enemy) + ((bot-flags bot-flag) + (min-speed float) + (max-speed float) + (follow-offset float) + (too-far-warn-dist float) + (too-far-fail-dist-delta float) + (too-far-warn-dist-default float) + (too-far-fail-dist-delta-default float) + (travel-prev-ry float) + (travel-prev-ry1 float) + (player-blocking float) + (ai-ctrl ai-task-control) + (course bot-course) + (waypoint bot-waypoint) + (waypoint-bits waypoint-bits) + (waypoint-int32a waypoint-bits-s32) + (bot-task-bits bot-task-bits) + (hit-invuln-ignore-me-delay uint32) + (hit-invuln-focus-disable-delay uint32) + (warn-to-fail-timeout uint32) + (warn-min-delay uint32) + (warn-max-delay uint32) + (spot-color uint32) + (waypoint-request int16) + (hit-by-enemy-count uint16) + (hit-by-player-count uint16) + (notice-enemy-dist float) + (channel gui-channel) + (focus-mode int8) + (nav-mesh-index int8) + (delay-too-far-check int8) + (slave-id int8) + (vehicle-seat-index int8) + (bot-health-index int8) + (task game-task-control) + (task-node game-task-node-info) + (swivel-joint-mod joint-mod) + (health-handle handle) + (poi-handle handle) + (my-simple-focus (pointer simple-focus)) + (attacker-handle handle) + (scene-player-handle handle) + (master-handle handle) + (vehicle-handle handle) + (hit-invuln-starting-time time-frame) + (danger-time time-frame) + (attacker-time time-frame) + (started-warning-time time-frame) + (waypoint-time0 time-frame) + (next-too-far-warn-time time-frame) + (spot bot-spot :inline) + (follow-dir vector :inline) + (focus-info bot-focus-info :inline) + ) + (:state-methods + failed + hidden + ) + (:methods + (clear-poi (_type_) none) + (bot-method-193 (_type_ vector vector vector vector vector float) none) + (bot-method-194 (_type_ bot-turn-info process-focusable float) float) + (alive? (_type_) symbol) + (bot-method-196 (_type_) none) + (debug-draw-spot (_type_ bot-spot rgba) symbol) + (bot-method-198 (_type_ int (pointer uint8) int) symbol) + (bot-method-199 (_type_) none) + (scene-stop (_type_) symbol) + (bot-method-201 (_type_) process) + (bot-method-202 (_type_) symbol) + (bot-method-203 (_type_) none) + (bot-method-204 (_type_) none) + (bot-method-205 (_type_) symbol) + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol) + (attacked-by-player? (_type_ process-focusable) object) + (set-fail-flag (_type_) none) + (bot-method-209 (_type_) none) + (set-cam-height (_type_ vector) float) + (cam-move-to-bot (_type_) none) + (bot-method-212 (_type_) none) + (set-next-focus! (_type_ enemy enemy-best-focus) enemy) + (choose-spot (_type_ int (pointer uint8)) int) + (play-next-speech (_type_) gui-connection) + (bot-method-216 (_type_) none) + (scene-play (_type_ scene symbol) symbol) + (play-speech-by-id (_type_ int) gui-connection) + (play-speech-by-name (_type_ string) sound-id) + (bot-method-220 (_type_) symbol) + (channel-active? (_type_ gui-channel) symbol) + (init-fields! (_type_) none) + (bot-method-223 (_type_) none) + (reset-warn-time (_type_) none) + (go-to-waypoint! (_type_ int symbol) object) + (bot-method-226 (_type_) object) + (skip-waypoint (_type_) object) + (bot-method-228 (_type_) none) + (course-speech-ended? (_type_ int) symbol) + (course-speech-playing? (_type_ int) symbol) + (player-blocking-spot? (_type_ bot-spot) symbol) + (bot-method-232 (_type_ gui-channel symbol) int) + (bot-method-233 (_type_) quaternion) + (bot-method-234 (_type_ vector) none) + (bot-method-235 (_type_ symbol) none) + (bot-check-too-far (_type_) symbol) + ) + ) + + +(define *bot-task-pool* (new 'static 'ai-task-pool + :anchor #f + :tasks (new 'static 'array uint32 240 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + ) + :tasks-length #x14 + ) + ) + +(ai-task-pool-method-11 *bot-task-pool*) + +(deftype bot-speech-list (basic) + ((flags bot-speech-list-flag) + (retry-cookie uint8) + (last-local-index int16) + (speech-indexes (array int16)) + ) + (:methods + (get-next-speech-idx (_type_ bot (inline-array bot-speech-info) bot-speech-info-flag) int) + (reset-index (_type_ symbol) none) + ) + ) + + +(defmethod reset-index ((this bot-speech-list) (arg0 symbol)) + (if arg0 + (logclear! (-> this flags) (bot-speech-list-flag bsl0)) + ) + (set! (-> this last-local-index) -1) + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod get-next-speech-idx ((this bot-speech-list) (arg0 bot) (arg1 (inline-array bot-speech-info)) (arg2 bot-speech-info-flag)) + (let ((v1-1 (-> arg0 course retry-cookie))) + (when (!= v1-1 (-> this retry-cookie)) + (set! (-> this retry-cookie) (-> arg0 course retry-cookie)) + (reset-index this #t) + ) + ) + (let ((s2-0 (-> this speech-indexes)) + (s1-0 (-> this last-local-index)) + ) + (when (< s1-0 0) + (when (not (logtest? (-> this flags) (bot-speech-list-flag bsl0))) + (logior! (-> this flags) (bot-speech-list-flag bsl0)) + (set! arg2 (logior arg2 (bot-speech-info-flag sf02))) + ) + (reset-index this #f) + (if (logtest? (-> this flags) (bot-speech-list-flag bsl2)) + (set! s1-0 (+ (rnd-int arg0 (-> s2-0 length)) -1)) + (set! s1-0 -1) + ) + ) + (until #f + (when (>= s1-0 (+ (-> s2-0 length) -1)) + (if (not (logtest? (-> this flags) (bot-speech-list-flag bsl1))) + (goto cfg-23) + ) + (reset-index this #f) + (set! s1-0 -1) + ) + (+! s1-0 1) + (let* ((s0-0 (-> s2-0 s1-0)) + (v1-37 (-> arg1 s0-0 flags)) + ) + (when (and (not (logtest? arg2 v1-37)) + (or (not (logtest? v1-37 (bot-speech-info-flag sf11))) (not (course-speech-playing? arg0 s0-0))) + ) + (set! (-> this last-local-index) s1-0) + (return s0-0) + ) + ) + ) + ) + #f + (label cfg-23) + -1 + ) + +(deftype bot-speech-list-shuffle (bot-speech-list) + ((history-mask uint64) + (history-mask-full uint64) + ) + ) + + +(defmethod reset-index ((this bot-speech-list-shuffle) (arg0 symbol)) + (let ((t9-0 (method-of-type bot-speech-list reset-index))) + (t9-0 this arg0) + ) + (set! (-> this history-mask) (the-as uint 0)) + (when (zero? (-> this history-mask-full)) + (let ((v0-2 0)) + (let ((v1-2 1)) + (countdown (a0-3 (-> this speech-indexes length)) + (set! v0-2 (logior v0-2 v1-2)) + (set! v1-2 (* v1-2 2)) + ) + ) + (set! (-> this history-mask-full) (the-as uint v0-2)) + ) + ) + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defmethod get-next-speech-idx ((this bot-speech-list-shuffle) (arg0 bot) (arg1 (inline-array bot-speech-info)) (arg2 bot-speech-info-flag)) + (local-vars (sv-16 int)) + (let ((v1-1 (-> arg0 course retry-cookie))) + (when (!= v1-1 (-> this retry-cookie)) + (set! (-> this retry-cookie) (-> arg0 course retry-cookie)) + (reset-index this #t) + ) + ) + (set! sv-16 (-> this last-local-index)) + (when (< sv-16 0) + (when (not (logtest? (-> this flags) (bot-speech-list-flag bsl0))) + (logior! (-> this flags) (bot-speech-list-flag bsl0)) + (set! arg2 (logior arg2 (bot-speech-info-flag sf02))) + ) + (reset-index this #f) + ) + (let ((s2-0 0)) + (if (>= sv-16 0) + (set! s2-0 (ash 1 sv-16)) + ) + (if (logtest? (-> this flags) (bot-speech-list-flag bsl3)) + (set! s2-0 (logior s2-0 (-> this history-mask))) + ) + (until #f + (when (and (= s2-0 (-> this history-mask-full)) (logtest? (-> this flags) (bot-speech-list-flag bsl3))) + (if (not (logtest? (-> this flags) (bot-speech-list-flag bsl1))) + (return -1) + ) + (reset-index this #f) + (if (>= sv-16 0) + (set! s2-0 (ash 1 sv-16)) + (set! s2-0 0) + ) + ) + (let* ((s1-0 (enemy-method-131 arg0 (-> this speech-indexes length) s2-0)) + (s0-0 (-> this speech-indexes s1-0)) + (v1-47 (-> arg1 s0-0 flags)) + ) + (set! s2-0 (logior s2-0 (ash 1 s1-0))) + (when (and (not (logtest? arg2 v1-47)) + (or (not (logtest? v1-47 (bot-speech-info-flag sf11))) (not (course-speech-playing? arg0 s0-0))) + ) + (set! (-> this last-local-index) s1-0) + (logior! (-> this history-mask) (ash 1 s1-0)) + (return s0-0) + ) + ) + ) + ) + #f + -1 + ) + +(deftype bot-course-table (basic) + ((course bot-course 1) + ) + ) + + +(define *bot-course-table* (new 'static 'bot-course-table)) diff --git a/goal_src/jak3/levels/common/ai/bot-states.gc b/goal_src/jak3/levels/common/ai/bot-states.gc index 3435974942..a857be961a 100644 --- a/goal_src/jak3/levels/common/ai/bot-states.gc +++ b/goal_src/jak3/levels/common/ai/bot-states.gc @@ -7,3 +7,293 @@ ;; DECOMP BEGINS +(defstate hit (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (bot-method-232 self (gui-channel none) #t) + (bot-method-203 self) + (logclear! (-> self bot-flags) (bot-flag bf11)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) exit))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self bot-flags) (bot-flag bf11)) + ) + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-39 enemy-flag) (v1-41 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-36 (-> self enemy-flags))) + (if (logtest? v1-36 (enemy-flag vulnerable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag vulnerable))) + (set! v1-37 (logclear v1-36 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? v1-38 (enemy-flag attackable-backup)) + (set! v1-39 (logior v1-38 (enemy-flag attackable))) + (set! v1-39 (logclear v1-38 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (let ((v1-40 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-40) + (set! v1-41 (logior (enemy-flag trackable) v1-40)) + (set! v1-41 (logclear v1-40 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-41) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-best-state self) + ) + ) + +(defstate knocked (bot) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (bot-method-232 self (gui-channel none) #t) + (if (and (logtest? (-> self bot-flags) (bot-flag attacked)) + (and (!= (-> self hit-points) 0.0) (zero? (-> self fated-time))) + ) + (logior! (-> self bot-flags) (bot-flag bf12)) + ) + (bot-method-203 self) + (when (= (-> self hit-points) 0.0) + (set! (-> self hit-points) 1.0) + (set-time! (-> self fated-time)) + ) + (logclear! (-> self bot-flags) (bot-flag bf11)) + (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit (behavior () + (let ((gp-0 (-> self incoming attack-id))) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self incoming attack-id) gp-0) + ) + (logior! (-> self bot-flags) (bot-flag bf11)) + (logclear! (-> self bot-flags) (bot-flag bf12)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (-> self bot-flags) (bot-flag bf12)) (!= (-> self state-time) (current-time))) + (logclear! (-> self bot-flags) (bot-flag bf12)) + (play-next-speech self) + ) + ) + ) + +(defstate die-falling (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (kill-nearby-enemies (-> self root trans) 61440.0) + (bot-method-232 self (gui-channel none) #f) + (logclear! (-> self bot-flags) (bot-flag bf06 bf11)) + (set! (-> self delay-too-far-check) -1) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + (bot-method-209 self) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flag bf11)) + (logclear! (-> self bot-flags) (bot-flag bf13 bf14)) + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (bot-method-212 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (falling? self) + (-> self enemy-info die-falling-anim) + (-> self enemy-info die-anim) + ) + ) + ) + (f30-0 (rnd-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (until (not (channel-active? self (gui-channel none))) + (suspend) + ) + (until #f + (when (logtest? (-> self bot-flags) (bot-flag failed)) + (let ((a0-10 (res-lump-struct (-> self entity) 'task-name structure))) + (when a0-10 + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'fail) + (let ((s5-0 send-event-function) + (v1-35 (-> *game-info* sub-task-list (task-node-index-by-name (the-as string a0-10)))) + ) + (s5-0 + (handle->process (if (-> v1-35 manager) + (-> v1-35 manager manager) + (the-as handle #f) + ) + ) + gp-1 + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + ) + ) + +(defstate failed (bot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type bot die-falling) enter)) + (logclear! (-> self bot-flags) (bot-flag bf11)) + (when (logtest? (-> self bot-flags) (bot-flag failed)) + (let ((a0-1 (-> self course too-far-fail-speeches))) + (when (and (nonzero? a0-1) a0-1) + (let ((a1-1 (get-next-speech-idx a0-1 self (-> self course speeches) (bot-speech-info-flag)))) + (if (>= a1-1 0) + (play-speech-by-id self a1-1) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flag bf11)) + ) + :trans (behavior () + ((-> (method-of-type bot die-falling) trans)) + (if (channel-active? self (gui-channel none)) + (set-time! (-> self state-time)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (when (and (logtest? (-> self bot-flags) (bot-flag failed)) (time-elapsed? (-> self state-time) (seconds 0.5)) #f) + (cleanup-for-death self) + (process-entity-status! self (entity-perm-status no-kill) #f) + (let ((a0-10 (res-lump-struct (-> self entity) 'task-name string))) + (when a0-10 + (let ((s5-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-0 from) (process->ppointer self)) + (set! (-> s5-0 num-params) 0) + (set! (-> s5-0 message) 'fail) + (let ((s4-0 send-event-function) + (v1-27 (-> *game-info* sub-task-list (task-node-index-by-name a0-10))) + ) + (s4-0 + (handle->process (if (-> v1-27 manager) + (-> v1-27 manager manager) + (the-as handle #f) + ) + ) + s5-0 + ) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-die-falling-post + ) + +(defstate hidden (bot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status disable)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self notice-enemy-dist) 0.0) + (logclear! (-> self enemy-flags) (enemy-flag check-water)) + ) + :exit (behavior () + (local-vars (v0-0 enemy-flag)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self focus-status) (focus-status disable)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? (enemy-flag check-water-backup) v1-6) + (set! v0-0 (logior (enemy-flag check-water) v1-6)) + (set! v0-0 (logclear v1-6 (enemy-flag check-water))) + ) + ) + (set! (-> self enemy-flags) v0-0) + ) + :code sleep-code + :post nav-enemy-simple-post + ) diff --git a/goal_src/jak3/levels/common/ai/bot.gc b/goal_src/jak3/levels/common/ai/bot.gc index 4b16f292e3..268b98ca91 100644 --- a/goal_src/jak3/levels/common/ai/bot.gc +++ b/goal_src/jak3/levels/common/ai/bot.gc @@ -7,3 +7,1919 @@ ;; DECOMP BEGINS +(defmethod run-logic? ((this bot)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defmethod debug-draw-spot ((this bot) (arg0 bot-spot) (arg1 rgba)) + (add-debug-sphere #t (bucket-id debug) (-> arg0 center) (-> arg0 center w) arg1) + ) + +(defmethod bot-method-198 ((this bot) (arg0 int) (arg1 (pointer uint8)) (arg2 int)) + (let* ((s2-0 (-> this spot-color)) + (s1-0 s2-0) + ) + (if (>= arg2 0) + (set! s1-0 (logior (logand (the-as uint #xffffff) s2-0) + (shl (the-as uint (the int (* 0.375 (the float (logand (shr s2-0 24) 255))))) 24) + ) + ) + ) + (dotimes (s0-0 arg0) + (let* ((v1-5 (-> arg1 s0-0)) + (a1-2 (-> this course spots v1-5)) + ) + (debug-draw-spot this a1-2 (if (= v1-5 arg2) + (the-as rgba s2-0) + (the-as rgba s1-0) + ) + ) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-196 ((this bot)) + (let ((s5-0 (-> this course))) + (countdown (s4-0 (-> s5-0 spot-count)) + (let ((s3-0 (-> s5-0 spots s4-0))) + (debug-draw-spot this s3-0 (the-as rgba (-> this spot-color))) + (format (clear *temp-string*) "~d" s4-0) + (let ((a2-2 *temp-string*)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + a2-2 + (-> s3-0 center) + (font-color white) + (the-as vector2h #f) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod outside-spot-radius? ((this bot) (arg0 bot-spot) (arg1 vector) (arg2 symbol)) + (if (not arg0) + (set! arg0 (-> this spot)) + ) + (if (not arg1) + (set! arg1 (-> this root trans)) + ) + (let ((f0-0 (vector-vector-xz-distance (-> arg0 center) arg1))) + (if arg2 + (set! f0-0 (+ 819.2 f0-0)) + ) + (>= (-> arg0 center w) f0-0) + ) + ) + +(defmethod player-blocking-spot? ((this bot) (arg0 bot-spot)) + (let ((f0-0 (-> arg0 blocked-xz-dist))) + (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 center)))) + ) + ) + +(defmethod choose-spot ((this bot) (arg0 int) (arg1 (pointer uint8))) + (let ((gp-0 0)) + (let ((f30-0 -1.0) + (s3-0 (-> this root trans)) + ) + (countdown (s2-0 arg0) + (let ((s1-0 (-> this course spots (-> arg1 s2-0)))) + (when (not (player-blocking-spot? this s1-0)) + (let ((f0-0 (vector-vector-xz-distance s3-0 (-> s1-0 center)))) + (when (or (< f30-0 0.0) (< f0-0 f30-0)) + (set! f30-0 f0-0) + (set! gp-0 s2-0) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +(defmethod send-attack-to-all-tshapes ((this bot) (arg0 process-focusable) (arg1 event-message-block)) + 0 + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-199 ((this bot)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) + (v1-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (and v1-5 (= (-> v1-5 type) target)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + (none) + ) + +(defmethod bot-method-205 ((this bot)) + (let ((gp-0 #f)) + (let ((v1-0 (-> this incoming penetrate-using))) + (cond + ((logtest? (penetrate jak-red-shot) v1-0) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (-> *target* gun fire-dir-out)) + ) + (vector-! s5-0 (-> this root trans) (target-pos 0)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (if (or (< 28672.0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) + (< (vector-dot s3-0 s5-0) (cos 3640.889)) + ) + (set! gp-0 #t) + ) + ) + ) + ) + ((and (logtest? (penetrate dark-skin) v1-0) (not (logtest? (penetrate dark-punch) v1-0))) + (set! gp-0 #t) + ) + ) + ) + gp-0 + ) + ) + +(defmethod bot-method-202 ((this bot)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (cond + ((< 0.0 (-> this notice-enemy-dist)) + (let ((s5-0 (new 'stack-no-clear 'connection-pers)) + (cspec (collide-spec enemy hit-by-others-list)) + ) + (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> this root trans quad)) + (set! (-> s5-0 param 3) (-> this notice-enemy-dist)) + (set! (-> s5-0 next) #f) + (set! (-> s5-0 key) 409600000.0) + (set! (-> s5-0 update-time) 0) + (set! *actor-list-length* 0) + (if (logtest? (the-as int cspec) (collide-spec hit-by-others-list)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as vector (-> s5-0 param)) *actor-list* 256) + ) + ) + (when (logtest? (the-as int cspec) (collide-spec player-list)) + (let ((a0-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-1 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as int cspec) (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-1) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-3 a2-5) + (f1-2 (+ (-> a1-2 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-3 (* f1-2 f1-2)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? (the-as int cspec) (collide-spec hit-by-player-list)) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as int cspec) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-2) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-4 a2-12) + (f1-6 (+ (-> a1-14 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-4 (* f1-6 f1-6)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let ((v1-26 (-> *actor-list* s3-0))) + (when (logtest? (the-as int cspec) (-> v1-26 root-prim prim-core collide-as)) + (let* ((s2-0 (-> v1-26 process)) + (a1-26 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when a1-26 + (set-next-focus! this (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) + (if (-> s5-0 next) + (return #t) + ) + ) + ) + ) + ) + ) + ) + #f + ) + (else + #f + ) + ) + ) + ) + +(defmethod get-incoming-attack! ((this bot) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + (let ((t9-0 (method-of-type nav-enemy get-incoming-attack!))) + (t9-0 this arg0 arg1 arg2 arg3 arg4) + ) + (logclear! (-> this bot-flags) (bot-flag bf03 bf04)) + (let* ((s3-0 (handle->process (-> this incoming attacker-handle))) + (s5-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s5-0 + (cond + ((= (-> s5-0 type) target) + (logior! (-> this bot-flags) (bot-flag bf04)) + (cond + ((bot-method-205 this) + (logior! (-> this bot-flags) (bot-flag bf03)) + ) + (else + (+! (-> this hit-by-player-count) 1) + (when (not (bot-method-202 this)) + (logior! (-> this bot-flags) (bot-flag attacked)) + (cond + ((attacked-by-player? this (the-as process-focusable s5-0)) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) + ) + (else + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + ) + ) + ) + ) + ((type? s5-0 enemy) + (+! (-> this hit-by-enemy-count) 1) + (when (attacked-by-player? this (the-as process-focusable s5-0)) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (bot-method-199 this) + ) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) + ) + ) + ) + ) + ) + (none) + ) + +(defmethod get-damage-from-attack ((this bot) (arg0 object) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) + (v0-0 (t9-0 this arg0 arg1)) + (v1-1 (-> this bot-flags)) + ) + (cond + ((logtest? v1-1 (bot-flag bf03 too-far-fail bf09)) + 0.0 + ) + ((logtest? v1-1 (bot-flag bf10)) + (-> this hit-points) + ) + (else + (if (and (logtest? (-> this bot-flags) (bot-flag bf04)) (not (logtest? (-> this bot-flags) (bot-flag attacked)))) + (set! v0-0 0.0) + ) + v0-0 + ) + ) + ) + ) + +(defmethod penetrate->next-state ((this bot)) + (let* ((t9-0 (method-of-type nav-enemy penetrate->next-state)) + (v0-0 (t9-0 this)) + ) + (if (logtest? (-> this bot-flags) (bot-flag bf03)) + (set! v0-0 #f) + ) + v0-0 + ) + ) + +(defmethod clear-poi ((this bot)) + (let* ((s4-0 (handle->process (-> this poi-handle))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-0 + (set! (-> this poi-handle) (the-as handle #f)) + (let ((s4-1 (handle->process (-> this focus handle)))) + (if (= (if (type? s4-1 process-focusable) + s4-1 + ) + s5-0 + ) + (clear-focused (-> this focus)) + ) + ) + ) + ) + (none) + ) + +(defmethod attacked-by-player? ((this bot) (arg0 process-focusable)) + (and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) + (or (logtest? (process-mask enemy) (-> arg0 mask)) + (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flag attacked))) + ) + ) + ) + +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod update-awareness! ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) + (the-as enemy-aware 3) + ) + +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod get-enemy-aware ((this bot) (arg0 enemy-aware)) + (the-as enemy-aware 3) + ) + +;; WARN: Return type mismatch object vs process. +(defmethod update-focus ((this bot)) + (local-vars (s5-1 process)) + (let ((s5-0 (-> this focus))) + (cond + ((logtest? (enemy-flag lock-focus) (-> this enemy-flags)) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + (else + (find-best-focus this) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + ) + ) + (let ((s4-0 #f)) + (when (or (logtest? (bot-flag bf18) (-> this bot-flags)) + (and (the-as process-focusable s5-1) (attacked-by-player? this (the-as process-focusable s5-1))) + ) + (set-time! (-> this danger-time)) + (set! s4-0 #t) + ) + (the-as + process + (when (nonzero? (-> this swivel-joint-mod)) + (if (and s4-0 (the-as process-focusable s5-1) (logtest? (-> this bot-flags) (bot-flag bf11))) + (bot-method-234 this (get-trans (the-as process-focusable s5-1) 3)) + (bot-method-233 this) + ) + ) + ) + ) + ) + +(defmethod find-best-focus ((this bot)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> this bot-flags) (bot-flag attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) + ) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (bot-method-199 this) + ) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (time-elapsed? (-> this attacker-time) (seconds 6)) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> this focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + (else + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + s5-1 + ) + ) + ) + +(defmethod bot-method-201 ((this bot)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((s4-0 544) + (gp-0 (new 'stack-no-clear 'enemy-best-focus)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (f0-0 (-> this notice-enemy-dist)) + ) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 rating) 409600000.0) + (set! (-> gp-0 aware) (enemy-aware ea0)) + (when (< 0.0 f0-0) + (set! (-> s3-0 quad) (-> this root trans quad)) + (set! (-> s3-0 w) (-> this notice-enemy-dist)) + (set! *actor-list-length* 0) + (if (logtest? s4-0 512) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* s3-0 *actor-list* 256)) + ) + (when (logtest? s4-0 1024) + (let ((a0-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-14 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-1 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 s3-0) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-2 a2-5) + (f1-3 (+ (-> a1-2 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-2 (* f1-3 f1-3)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-14) + *collide-player-list* + (set! v1-14 (-> v1-14 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 256) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-22 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 s3-0) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-3 a2-12) + (f1-7 (+ (-> a1-14 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-3 (* f1-7 f1-7)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-22) + *collide-hit-by-player-list* + (set! v1-22 (-> v1-22 next0)) + ) + ) + ) + ) + (dotimes (s3-1 *actor-list-length*) + (let ((v1-27 (-> *actor-list* s3-1))) + (when (logtest? (the-as collide-spec s4-0) (-> v1-27 root-prim prim-core collide-as)) + (let* ((s2-0 (-> v1-27 process)) + (a1-26 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (if (and a1-26 + a1-26 + (not (logtest? (-> (the-as process-focusable a1-26) focus-status) (focus-status disable dead))) + ) + (set-next-focus! this (the-as enemy a1-26) gp-0) + ) + ) + ) + ) + ) + ) + ) + (-> gp-0 proc) + ) + ) + ) + +(defmethod set-next-focus! ((this bot) (arg0 enemy) (arg1 enemy-best-focus)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 (-> arg0 root trans) (-> this root trans)) + (let ((f0-0 (vector-length v1-0))) + (when (and (>= (-> this notice-enemy-dist) f0-0) (< f0-0 (-> arg1 rating)) (>= 24576.0 (fabs (-> v1-0 y)))) + (set! (-> arg1 rating) f0-0) + (set! (-> arg1 proc) arg0) + arg0 + ) + ) + ) + ) + +(defmethod alive? ((this bot)) + (and (not (focus-test? this dead grabbed)) (and (!= (-> this hit-points) 0.0) (zero? (-> this fated-time)))) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this bot)) + (the-as search-info-flag 0) + ) + +;; WARN: disable def twice: 272. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('combo) + #f + ) + (('query) + (case (-> arg3 param 0) + (('waypoint) + (-> this waypoint waypoint-id) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('request) + (case (-> arg3 param 0) + (('waypoint) + (set! (-> this waypoint-request) (the-as int (-> arg3 param 1))) + #t + ) + (('health-meter) + (cond + ((-> arg3 param 1) + (set! v0-0 (logior (-> this bot-flags) (bot-flag bf06))) + (set! (-> this bot-flags) (the-as bot-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> this bot-flags) (bot-flag bf06))) + (set! (-> this bot-flags) (the-as bot-flag v0-0)) + ) + ) + v0-0 + ) + (('too-far-fail) + (when (not (logtest? (-> this bot-flags) (bot-flag too-far-fail bf09))) + (logior! (-> this bot-flags) (bot-flag bf09)) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (go (method-of-object this failed)) + ) + ) + (('move-to-vehicle) + (let ((a0-17 (the-as object (-> arg3 param 2)))) + (cond + ((>= (the-as int a0-17) 0) + (let ((v1-27 (the-as object (-> arg3 param 1)))) + (cond + ((focus-test? this pilot) + (if (= (-> this vehicle-seat-index) (the-as uint a0-17)) + (= (the-as uint v1-27) (handle->process (-> this vehicle-handle))) + ) + ) + (else + (set! (-> this vehicle-seat-index) (the-as int a0-17)) + (set! (-> this vehicle-handle) (process->handle (the-as uint v1-27))) + (logior! (-> this bot-flags) (bot-flag bf15)) + #t + ) + ) + ) + ) + (else + (when (not (focus-test? this pilot)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logclear! (-> this bot-flags) (bot-flag bf15)) + #t + ) + ) + ) + ) + ) + (('exit-vehicle) + (when (focus-test? this pilot) + (let ((v1-41 (-> arg3 param 1)) + (s5-1 (-> arg3 param 2)) + ) + (cond + (v1-41 + (logior! (-> this bot-flags) (bot-flag bf16)) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> this nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor (the-as int s5-1)) this) + (set! (-> this nav-mesh-index) (the-as int s5-1)) + ) + ) + (else + (logclear! (-> this bot-flags) (bot-flag bf16)) + ) + ) + ) + #t + ) + ) + (('slave-id) + (set! (-> this slave-id) (the-as int (-> arg3 param 1))) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('notify) + (case (-> arg3 param 0) + (('attack) + (let ((s5-2 (-> arg3 param 1))) + (when (if (type? s5-2 process-focusable) + s5-2 + ) + (logior! (-> this enemy-flags) (enemy-flag victory)) + (set-time! (-> this hit-focus-time)) + ) + ) + #t + ) + (('mission-failed) + (logior! (-> this bot-flags) (bot-flag bf09)) + (logclear! (-> this bot-flags) (bot-flag bf06)) + #t + ) + (('follow-dir) + (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('set-task) + (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> this bot-task-bits) (ash 1 a1-11)) + ) + #t + ) + (('clear-task) + (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> this bot-task-bits) (ash 1 a1-13)) + ) + #t + ) + (('skip) + (skip-waypoint this) + ) + (('change-mode) + (when (= (-> arg3 param 0) 'grab) + (set! v0-0 (alive? this)) + (if (and (the-as symbol v0-0) (-> arg3 param 1)) + (logior! (-> this focus-status) (focus-status grabbed)) + ) + v0-0 + ) + ) + (('end-mode) + (case (-> arg3 param 0) + (('grab) + (when (focus-test? this grabbed) + (logclear! (-> this focus-status) (focus-status grabbed)) + #t + ) + ) + ) + ) + (('hide) + (cond + ((-> arg3 param 0) + (go (method-of-object this hidden)) + ) + (else + (if (and (-> this next-state) (= (-> this next-state name) 'hidden)) + (go-best-state this) + ) + ) + ) + ) + (('draw) + (cond + ((-> arg3 param 0) + (set! v0-0 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + ) + (else + (set! v0-0 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod send-attack ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (cond + ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flag attacked)))) + (when (send-event arg0 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 0.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 2)) + (shove-up (meters 1.5)) + ) + ) + ) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (reset-penetrate! this) + #t + ) + ) + (else + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info :mask (vehicle-impulse-factor) ((id arg2) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (-> this enemy-info attack-shove-back)) + (shove-up (-> this enemy-info attack-shove-up)) + (mode (-> this enemy-info attack-mode)) + ) + ) + ) + (on-attack this (the-as process-focusable arg0)) + #t + ) + ) + ) + ) + +(defmethod send-attack-on-jump-or-knocked ((this bot) (arg0 process) (arg1 event-message-block)) + (cond + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy) (-> arg0 mask)) + (and v1-6 + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +(defun bot-simple-check-too-far ((arg0 bot)) + (let ((s5-0 0)) + (let ((f0-0 (vector-vector-xz-distance (-> *target* control trans) (-> arg0 root trans))) + (f1-0 (-> arg0 too-far-warn-dist)) + ) + (when (>= f0-0 f1-0) + (if (>= (- f0-0 f1-0) (-> arg0 too-far-fail-dist-delta)) + (set! s5-0 2) + (set! s5-0 1) + ) + ) + ) + s5-0 + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-216 ((this bot)) + (when (not (channel-active? this (gui-channel none))) + (let ((a1-2 (get-next-speech-idx + (-> this course too-far-warn-speeches) + this + (-> this course speeches) + (bot-speech-info-flag) + ) + ) + ) + (when (>= a1-2 0) + (play-speech-by-id this a1-2) + #t + ) + ) + ) + (none) + ) + +(defun bot-check-too-far-always-okay () + 0 + ) + +(defmethod bot-check-too-far ((this bot)) + (let ((gp-0 0)) + (let ((v1-0 (-> this delay-too-far-check))) + (cond + ((> v1-0 0) + (set! (-> this delay-too-far-check) (+ v1-0 -1)) + ) + ((and (zero? v1-0) *target* (not (logtest? (-> this focus-status) (focus-status grabbed)))) + (let ((t9-0 (the-as object (-> this waypoint check-too-far)))) + (if (not (the-as symbol t9-0)) + (set! t9-0 (-> this course default-check-too-far)) + ) + (when (the-as symbol t9-0) + (cond + ((logtest? (the-as int t9-0) 1) + (set! gp-0 ((the-as (function bot int) (-> (the-as symbol t9-0) value)) this)) + ) + ((= (rtype-of (the-as symbol t9-0)) function) + (set! gp-0 ((the-as (function bot int) t9-0) this)) + ) + ) + ) + ) + (if (and (= gp-0 1) + (nonzero? (-> this started-warning-time)) + (time-elapsed? (-> this started-warning-time) (the-as time-frame (-> this warn-to-fail-timeout))) + ) + (set! gp-0 2) + ) + (case gp-0 + ((1) + (if (zero? (-> this started-warning-time)) + (set-time! (-> this started-warning-time)) + ) + (if (and (>= (current-time) (-> this next-too-far-warn-time)) (bot-method-216 this)) + (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + this + (the-as time-frame (-> this warn-min-delay)) + (the-as time-frame (-> this warn-max-delay)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (when (zero? gp-0) + (set! (-> this started-warning-time) 0) + 0 + ) + (= gp-0 2) + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod reset-warn-time ((this bot)) + (set! (-> this started-warning-time) 0) + (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + this + (the-as time-frame (-> this warn-min-delay)) + (the-as time-frame (-> this warn-max-delay)) + ) + ) + ) + (none) + ) + +(defmethod enemy-common-post ((this bot)) + (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) + (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) + (let ((f0-3 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) + (if (nonzero? (-> this fated-time)) + (set! f0-3 0.0) + ) + (set! (-> *game-info* bot-health (-> this bot-health-index)) f0-3) + ) + (cond + ((logtest? (-> this bot-flags) (bot-flag bf06)) + (if (and (not (handle->process (-> this health-handle))) *target*) + (bot-method-228 this) + ) + ) + (else + (send-event (handle->process (-> this health-handle)) 'hide-and-die) + ) + ) + (when (not (nav-enemy-method-185 this)) + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options)) + (set! (-> a1-2 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-2) + ) + ) + (let ((t9-5 (method-of-type nav-enemy enemy-common-post))) + (t9-5 this) + ) + (when (not (logtest? (-> this bot-flags) (bot-flag bf09))) + (let ((t9-6 (-> this waypoint on-update))) + (if t9-6 + (t9-6 this) + ) + ) + ) + (if (and (bot-check-too-far this) (not (logtest? (-> this bot-flags) (bot-flag bf09)))) + (go (method-of-object this failed)) + ) + (if (not (logtest? (-> this bot-flags) (bot-flag bf09))) + (ai-task-control-method-10 (-> this ai-ctrl) this) + ) + (if (logtest? (-> this bot-flags) (bot-flag bf02)) + (bot-method-204 this) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc08)) + (bot-method-196 this) + ) + (none) + ) + +(defmethod scene-play ((this bot) (arg0 scene) (arg1 symbol)) + (when (and (process-grab? this #t) (or arg1 (process-grab? *target* #t))) + (process-grab? this #f) + (if (not arg1) + (process-grab? *target* #f) + ) + (set! (-> this scene-player-handle) + (ppointer->handle (process-spawn scene-player :init scene-player-init arg0 #t #f :name "scene-player")) + ) + #t + ) + ) + +(defmethod scene-stop ((this bot)) + (when (not (handle->process (-> this scene-player-handle))) + (process-release? this) + #t + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-223 ((this bot)) + (let ((v1-1 (-> this course speeches))) + (countdown (a0-2 (-> this course speech-count)) + (let ((a1-1 (-> v1-1 a0-2))) + (logclear! (-> a1-1 flags) (bot-speech-info-flag playing)) + ) + ) + ) + (none) + ) + +(defmethod play-speech-by-id ((this bot) (arg0 int)) + (let* ((gp-0 (-> this course)) + (s5-0 (-> gp-0 speeches arg0)) + ) + (logior! (-> s5-0 flags) (bot-speech-info-flag playing)) + (let* ((t2-0 (-> s5-0 hold-time)) + (a1-4 + (add-process + *gui-control* + this + (-> this channel) + (gui-action play) + (-> s5-0 name) + -99.0 + (the-as time-frame t2-0) + ) + ) + (v1-5 (-> gp-0 speech-tunings (-> s5-0 tuning-id))) + ) + (sound-params-set! + *gui-control* + a1-4 + (-> v1-5 trans?) + (-> v1-5 fo-min) + (-> v1-5 fo-max) + (-> v1-5 fo-curve) + -1.0 + ) + ) + ) + ) + +(defmethod play-speech-by-name ((this bot) (arg0 string)) + (add-process *gui-control* this (-> this channel) (gui-action play) arg0 -99.0 (seconds 0.3)) + ) + +(defmethod course-speech-ended? ((this bot) (arg0 int)) + (let ((v1-2 (-> this course speeches arg0))) + (= (get-status + *gui-control* + (lookup-gui-connection-id *gui-control* (-> v1-2 name) (gui-channel none) (gui-action none)) + ) + (gui-status unknown) + ) + ) + ) + +(defmethod course-speech-playing? ((this bot) (arg0 int)) + (let ((v1-2 (-> this course speeches arg0))) + (logtest? (-> v1-2 flags) (bot-speech-info-flag playing)) + ) + ) + +(defmethod channel-active? ((this bot) (arg0 gui-channel)) + (if (= arg0 (gui-channel none)) + (set! arg0 (-> this channel)) + ) + (nonzero? (get-status *gui-control* (lookup-gui-connection-id *gui-control* (the-as string #f) arg0 (gui-action none))) + ) + ) + +(defmethod bot-method-232 ((this bot) (arg0 gui-channel) (arg1 symbol)) + (if (= arg0 (gui-channel none)) + (set! arg0 (-> this channel)) + ) + (if arg1 + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + arg0 + (gui-action none) + (the-as string #f) + (lambda :behavior bot + ((arg0 gui-connection)) + (let* ((v1-0 self) + (s5-0 (-> v1-0 course speeches)) + ) + (countdown (s4-0 (-> v1-0 course speech-count)) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= (-> s3-0 name) (-> arg0 name)) + (return (not (logtest? (-> s3-0 flags) (bot-speech-info-flag sf01)))) + ) + ) + ) + ) + #t + ) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + arg0 + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + +(defmethod go-to-waypoint! ((this bot) (arg0 int) (arg1 symbol)) + (let* ((v1-0 (-> this course)) + (a0-2 (-> v1-0 waypoints length)) + ) + (dotimes (a2-1 a0-2) + (let ((s4-0 (-> v1-0 waypoints a2-1))) + (when (= (-> s4-0 waypoint-id) arg0) + (set! (-> this waypoint) s4-0) + (set! (-> this waypoint-bits) (waypoint-bits)) + (set-time! (-> this waypoint-time0)) + (set! (-> this too-far-warn-dist) (-> this too-far-warn-dist-default)) + (set! (-> this too-far-fail-dist-delta) (-> this too-far-fail-dist-delta-default)) + (let ((s3-0 (-> s4-0 nav-mesh-index))) + (when (and (>= s3-0 0) (!= (-> this nav-mesh-index) s3-0)) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor s3-0) this) + (set! (-> this nav-mesh-index) s3-0) + ) + ) + (when arg1 + (let ((s5-1 (-> s4-0 on-skipping-here))) + (when s5-1 + (process-entity-status! this (entity-perm-status no-kill) #t) + (s5-1 this) + ) + ) + ) + (let ((t9-4 (-> s4-0 on-set))) + (if t9-4 + (t9-4 this) + ) + ) + (return #f) + ) + ) + ) + ) + (go process-drawable-art-error "bad waypoint id") + ) + +(defmethod skip-waypoint ((this bot)) + (let ((s5-0 (-> this waypoint skip-to))) + (when (>= s5-0 0) + (bot-method-232 this (gui-channel none) #f) + (set! (-> this delay-too-far-check) 10) + (go-to-waypoint! this s5-0 #t) + ) + ) + ) + +;; WARN: Return type mismatch nav-enemy vs bot. +(defmethod relocate ((this bot) (offset int)) + (if (nonzero? (-> this ai-ctrl)) + (&+! (-> this ai-ctrl) offset) + ) + (if (nonzero? (-> this task)) + (&+! (-> this task) offset) + ) + (if (nonzero? (-> this swivel-joint-mod)) + (&+! (-> this swivel-joint-mod) offset) + ) + (the-as bot ((method-of-type nav-enemy relocate) this offset)) + ) + +(defmethod deactivate ((this bot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> this health-handle)) 'hide-and-die) + (if (nonzero? (-> this ai-ctrl)) + (ai-task-control-method-9 (-> this ai-ctrl)) + ) + ((method-of-type nav-enemy deactivate) this) + (none) + ) + +(defmethod init-fields! ((this bot)) + (set! (-> this master-handle) (the-as handle #f)) + (set! (-> this health-handle) (the-as handle #f)) + (set! (-> this scene-player-handle) (the-as handle #f)) + (set! (-> this poi-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this focus-mode) 0) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 180)) + (set! (-> this warn-to-fail-timeout) (the-as uint #x34bc)) + (set! (-> this warn-min-delay) (the-as uint 2400)) + (set! (-> this warn-max-delay) (the-as uint 4200)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this nav-mesh-index) -1) + (set! (-> this too-far-warn-dist-default) 184320.0) + (set! (-> this too-far-fail-dist-delta-default) 122880.0) + (logior! (-> this bot-flags) (bot-flag bf11)) + (set! (-> this delay-too-far-check) 10) + (set! (-> this focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> this spot-color) (the-as uint #x500000ff)) + (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) + 0 + (none) + ) + +(defmethod init-enemy! ((this bot)) + (process-entity-status! this (entity-perm-status bit-4) #t) + (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode dislike-combo)) + (logclear! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (logior! (-> this focus-status) (focus-status disable)) + (let ((v1-11 (-> this nav))) + (set! (-> v1-11 sphere-mask) (the-as uint 78)) + ) + 0 + (logclear! (-> this root nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((a2-3 (res-lump-value (-> this entity) 'task-actor uint128 :time -1000000000.0))) + (if (nonzero? a2-3) + (set! (-> this task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) + ) + ) + (set! (-> this task-node) (task-node-by-name (the-as string ((method-of-type res-lump get-property-struct) + (-> this entity) + 'task-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (let ((s5-1 (res-lump-value (-> this entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0)) + ) + (if (< (the-as int s5-1) 0) + (go process-drawable-art-error "no course") + ) + (let ((s5-2 (-> *bot-course-table* course s5-1))) + (set! (-> this course) s5-2) + (+! (-> s5-2 retry-cookie) 1) + (mem-copy! (the-as pointer (-> this spot)) (the-as pointer (-> s5-2 spots 0)) 20) + (let ((v1-35 (-> s5-2 waypoints 0))) + (set! (-> this nav-mesh-index) (-> v1-35 nav-mesh-index)) + (go-to-waypoint! this (-> v1-35 waypoint-id) #f) + ) + ) + ) + 0 + (none) + ) + +(defmethod bot-method-226 ((this bot)) + (when (logtest? (-> this bot-flags) (bot-flag bf00)) + (let ((a1-0 (handle->process (-> this focus handle)))) + (and a1-0 + (= (-> this focus aware) (enemy-aware ea3)) + (attacked-by-player? this (the-as process-focusable a1-0)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) + ) + ) + ) + ) + +(defmethod bot-method-235 ((this bot) (arg0 symbol)) + (let ((gp-0 (-> this focus-info)) + (v1-1 (current-time)) + (s3-0 (handle->process (-> this focus handle))) + ) + (when (or (!= v1-1 (-> gp-0 update-time)) (!= (the-as process-focusable s3-0) (-> gp-0 fproc))) + (set! (-> gp-0 update-time) v1-1) + (set! (-> gp-0 fproc) (the-as process-focusable s3-0)) + (set! (-> gp-0 los) 0) + (when (the-as process-focusable s3-0) + (set! (-> gp-0 pos quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) + (set! (-> gp-0 bullseye quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (vector-z-quaternion! (-> gp-0 my-facing-xz-dir) (-> this root quat)) + (set! (-> gp-0 my-facing-xz-dir y) 0.0) + (vector-normalize! (-> gp-0 my-facing-xz-dir) 1.0) + (set! (-> gp-0 my-facing-ry) (atan (-> gp-0 my-facing-xz-dir x) (-> gp-0 my-facing-xz-dir z))) + (vector-! (-> gp-0 bullseye-xz-dir) (-> gp-0 bullseye) (-> this root trans)) + (let ((v1-11 (-> gp-0 bullseye-xz-dir))) + (set! (-> gp-0 bullseye-xz-dist) (sqrtf (+ (* (-> v1-11 x) (-> v1-11 x)) (* (-> v1-11 z) (-> v1-11 z))))) + ) + (set! (-> gp-0 bullseye-xz-dir y) 0.0) + (vector-normalize! (-> gp-0 bullseye-xz-dir) 1.0) + (set! (-> gp-0 bullseye-ry) (atan (-> gp-0 bullseye-xz-dir x) (-> gp-0 bullseye-xz-dir z))) + (set! (-> gp-0 ry-diff) (deg- (-> gp-0 bullseye-ry) (-> gp-0 my-facing-ry))) + ) + ) + (when (and arg0 s3-0 (zero? (-> gp-0 los))) + (let ((s4-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-1 start-pos quad) (-> this root trans quad)) + (+! (-> s4-1 start-pos y) 8192.0) + (vector-! (-> s4-1 move-dist) (-> gp-0 bullseye) (-> s4-1 start-pos)) + (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> s4-1 move-dist)))))) + (cond + ((< f0-19 (-> gp-0 max-los-dist)) + (vector-normalize! (-> s4-1 move-dist) f0-19) + (let ((v1-23 s4-1)) + (set! (-> v1-23 radius) 2048.0) + (set! (-> v1-23 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-23 ignore-process0) this) + (set! (-> v1-23 ignore-process1) #f) + (set! (-> v1-23 ignore-pat) (-> this root pat-ignore-mask)) + (set! (-> v1-23 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* s4-1) 0.0) + (set! (-> gp-0 los) 3) + 0 + ) + (else + (let ((s3-3 1)) + (when (not (logtest? (-> this bot-flags) (bot-flag attacked))) + (let ((a0-31 *target*)) + (when a0-31 + (vector+! (-> s4-1 move-dist) (-> s4-1 move-dist) (-> s4-1 start-pos)) + (if (>= 16384.0 (vector-segment-distance-point! + (get-trans a0-31 3) + (-> s4-1 start-pos) + (-> s4-1 move-dist) + (the-as vector #f) + ) + ) + (set! s3-3 4) + ) + ) + ) + ) + (set! (-> gp-0 los) s3-3) + ) + ) + ) + ) + (else + (set! (-> gp-0 los) 2) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod bot-method-194 ((this bot) (arg0 bot-turn-info) (arg1 process-focusable) (arg2 float)) + (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 (-> this root))) + (quaternion-copy! (-> arg0 src-quat) (-> s5-0 quat)) + (vector-z-quaternion! (-> arg0 facing-dir) (-> s5-0 quat)) + (set! (-> arg0 facing-ry) (atan (-> arg0 facing-dir x) (-> arg0 facing-dir z))) + (set! (-> arg0 targ-pos quad) (-> (get-trans arg1 3) quad)) + (set! (-> arg0 targ-ry) + (atan (- (-> arg0 targ-pos x) (-> s5-0 trans x)) (- (-> arg0 targ-pos z) (-> s5-0 trans z))) + ) + (let ((a0-7 (get-transv arg1)) + (a1-6 (-> arg0 predicted-targ-pos)) + ) + (let ((v1-4 (-> arg0 targ-pos))) + (let ((a2-1 arg2)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-7 quad)) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-6 quad) vf6) + ) + (set! (-> arg0 predicted-targ-ry) (atan + (- (-> arg0 predicted-targ-pos x) (-> s5-0 trans x)) + (- (-> arg0 predicted-targ-pos z) (-> s5-0 trans z)) + ) + ) + ) + (set! (-> arg0 ry-diff) (deg- (-> arg0 targ-ry) (-> arg0 facing-ry))) + (set! (-> arg0 predicted-ry-diff) (deg- (-> arg0 predicted-targ-ry) (-> arg0 facing-ry))) + ) + ) + +(defmethod bot-method-220 ((this bot)) + (let ((s5-0 #f)) + (when *target* + (let ((a1-0 (-> *target* control trans)) + (v1-4 (-> this root)) + (f0-0 14336.0) + ) + (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> v1-4 trans) a1-0)) + (let ((v1-8 (-> *target* control transv))) + (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) + (if (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere)) + (set! s5-0 #t) + ) + ) + ) + ) + ) + ) + (let* ((f0-8 (-> this player-blocking)) + (f0-10 (if s5-0 + (seek f0-8 1.0 (seconds-per-frame)) + (seek f0-8 0.0 (seconds-per-frame)) + ) + ) + ) + (set! (-> this player-blocking) f0-10) + (= f0-10 1.0) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs object. +(defmethod enemy-method-91 ((this bot) (arg0 enemy-jump-info)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x10006a) + ) + ) + +(defmethod bot-method-234 ((this bot) (arg0 vector)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> this root trans quad)) + (+! (-> v1-0 y) 9216.0) + (vector-! s1-0 arg0 v1-0) + (vector-normalize! s1-0 1.0) + (vector-z-quaternion! s2-0 (-> this root quat)) + (rot-zxy-from-vector! s4-0 s2-0) + (rot-zxy-from-vector! s3-0 s1-0) + (set! (-> s5-0 x) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 x) (-> s4-0 x))))) + (set! (-> s5-0 y) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 y) (-> s4-0 y))))) + (set! (-> s5-0 z) 0.0) + (let ((s4-1 (new 'stack-no-clear 'quaternion))) + (quaternion-zxy! s4-1 s5-0) + (quaternion-pseudo-seek + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + s4-1 + (seconds-per-frame) + ) + ) + ) + 0 + (none) + ) + +(defmethod bot-method-233 ((this bot)) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (quaternion-identity! gp-0) + (quaternion-pseudo-seek + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + gp-0 + (seconds-per-frame) + ) + ) + ) + +(defmethod play-next-speech ((this bot)) + (when (not (channel-active? this (gui-channel none))) + (let ((a1-2 (get-next-speech-idx + (-> this course attack-player-speeches) + this + (-> this course speeches) + (bot-speech-info-flag) + ) + ) + ) + (if (>= a1-2 0) + (play-speech-by-id this a1-2) + ) + ) + ) + ) + +;; WARN: Return type mismatch bot-flag vs none. +(defmethod set-fail-flag ((this bot)) + (logior! (-> this bot-flags) (bot-flag too-far-fail)) + (none) + ) + +;; WARN: Return type mismatch bot-flag vs none. +(defmethod bot-method-209 ((this bot)) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this bot-flags) (bot-flag bf09)) + (let ((s5-0 #t)) + (let ((a0-6 (handle->process (-> this master-handle)))) + (cond + (a0-6 + (if (not (send-event a0-6 'notify 'mission-failed)) + (set! s5-0 #f) + ) + ) + (else + (when (-> this task-node) + (let* ((v1-23 (-> *game-info* sub-task-list (-> this task-node task))) + (v1-25 (if (-> v1-23 manager) + (-> v1-23 manager manager) + (the-as handle #f) + ) + ) + ) + (if v1-25 + (send-event (handle->process v1-25) 'fail) + ) + ) + ) + ) + ) + ) + (if s5-0 + (logior! (-> this bot-flags) (bot-flag failed bf13)) + ) + ) + (none) + ) + +(defmethod bot-method-212 ((this bot)) + (if (logtest? (-> this bot-flags) (bot-flag failed)) + (cam-move-to-bot this) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod cam-move-to-bot ((this bot)) + (cond + ((logtest? (-> this bot-flags) (bot-flag bf13)) + (logclear! (-> this bot-flags) (bot-flag bf13)) + (logior! (-> this bot-flags) (bot-flag bf14)) + (let ((s4-0 (-> this move-dest))) + (set-cam-height this s4-0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 s4-0 (-> this root trans)) + (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) + (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) + (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) + (set-setting! 'string-max-length 'abs f30-0 0) + (set-setting! 'string-min-length 'abs f30-0 0) + ) + ) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + ) + ((logtest? (-> this bot-flags) (bot-flag bf14)) + (logclear! (-> this bot-flags) (bot-flag bf14)) + (send-event *camera* 'change-target this) + (send-event *camera* 'teleport-to-vector-start-string (-> this move-dest)) + ) + ) + (none) + ) + +(defmethod set-cam-height ((this bot) (arg0 vector)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) + ) + ) + +;; WARN: Return type mismatch focus-status vs none. +(defmethod bot-method-203 ((this bot)) + (logior! (-> this bot-flags) (bot-flag bf02)) + (set-time! (-> this hit-invuln-starting-time)) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable)) + (if (nonzero? (-> this hit-invuln-ignore-me-delay)) + (logior! (-> this focus-status) (focus-status ignore)) + ) + (if (nonzero? (-> this hit-invuln-focus-disable-delay)) + (logior! (-> this focus-status) (focus-status disable)) + ) + (none) + ) + +;; WARN: Return type mismatch bot-flag vs none. +(defmethod bot-method-204 ((this bot)) + (local-vars (a2-7 enemy-flag)) + (let ((a1-0 (-> this hit-invuln-starting-time)) + (v1-0 #t) + ) + (if (not (logtest? (-> this enemy-flags) (enemy-flag vulnerable))) + (set! v1-0 (cond + ((time-elapsed? a1-0 (seconds 0.6)) + (let ((a2-6 (-> this enemy-flags))) + (if (logtest? a2-6 (enemy-flag vulnerable-backup)) + (set! a2-7 (logior a2-6 (enemy-flag vulnerable))) + (set! a2-7 (logclear a2-6 (enemy-flag vulnerable))) + ) + ) + (set! (-> this enemy-flags) a2-7) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (focus-test? this ignore) + (set! v1-0 (cond + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-ignore-me-delay))) + (logclear! (-> this focus-status) (focus-status ignore)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (focus-test? this disable) + (set! v1-0 (cond + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-focus-disable-delay))) + (logclear! (-> this focus-status) (focus-status disable)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if v1-0 + (logclear! (-> this bot-flags) (bot-flag bf02)) + ) + ) + (none) + ) + +(defmethod bot-method-228 ((this bot)) + 0 + (none) + ) + +(defmethod coin-flip? ((this bot)) + #f + ) + +(defmethod bot-method-193 ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-1 arg0)) + (let ((v1-10 arg0)) + (let ((a0-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a2-1 f3-7)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t2-1 quad) vf6) + ) + (let ((a2-2 arg0)) + (let ((v1-11 arg0)) + (let ((a0-5 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((a3-2 f1-3)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-2 quad) vf6) + ) + ) + (let ((v1-12 arg0)) + (let ((a0-6 arg0)) + (let ((a1-1 arg3)) + (let ((a2-3 f0-2)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-1 quad)) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-12 quad) vf6) + ) + ) + 0 + (none) + ) + ) diff --git a/goal_src/jak3/levels/common/enemy/hover/hover-nav-control-h.gc b/goal_src/jak3/levels/common/enemy/hover/hover-nav-control-h.gc index 9c31c41f38..5b48ab6079 100644 --- a/goal_src/jak3/levels/common/enemy/hover/hover-nav-control-h.gc +++ b/goal_src/jak3/levels/common/enemy/hover/hover-nav-control-h.gc @@ -169,7 +169,7 @@ ) (:methods (new (symbol type) _type_) - (nav-network-method-9 (_type_ int int) none) + (alloc-nav-network-for-level! (_type_ int int) none) (init-by-other! (_type_ level nav-network-data) none) (nav-network-method-11 (_type_) none) (reset! (_type_) none) diff --git a/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc b/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc index ccd3a6995c..ba3724255a 100644 --- a/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc +++ b/goal_src/jak3/levels/common/enemy/hover/hover-nav-control.gc @@ -87,7 +87,7 @@ ) ) -(defmethod nav-network-method-9 ((this nav-network) (arg0 int) (arg1 int)) +(defmethod alloc-nav-network-for-level! ((this nav-network) (arg0 int) (arg1 int)) (set! (-> this segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level (* 96 arg0)))) (set! (-> this free-segment-list) #f) (dotimes (v1-1 64) @@ -1406,8 +1406,8 @@ (defmethod hover-nav-control-method-10 ((this hover-nav-control) (arg0 vector) (arg1 vector) (arg2 vector)) (set! (-> this dest-pos quad) (-> arg0 quad)) (cond - (arg2 - (set! (-> this dest-vel quad) (-> arg2 quad)) + ;; og:preserve-this condition has been changed from `arg2` because some places call this method with #t as arg2 + ((and (!= arg2 #t) arg2) ; arg2 (set! (-> this root transv quad) (-> arg2 quad)) ) (else diff --git a/goal_src/jak3/levels/desert/des-bbush-tasks.gc b/goal_src/jak3/levels/desert/des-bbush-tasks.gc index 878329bac3..65b2cde6b9 100644 --- a/goal_src/jak3/levels/desert/des-bbush-tasks.gc +++ b/goal_src/jak3/levels/desert/des-bbush-tasks.gc @@ -7,3 +7,761 @@ ;; DECOMP BEGINS +(deftype hud-wasbbv-goal (hud) + () + ) + + +(deftype hud-wasbbv-score (hud) + () + ) + + +(deftype hud-wasbbv-counter (hud) + () + ) + + +(deftype wasbbv-hud-info (structure) + ((goal float) + (score float) + (current float) + (goal-cup uint8) + (goal-text text-id) + (score-text text-id) + (decimal-place-count int8) + ) + ) + + +(define *wasbbv-hud-info* (new 'static 'wasbbv-hud-info)) + +(defmethod draw ((this hud-wasbbv-goal)) + (local-vars (v1-7 int) (s5-0 int)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ (* -130.0 (-> this offset)) (* 65.0 (-> *video-params* relative-x-scale)))) + 70 + ) + 0 + 1 + (case (-> *wasbbv-hud-info* goal-cup) + ((1) + (set! s5-0 313) + (set! v1-7 3) + ) + ((2) + (set! s5-0 312) + (set! v1-7 8) + ) + ((3) + (set! s5-0 311) + (set! v1-7 5) + ) + (else + (set! s5-0 310) + (set! v1-7 1) + ) + ) + (set! (-> this strings 0 color) (the-as font-color v1-7)) + (set! (-> this strings 1 color) (the-as font-color v1-7)) + (let ((s4-0 format) + (s3-0 (clear (-> this strings 1 text))) + (s2-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as text-id s5-0) #f)) + (s4-0 s3-0 s2-0 *temp-string*) + ) + (let ((s4-1 (-> this strings)) + (s5-1 *wasbbv-hud-info*) + ) + (clear (-> s4-1 0 text)) + (let ((t9-7 format) + (a0-15 (-> s4-1 0 text)) + (v1-10 (-> s5-1 decimal-place-count)) + ) + (t9-7 + a0-15 + (cond + ((zero? v1-10) + "~,,0f" + ) + ((= v1-10 1) + "~,,1f" + ) + (else + "~,,2f" + ) + ) + (+ 0.001 (-> s5-1 goal)) + ) + ) + ) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) -40 -40) + (set! (-> this strings 1 scale) 0.65) + (case (-> *setting-control* user-default language) + (((language-enum korean)) + (set! (-> this strings 1 scale) 0.9) + (+! (-> this strings 1 pos y) -5) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-wasbbv-goal)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 flags) (font-flags shadow kerning large)) + (set! (-> this strings 1 color) (font-color red)) + 0 + (none) + ) + +(defmethod draw ((this hud-wasbbv-score)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ (- 512.0 (* 72.0 (-> *video-params* relative-x-scale))) (* 130.0 (-> this offset)))) + 70 + ) + (let ((s4-0 (-> this strings)) + (s5-0 *wasbbv-hud-info*) + ) + (clear (-> s4-0 0 text)) + (let ((t9-2 format) + (a0-3 (-> s4-0 0 text)) + (v1-4 (-> s5-0 decimal-place-count)) + ) + (t9-2 + a0-3 + (cond + ((zero? v1-4) + "~,,0f" + ) + ((= v1-4 1) + "~,,1f" + ) + (else + "~,,2f" + ) + ) + (-> s5-0 score) + ) + ) + ) + (let ((s5-1 format) + (s4-1 (clear (-> this strings 1 text))) + (s3-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (-> *wasbbv-hud-info* score-text) #f)) + (s5-1 s4-1 s3-0 *temp-string*) + ) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 32 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 40 -40) + (let ((v1-9 (-> *setting-control* user-default language))) + (set! (-> this strings 1 scale) + (cond + ((or (= v1-9 (language-enum french)) (or (= v1-9 (language-enum german)) + (= v1-9 (language-enum spanish)) + (= v1-9 (language-enum italian)) + (= v1-9 (language-enum portuguese)) + ) + ) + 0.5 + ) + ((= v1-9 (language-enum korean)) + (+! (-> this strings 1 pos x) -25) + (+! (-> this strings 1 pos y) -5) + 0.9 + ) + (else + 0.5 + ) + ) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-wasbbv-score)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning right large)) + (set! (-> this strings 0 color) (font-color default)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.55) + (set! (-> this strings 1 flags) (font-flags shadow kerning right large)) + (set! (-> this strings 1 color) (font-color default)) + 0 + (none) + ) + +(defmethod draw ((this hud-wasbbv-counter)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ (- 512.0 (* 72.0 (-> *video-params* relative-x-scale))) (* 130.0 (-> this offset)))) + 95 + ) + (let ((s5-0 (-> this strings))) + (let ((s4-0 *wasbbv-hud-info*)) + (clear (-> s5-0 0 text)) + (let ((t9-2 format) + (a0-3 (-> s5-0 0 text)) + (v1-4 (-> s4-0 decimal-place-count)) + ) + (t9-2 + a0-3 + (cond + ((zero? v1-4) + "~,,0f" + ) + ((= v1-4 1) + "~,,1f" + ) + (else + "~,,2f" + ) + ) + (-> s4-0 current) + ) + ) + ) + (set-as-offset-from! (the-as hud-sprite (-> s5-0 0 pos)) (the-as vector4w (-> this sprites)) 32 -8) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-wasbbv-counter)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning right large)) + (set! (-> this strings 0 color) (font-color red)) + 0 + (none) + ) + +(deftype task-manager-vehicle-bbush (task-manager) + ((ground-pos vector :inline) + (ground-time time-frame) + (pre-start-time time-frame) + (display-units float) + (max-distance float) + (distance float) + (total-distance float) + (max-air-time float) + (air-time float) + (total-air-time float) + (goal float) + (score float) + (current float) + (hud-score handle) + (hud-goal handle) + (squad-manager handle :offset 336) + (game-score uint8) + (last-cup uint8) + (goal-cup uint8) + (new-high-score symbol) + (want-current-hud? symbol) + ) + (:state-methods + report + ) + (:methods + (award-skill (_type_ float) none) + (task-manager-vehicle-bbush-method-34 (_type_) none) + (task-manager-vehicle-bbush-method-35 (_type_) none) + (task-manager-vehicle-bbush-method-36 (_type_) none) + ) + ) + + +(defmethod task-manager-vehicle-bbush-method-34 ((this task-manager-vehicle-bbush)) + (let ((gp-0 *wasbbv-hud-info*)) + (let ((v1-0 (-> this goal-cup))) + (set! (-> gp-0 goal-text) (cond + ((= v1-0 1) + (text-id text-0139) + ) + ((= v1-0 2) + (text-id text-0138) + ) + ((= v1-0 3) + (text-id text-0137) + ) + (else + (text-id text-0136) + ) + ) + ) + ) + (set! (-> this goal) + (game-info-method-31 *game-info* (the-as int (-> this game-score)) (the-as int (-> this goal-cup))) + ) + (set! (-> gp-0 goal) (* (-> this display-units) (-> this goal))) + (set! (-> gp-0 goal-cup) (-> this goal-cup)) + ) + 0 + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-vehicle-bbush)) + (when (= (-> this player-vehicle) #f) + (when (and *target* (focus-test? *target* pilot-riding)) + (let* ((s5-0 (handle->process (-> *target* pilot vehicle))) + (v1-10 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-10 + (set! (-> this player-vehicle) (-> *target* pilot vehicle)) + (set! (-> this ground-pos quad) (-> (the-as process-focusable v1-10) root trans quad)) + (set-time! (-> this ground-time)) + (dotimes (s5-1 3) + (send-event (handle->process (-> this player-vehicle)) 'turbo-pickup) + ) + ) + ) + ) + ) + (when (!= (-> this player-vehicle) #f) + (let ((v1-26 (the-as vehicle (handle->process (-> this player-vehicle))))) + (when v1-26 + (cond + ((and (logtest? (-> v1-26 v-flags) (vehicle-flag in-air)) + (not (logtest? (-> v1-26 v-flags) (vehicle-flag impact))) + ) + (set! (-> this air-time) (the float (- (current-time) (-> this ground-time)))) + (set! (-> this distance) + (vector-vector-xz-distance (-> this ground-pos) (the-as vector (&-> (the-as vehicle (-> v1-26 root)) parent))) + ) + ) + (else + (when (< 360.0 (-> this air-time)) + (+! (-> this total-distance) (-> this distance)) + (+! (-> this total-air-time) (-> this air-time)) + ) + (set! (-> this max-distance) (fmax (-> this max-distance) (-> this distance))) + (set! (-> this max-air-time) (fmax (-> this max-air-time) (-> this air-time))) + (set! (-> this ground-pos quad) (-> v1-26 root trans quad)) + (set-time! (-> this ground-time)) + (set! (-> this distance) 0.0) + (set! (-> this air-time) 0.0) + ) + ) + (task-manager-vehicle-bbush-method-34 this) + (when (>= (-> this score) (-> this goal)) + (set! (-> this new-high-score) #t) + (when (>= (the-as uint 3) (-> this goal-cup)) + (sound-play "special-pickup") + (+! (-> this goal-cup) 1) + ) + ) + ) + ) + ) + (let ((v1-42 *wasbbv-hud-info*)) + (set! (-> v1-42 score) (* (-> this display-units) (-> this score))) + (set! (-> v1-42 current) (* (-> this display-units) (-> this current))) + ) + (hud-timer-handler this) + ((method-of-type task-manager task-manager-method-26) this) + (none) + ) + +(defmethod task-manager-method-25 ((this task-manager-vehicle-bbush)) + (set! (-> *was-squad-control* target-count) 0) + 0 + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod go-fail ((this task-manager-vehicle-bbush)) + (go (method-of-object this report)) + 0 + ) + +(defmethod task-manager-vehicle-bbush-method-35 ((this task-manager-vehicle-bbush)) + (let ((v1-0 *was-squad-control*)) + (set! (-> v1-0 target-count) 2) + (set! (-> v1-0 reserve-count) 4000) + ) + (set-setting! 'music 'descarbb 0.0 0) + 0 + (none) + ) + +(defmethod task-manager-vehicle-bbush-method-36 ((this task-manager-vehicle-bbush)) + (let ((a0-1 (-> this node-info parent-node 0))) + (task-node-open! a0-1 'event) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-vehicle-bbush)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this squad-manager) (ppointer->handle (was-squad-manager-start this))) + (set! (-> this time-limit) (seconds 120)) + (set! (-> this air-time) 0.0) + (set! (-> this max-air-time) 0.0) + (set! (-> this total-air-time) 0.0) + (set! (-> this distance) 0.0) + (set! (-> this max-distance) 0.0) + (set! (-> this total-distance) 0.0) + (set! (-> this display-units) 1.0) + (set! (-> this new-high-score) #f) + (set! (-> this want-current-hud?) #t) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0573)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 2) + (set-setting! 'airlock #f 0.0 0) + (none) + ) + +(defmethod award-skill ((this task-manager-vehicle-bbush) (arg0 float)) + (let* ((s5-0 (-> this game-score)) + (s3-0 (game-info-method-29 *game-info* (the-as int s5-0))) + (v1-2 (get-highscore-rank *game-info* (the-as int s5-0) arg0)) + (gp-1 (max 0 (- v1-2 s3-0))) + ) + (game-info-method-27 *game-info* (the-as game-score s5-0) arg0) + (give *game-info* 'skill (* (the float gp-1) (-> *FACT-bank* super-skill-inc)) (the-as handle #f)) + ) + 0 + (none) + ) + +(defstate active (task-manager-vehicle-bbush) + :virtual #t + :code (behavior () + (until #f + (if (and *target* (not (logtest? (-> *target* focus-status) (focus-status grabbed)))) + (goto cfg-7) + ) + (suspend) + ) + #f + (label cfg-7) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self last-cup) (the-as uint (game-info-method-29 *game-info* (the-as int (-> self game-score))))) + (set! (-> self goal-cup) (+ (-> self last-cup) 1)) + (task-manager-vehicle-bbush-method-34 self) + (set! (-> self new-high-score) #f) + (set! (-> self hud-goal) + (ppointer->handle (process-spawn hud-wasbbv-goal :init hud-init-by-other :name "hud-wasbbv-goal" :to self)) + ) + (set! (-> self hud-score) + (ppointer->handle (process-spawn hud-wasbbv-score :init hud-init-by-other :name "hud-wasbbv-score" :to self)) + ) + (if (-> self want-current-hud?) + (set! (-> self hud-counter) + (ppointer->handle + (process-spawn hud-wasbbv-counter :init hud-init-by-other :name "hud-wasbbv-counter" :to self) + ) + ) + ) + (set-time! (-> self pre-start-time)) + (while (and (not (time-elapsed? (-> self pre-start-time) (seconds 10))) + (not (handle->process (-> self player-vehicle))) + ) + (when (and *target* (focus-test? *target* pilot-riding)) + (let ((gp-3 (handle->process (-> *target* pilot vehicle)))) + (if (if (type? gp-3 process-focusable) + gp-3 + ) + (set! (-> self player-vehicle) (-> *target* pilot vehicle)) + ) + ) + ) + (suspend) + ) + (task-manager-vehicle-bbush-method-35 self) + (set-time! (-> self start-time)) + (sleep-code) + ) + ) + +(define *bbv-fail-time-expired* + (new 'static 'resetter-params + :message (resetter-message mission-fail-or-retry) + :flags (resetter-flag auto-reset text-message no-audio-first) + :fail (new 'static 'resetter-spec :continue #f :reset-mode 'life :execute #f) + :retry (new 'static 'resetter-spec :continue "desert-bbush-desc-4" :reset-mode 'try :execute #f) + :reset-delay (seconds 6.5) + :text-message (text-id text-07cc) + ) + ) + +(defstate report (task-manager-vehicle-bbush) + :virtual #t + :code (behavior () + (award-skill self (-> self score)) + (cond + ((-> self new-high-score) + (format #t "task-manager-vehicle-bbush::report: got new high score~%") + (let ((gp-0 (-> self info on-complete))) + (if gp-0 + (script-eval gp-0) + ) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) + (suspend) + ) + ) + (while (not (-> *setting-control* user-current speech-control)) + (suspend) + ) + (task-manager-vehicle-bbush-method-36 self) + (until #f + (suspend) + ) + #f + ) + (else + (format #t "task-manager-vehicle-bbush::report: no new high score~%") + (let ((gp-2 (-> self info on-fail))) + (if gp-2 + (script-eval gp-2) + ) + ) + (while (not (-> *setting-control* user-current speech-control)) + (suspend) + ) + (task-manager-method-28 self) + (let ((gp-3 (on-fail self 'fail))) + (when gp-3 + (mem-copy! (the-as pointer *bbv-fail-time-expired*) (the-as pointer gp-3) 48) + (set! (-> gp-3 text-message) (text-id text-07cc)) + ) + ) + (go-virtual fail *bbv-fail-time-expired*) + ) + ) + ) + ) + +(deftype task-manager-bbush-air-time (task-manager-vehicle-bbush) + () + ) + + +(defmethod set-time-limit ((this task-manager-bbush-air-time)) + (call-parent-method this) + (set! (-> this display-units) 0.0033333334) + (set! (-> this time-limit) (seconds 30)) + (set! (-> this game-score) (the-as uint 4)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0573)) + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-bbush-air-time)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this max-air-time)) + (set! (-> this current) (-> this air-time)) + 0 + (none) + ) + +(deftype task-manager-bbush-total-air-time (task-manager-vehicle-bbush) + () + ) + + +(defmethod set-time-limit ((this task-manager-bbush-total-air-time)) + (call-parent-method this) + (set! (-> this display-units) 0.0033333334) + (set! (-> this time-limit) (seconds 60)) + (set! (-> this game-score) (the-as uint 5)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0078)) + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-bbush-total-air-time)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this total-air-time)) + (set! (-> this current) (-> this air-time)) + 0 + (none) + ) + +(deftype task-manager-bbush-jump-distance (task-manager-vehicle-bbush) + ((pad uint8 36) + ) + ) + + +(defmethod set-time-limit ((this task-manager-bbush-jump-distance)) + (call-parent-method this) + (set! (-> this display-units) 0.00024414062) + (set! (-> this time-limit) (seconds 30)) + (set! (-> this game-score) (the-as uint 6)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0833)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 1) + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-bbush-jump-distance)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this max-distance)) + (set! (-> this current) (-> this distance)) + 0 + (none) + ) + +(deftype task-manager-bbush-total-jump-distance (task-manager-vehicle-bbush) + () + ) + + +(defmethod set-time-limit ((this task-manager-bbush-total-jump-distance)) + (call-parent-method this) + (set! (-> this display-units) 0.00024414062) + (set! (-> this time-limit) (seconds 60)) + (set! (-> this game-score) (the-as uint 7)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-07ce)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 1) + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-bbush-total-jump-distance)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this total-distance)) + (set! (-> this current) (-> this distance)) + 0 + (none) + ) + +(deftype task-manager-bbush-roll-count (task-manager-vehicle-bbush) + ((roll-count float) + (y-proj float) + ) + ) + + +(defmethod set-time-limit ((this task-manager-bbush-roll-count)) + (call-parent-method this) + (set! (-> this display-units) 1.0) + (set! (-> this time-limit) (seconds 60)) + (set! (-> this game-score) (the-as uint 8)) + (set! (-> this want-current-hud?) #f) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-07cd)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 0) + 0 + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-bbush-roll-count)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (let ((v1-2 (handle->process (-> this player-vehicle)))) + (when v1-2 + (let ((f0-0 (-> (the-as vehicle v1-2) node-list data 0 bone transform uvec y))) + (when (< 0.1 (fabs f0-0)) + (if (< (* f0-0 (-> this y-proj)) 0.0) + (+! (-> this roll-count) 0.5) + ) + (set! (-> this y-proj) f0-0) + ) + ) + ) + ) + (set! (-> this score) (-> this roll-count)) + 0 + (none) + ) + +(deftype task-manager-bbush-destroy-interceptors (task-manager-vehicle-bbush) + ((max-reserve-count int32) + ) + ) + + +(defmethod set-time-limit ((this task-manager-bbush-destroy-interceptors)) + (call-parent-method this) + (set! (-> this display-units) 1.0) + (set! (-> this time-limit) (seconds 120)) + (set! (-> this game-score) (the-as uint 16)) + (set! (-> this want-current-hud?) #f) + (set! (-> this max-reserve-count) 1000) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-07f6)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 0) + (set! (-> *was-squad-control* target-count) 0) + 0 + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-bbush-destroy-interceptors)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (when (nonzero? (-> this start-time)) + (let ((v1-3 *was-squad-control*)) + (set! (-> this score) + (the float (- (- (-> this max-reserve-count) (-> v1-3 reserve-count)) (-> v1-3 active-count))) + ) + ) + ) + 0 + (none) + ) + +(defmethod task-manager-vehicle-bbush-method-35 ((this task-manager-bbush-destroy-interceptors)) + (set-setting! 'music 'desdstry 0.0 0) + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + (let ((v1-4 *was-squad-control*)) + (set! (-> v1-4 target-count) 4) + (set! (-> v1-4 reserve-count) (- (-> this max-reserve-count) (-> v1-4 active-count))) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod task-manager-method-28 ((this task-manager-bbush-destroy-interceptors)) + (talker-spawn-func (-> *talker-speech* 317) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) diff --git a/goal_src/jak3/levels/desert/des-burning-bush.gc b/goal_src/jak3/levels/desert/des-burning-bush.gc index 03d845601a..77a599a694 100644 --- a/goal_src/jak3/levels/desert/des-burning-bush.gc +++ b/goal_src/jak3/levels/desert/des-burning-bush.gc @@ -5,5 +5,1624 @@ ;; name in dgo: des-burning-bush ;; dgos: CTA, WASALL +(deftype des-burning-bush-stack-var0 (structure) + ((mat matrix :inline :offset 0) + (vec0 vector :inline :offset 64) + (vec1 vector :inline :offset 128) + (vec2 vector :inline :offset 160) + (quat quaternion :inline :offset 176) + (vec3 vector :inline :offset 192) + ) + ) + +(deftype des-burning-bush-stack-var1 (structure) + ((word0 int32 :offset 0) + (fnt-origin-x int32 :offset 4) + (scale float :offset 8) + ) + ) + +(deftype bbush-menu-state (structure) + ((cur int8 :offset 0) + (idx int8 :offset 1) + (fnt-height int32 :offset 4) + (fnt-origin-x int32 :offset 8) + (fnt-origin-y int32 :offset 12) + ) + ) + ;; DECOMP BEGINS +(defpartgroup group-desert-totem-eye-glow + :id 379 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 1584 :flags (sp6 sp7))) + ) + +(defpart 1584 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.8)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 1.2)) + (:r 80.0 20.0) + (:g 255.0) + (:b 255.0) + (:a 40.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-desert-totem-eye-glow-pre + :id 380 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 1585 :flags (sp6 sp7)) (sp-item 1586 :flags (sp6 sp7))) + ) + +(defpart 1585 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.8)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 1.5)) + (:r 80.0 20.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 1586 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.8)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 1.2)) + (:r 80.0 20.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +(deftype bbush-menu-item (structure) + ((text text-id) + (node game-task-node) + ) + ) + + +(deftype bbush-menu (structure) + ((title-text text-id) + (req-text text-id) + (req-check (function symbol)) + (item-count int8) + (items bbush-menu-item 10 :inline) + ) + ) + + +(define *bbush-menu* (new 'static 'bbush-menu + :title-text (text-id text-0624) + :req-text (text-id text-0860) + :req-check (lambda () (case (-> *game-info* current-vehicle) + ((13 16 18 19) + #t + ) + (else + #f + ) + ) + ) + :item-count 5 + :items (new 'static 'inline-array bbush-menu-item 10 + (new 'static 'bbush-menu-item + :text (text-id text-0629) + :node (game-task-node desert-bbush-air-time-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-0628) + :node (game-task-node desert-bbush-total-air-time-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-062b) + :node (game-task-node desert-bbush-jump-distance-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-062a) + :node (game-task-node desert-bbush-total-jump-distance-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-062c) + :node (game-task-node desert-bbush-roll-count-introduction) + ) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + ) + ) + ) + +(deftype des-burning-bush (process-focusable) + ((task game-task-control) + (part-off sparticle-launch-control) + (angle float) + (time float) + (rotmin float) + (rotmax float) + (bb-perm entity-perm) + (menu bbush-menu) + (menu-node game-task-node-info) + (menu-exit? symbol) + (menu-have-req? symbol) + (message-id text-id) + (required-vehicles game-vehicles) + ) + (:state-methods + idle + talking + menu + collect-gems + ) + (:methods + (des-burning-bush-method-32 (_type_) none) + (des-burning-bush-method-33 (_type_) none) + (des-burning-bush-method-34 (_type_) object) + (des-burning-bush-method-35 (_type_) none) + (des-burning-bush-method-36 (_type_) none) + (des-burning-bush-method-37 (_type_) none) + (des-burning-bush-method-38 (_type_) none) + ) + ) + + +(defskelgroup skel-des-burning-bush des-burning-bush des-burning-bush-lod0-jg des-burning-bush-idle-ja + ((des-burning-bush-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3.5) + ) + +(defmethod des-burning-bush-method-36 ((this des-burning-bush)) + (let ((a0-2 (get-current-task-event (-> this task)))) + (if (= (-> a0-2 action) (game-task-action menu)) + (go (method-of-object this menu)) + (go (method-of-object this talking)) + ) + ) + 0 + (none) + ) + +(defstate idle (des-burning-bush) + :virtual #t + :exit (behavior () + '() + ) + :trans (behavior () + (local-vars (v1-43 process)) + (setup-masks (-> self draw) 2 4) + (let ((gp-0 (get-current-task-event (-> self task))) + (s5-0 #f) + ) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-1 (-> self node-list data 3 bone transform)) + (v1-5 (-> a2-1 rvec quad)) + (a0-2 (-> a2-1 uvec quad)) + (a1-1 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> s4-0 rvec quad) v1-5) + (set! (-> s4-0 uvec quad) a0-2) + (set! (-> s4-0 fvec quad) a1-1) + (set! (-> s4-0 trans quad) a2-2) + ) + (when (< (vector-dot + (-> s4-0 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s4-0 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + ) + ) + (cond + (#f + (set! s5-0 #t) + ) + ((= (-> gp-0 action) (game-task-action show)) + (setup-masks (-> self draw) 4 2) + ) + ((= (-> gp-0 action) (game-task-action play)) + ) + ((= (-> gp-0 action) (game-task-action menu)) + ) + (else + ) + ) + (cond + ((and (not s5-0) + (or (= (-> gp-0 action) (game-task-action show)) (= (-> gp-0 action) (game-task-action menu))) + (and (des-burning-bush-method-34 self) (can-display-query? self (the-as string #f) -99.0)) + ) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 300 0.0 (font-color default) (font-flags shadow kerning)) + ) + (gp-1 (-> gp-0 tex)) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning large)) + (let ((v1-28 s5-1)) + (set! (-> v1-28 width) (the float 340)) + ) + (let ((v1-29 s5-1)) + (set! (-> v1-29 height) (the float 80)) + ) + (let ((v1-30 s5-1) + (a0-16 (-> *setting-control* user-default language)) + ) + (set! (-> v1-30 scale) (if (or (= a0-16 (language-enum korean)) (= a0-16 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (let ((v1-33 (-> self entity extra perm))) + (logior! (-> v1-33 status) (entity-perm-status bit-5)) + (set! (-> self bb-perm) v1-33) + (logior! (-> v1-33 status) (entity-perm-status bit-14)) + ) + (cond + ((and (nonzero? (-> self required-vehicles)) + (or (not (logtest? (-> self required-vehicles) (ash 1 (the-as int (-> *game-info* current-vehicle))))) + (begin + (set! v1-43 (handle->process (-> *vehicle-info* handle-by-vehicle-type (-> *game-info* current-vehicle)))) + (not v1-43) + ) + (< 245760.0 (vector-vector-distance (-> (the-as vehicle v1-43) root trans) (target-pos 0))) + ) + ) + (print-game-text + (lookup-text! *common-text* (text-id text-085f) #f) + s5-1 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + (else + (cond + ((zero? (-> self bb-perm user-object 0)) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-061d) #f) gp-1) + (s4-2 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (logior! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + (else + (let ((s4-3 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id press-triangle-to-talk) #f)) + (s4-3 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (cond + ((and (zero? (-> self bb-perm user-object 0)) + (or (= gp-1 (the int (-> *target* game gem))) + (< (the-as uint gp-1) (the-as uint (the int (-> *target* game gem)))) + ) + ) + (set! (-> self bb-perm user-object 0) 1) + (go-virtual collect-gems) + ) + ((= (-> self bb-perm user-object 0) 1) + (des-burning-bush-method-36 self) + ) + (else + (sound-play "skull-negative") + ) + ) + ) + ) + ) + ) + ) + (else + (if *hud-skullgem* + (logclear! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 12288.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + (des-burning-bush-method-35 self) + ) + ) + ) + +(defstate collect-gems (des-burning-bush) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (process-release? *target*) + ) + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (let ((gp-0 (-> (get-current-task-event (-> self task)) tex))) + (format 0 "skull-cost: ~d~%" gp-0) + (set! (-> *target* game gem) (- (-> *target* game gem) (the float gp-0))) + (until (time-elapsed? (-> self state-time) (* 45 (the-as int gp-0))) + (suspend) + ) + ) + (des-burning-bush-method-36 self) + ) + :post (behavior () + (des-burning-bush-method-35 self) + ) + ) + +(defstate talking (des-burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self time) -1.0) + (process-entity-status! self (entity-perm-status no-kill) #t) + ) + :exit (behavior () + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'minimap) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'des-burning-bush-stack-var0))) + (when (!= (-> self time) -1.0) + (quaternion-rotate-local-y! + (-> gp-0 quat) + (-> self root quat) + (lerp-scale (-> self rotmin) (-> self rotmax) (sin (* 7281.778 (-> self time))) -1.0 1.0) + ) + (vector-orient-by-quat! (-> gp-0 vec2) (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0) (-> gp-0 quat)) + (vector+! (-> gp-0 vec1) (-> self root trans) (-> gp-0 vec2)) + (set! (-> *camera* slave 0 trans quad) (-> gp-0 vec1 quad)) + (let ((v1-10 (-> gp-0 vec2))) + (let ((a0-9 (-> self root trans))) + (let ((a1-4 *up-vector*)) + (let ((a2-4 12288.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a1-4 quad)) + ) + (.lvf vf4 (&-> a0-9 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-10 quad) vf6) + ) + (vector-! (-> gp-0 vec3) (-> gp-0 vec2) (-> gp-0 vec1)) + (forward-down->inv-matrix + (the-as matrix (-> *camera* slave 0 tracking)) + (-> gp-0 vec3) + (-> *camera* local-down) + ) + ) + (let* ((v1-17 (-> gp-0 mat)) + (a3-1 (-> self node-list data 3 bone transform)) + (a0-14 (-> a3-1 rvec quad)) + (a1-8 (-> a3-1 uvec quad)) + (a2-6 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-17 rvec quad) a0-14) + (set! (-> v1-17 uvec quad) a1-8) + (set! (-> v1-17 fvec quad) a2-6) + (set! (-> v1-17 trans quad) a3-2) + ) + (matrix->trans (-> gp-0 mat) (-> gp-0 vec2)) + (vector-! (-> gp-0 vec2) (camera-pos) (-> gp-0 vec2)) + (when (< (vector-dot (-> gp-0 mat fvec) (-> gp-0 vec2)) 0.0) + (matrix-rotate-y! (the-as matrix (-> gp-0 vec0)) 32768.0) + (matrix*! (-> gp-0 mat) (the-as matrix (-> gp-0 vec0)) (-> gp-0 mat)) + ) + ) + (+! (-> self angle) (* 100.0 (rand-vu))) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (if *target* + (set! (-> *target* neck flex-blend) 1.0) + ) + (add-setting! 'music-volume 'rel (-> *setting-control* user-current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* user-current sfx-volume-movie) 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) + (set-time! (-> self state-time)) + (let* ((v1-21 (get-current-task-event (-> self task))) + (gp-0 (add-process *gui-control* self (gui-channel bbush) (gui-action play) (-> v1-21 scene) -99.0 0)) + ) + (let ((s5-0 (current-time))) + (while (and (nonzero? (get-status *gui-control* gp-0)) (not (time-elapsed? s5-0 (seconds 60)))) + (set! (-> self time) (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (suspend) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "inter-burn-bush") + (goto cfg-13) + ) + ) + ) + (label cfg-13) + (set-action! + *gui-control* + (gui-action stop) + gp-0 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (task-node-close! (-> self task current-node) 'event) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 12288.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + (des-burning-bush-method-35 self) + ) + ) + ) + +(defmethod des-burning-bush-method-37 ((this des-burning-bush)) + (let ((s5-0 (new 'stack-no-clear 'bbush-menu-state))) + (set! (-> s5-0 cur) 0) + (set! (-> s5-0 idx) 0) + (dotimes (s4-0 (-> this menu item-count)) + (let* ((s2-0 (-> this menu items s4-0)) + (s3-0 (task-node-open? (-> s2-0 node))) + (v1-2 (task-node-closed? (-> s2-0 node))) + ) + (when (or s3-0 v1-2) + (if v1-2 + (set! (-> s5-0 idx) s4-0) + ) + (+! (-> s5-0 cur) 1) + ) + ) + ) + (when (cpad-pressed? 0 down l-analog-down) + (+! (-> s5-0 idx) 1) + (if (< (+ (-> s5-0 cur) -1) (-> s5-0 idx)) + (set! (-> s5-0 idx) (+ (-> s5-0 cur) -1)) + (sound-play "menu-up-down") + ) + ) + (when (cpad-pressed? 0 up l-analog-up) + (+! (-> s5-0 idx) -1) + (cond + ((< (-> s5-0 idx) 0) + (set! (-> s5-0 idx) 0) + 0 + ) + (else + (sound-play "menu-up-down") + ) + ) + ) + (task-node-close! (-> this menu items (-> s5-0 idx) node) 'event) + (when (cpad-pressed? 0 confirm) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (set! (-> this menu-node) (-> *game-info* sub-task-list (-> this menu items (-> s5-0 idx) node))) + (set! (-> this menu-exit?) #t) + ) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (dotimes (s4-3 (-> this menu item-count)) + (let ((v1-57 (-> this menu items s4-3))) + (task-node-open! (-> v1-57 node) 'event) + ) + ) + (set! (-> this menu-node) #f) + (set! (-> this menu-exit?) #t) + ) + (let ((s4-4 + (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + 1.0 + (let* ((v1-67 (-> *setting-control* user-default language)) + (f30-0 (cond + ((= v1-67 (language-enum korean)) + 1.8 + ) + ((= v1-67 (language-enum russian)) + 1.5 + ) + ((= v1-67 (language-enum english)) + 1.3 + ) + ((= v1-67 (language-enum german)) + 1.3 + ) + ((= v1-67 (language-enum spanish)) + 1.1 + ) + ((= v1-67 (language-enum portuguese)) + 1.0 + ) + (else + 1.2 + ) + ) + ) + ) + (set! (-> s5-0 fnt-height) 40) + (set! (-> s5-0 fnt-origin-x) 36) + (set! (-> s5-0 fnt-origin-y) (- 228 (* (-> s5-0 cur) (/ (-> s5-0 fnt-height) 2)))) + (set! (-> s4-4 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-74 s4-4)) + (set! (-> v1-74 width) (the float 440)) + ) + (let ((v1-75 s4-4)) + (set! (-> v1-75 height) (the float 50)) + ) + (let ((v1-76 s4-4)) + (set! (-> v1-76 scale) (* 0.8 f30-0)) + ) + (let ((v1-77 s4-4) + (a1-7 (-> s5-0 fnt-origin-x)) + (a0-61 40) + ) + (set! (-> v1-77 origin x) (the float a1-7)) + (set! (-> v1-77 origin y) (the float a0-61)) + ) + (let ((a0-62 s4-4)) + (set! (-> a0-62 color) (font-color progress-old-yellow)) + ) + (let ((s3-3 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu title-text) #f)) + (s3-3 *temp-string* s4-4 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-81 s4-4)) + (set! (-> v1-81 height) (the float (-> s5-0 fnt-height))) + ) + (dotimes (s3-4 (-> s5-0 cur)) + (let ((v1-82 s4-4) + (a1-11 (-> s5-0 fnt-origin-x)) + (a0-68 (-> s5-0 fnt-origin-y)) + ) + (set! (-> v1-82 origin x) (the float a1-11)) + (set! (-> v1-82 origin y) (the float a0-68)) + ) + (let ((v1-83 s4-4)) + (set! (-> v1-83 scale) (* f30-0 (if (= s3-4 (-> s5-0 idx)) + 0.45 + 0.4 + ) + ) + ) + ) + (let ((v1-84 s4-4)) + (set! (-> v1-84 color) (if (= s3-4 (-> s5-0 idx)) + (font-color progress-old-selected) + (font-color default) + ) + ) + ) + (let ((s2-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu items s3-4 text) #f)) + (s2-2 *temp-string* s4-4 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (+! (-> s5-0 fnt-origin-y) (-> s5-0 fnt-height)) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod des-burning-bush-method-38 ((this des-burning-bush)) + (when (or (cpad-pressed? 0 confirm) (cpad-pressed? 0 triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (set! (-> this menu-node) #f) + (set! (-> this menu-exit?) #t) + ) + (let ((s5-0 + (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'des-burning-bush-stack-var1))) + (set! (-> s4-0 word0) 120) + (set! (-> s4-0 fnt-origin-x) 36) + (let ((v1-14 (-> *setting-control* user-default language))) + (set! (-> s4-0 scale) (if (or (= v1-14 (language-enum korean)) (= v1-14 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> s5-0 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-18 s5-0) + (a1-2 (-> s4-0 fnt-origin-x)) + (a0-21 40) + ) + (set! (-> v1-18 origin x) (the float a1-2)) + (set! (-> v1-18 origin y) (the float a0-21)) + ) + (let ((v1-19 s5-0)) + (set! (-> v1-19 width) (the float 440)) + ) + (let ((v1-20 s5-0)) + (set! (-> v1-20 height) (the float 50)) + ) + (let ((v1-21 s5-0)) + (set! (-> v1-21 scale) 1.0) + ) + (let ((a0-25 s5-0)) + (set! (-> a0-25 color) (font-color progress-old-yellow)) + ) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu title-text) #f)) + (s3-0 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-25 s5-0)) + (set! (-> v1-25 height) (the float 230)) + ) + (let ((v1-26 s5-0) + (a1-6 (-> s4-0 fnt-origin-x)) + (a0-31 98) + ) + (set! (-> v1-26 origin x) (the float a1-6)) + (set! (-> v1-26 origin y) (the float a0-31)) + ) + (let ((v1-27 s5-0)) + (set! (-> v1-27 scale) (-> s4-0 scale)) + ) + (let ((a0-32 s5-0)) + (set! (-> a0-32 color) (font-color default)) + ) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu req-text) #f)) + (s3-1 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-31 s5-0) + (a1-10 (-> s4-0 fnt-origin-x)) + (a0-37 328) + ) + (set! (-> v1-31 origin x) (the float a1-10)) + (set! (-> v1-31 origin y) (the float a0-37)) + ) + (let ((v1-32 s5-0)) + (set! (-> v1-32 height) (the float 50)) + ) + (let ((v1-33 s5-0)) + (set! (-> v1-33 scale) (-> s4-0 scale)) + ) + ) + (let ((a0-39 s5-0)) + (set! (-> a0-39 color) (font-color default)) + ) + (let ((gp-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-007c) #f)) + (gp-1 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + 0 + (none) + ) + +(defstate menu (des-burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set-setting! 'allow-progress #f 0.0 0) + (set! (-> self time) -1.0) + (set! (-> self menu-exit?) #f) + (set! (-> self menu-have-req?) #t) + (set! (-> self menu) *bbush-menu*) + (let ((t9-2 (-> self menu req-check))) + (if t9-2 + (set! (-> self menu-have-req?) (t9-2)) + ) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (remove-setting! 'minimap) + (remove-setting! 'allow-progress) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (and (time-elapsed? (-> self state-time) (seconds 1.5)) (not (-> self menu-exit?))) + (if (-> self menu-have-req?) + (des-burning-bush-method-37 self) + (des-burning-bush-method-38 self) + ) + ) + (when (!= (-> self time) -1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (vector+! gp-0 (-> self root trans) (vector-orient-by-quat! + (new 'stack-no-clear 'vector) + (new 'static 'vector :y 24166.4 :z 32768.0 :w 1.0) + (-> self root quat) + ) + ) + (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (let ((t9-3 forward-down->inv-matrix) + (a0-7 (-> *camera* slave 0 tracking)) + (a1-1 (new 'stack-no-clear 'vector)) + (v1-23 (new 'stack-no-clear 'vector)) + ) + (let ((a2-2 (-> self root trans))) + (let ((a3-0 *up-vector*)) + (let ((t0-1 24166.4)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a3-0 quad)) + ) + (.lvf vf4 (&-> a2-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-23 quad) vf6) + (t9-3 (the-as matrix a0-7) (vector-! a1-1 v1-23 gp-0) (-> *camera* local-down)) + ) + ) + ) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (set! (-> self time) 0.0) + (while (not (-> self menu-exit?)) + (suspend) + ) + (when (-> self menu-node) + (set! (-> self message-id) (text-id null)) + (let ((a0-2 (-> self menu-node)) + (v1-7 (the-as game-task-event #f)) + ) + (countdown (a1-3 (-> a0-2 when-open length)) + (let ((a2-3 (-> a0-2 when-open a1-3))) + (if (= (-> self task actor) (-> a2-3 actor)) + (set! v1-7 a2-3) + ) + ) + ) + (if v1-7 + (set! (-> self message-id) + (the-as + text-id + (add-process *gui-control* self (gui-channel bbush) (gui-action play) (-> v1-7 scene) -99.0 0) + ) + ) + ) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.25)) + (suspend) + ) + ) + (set-time! (-> self state-time)) + (while (and (nonzero? (get-status *gui-control* (the-as sound-id (-> self message-id)))) + (not (time-elapsed? (-> self state-time) (seconds 60))) + ) + (set! (-> self time) (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (suspend) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "inter-burn-bush") + ) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self message-id)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + (des-burning-bush-method-35 self) + ) + ) + ) + +(defmethod des-burning-bush-method-35 ((this des-burning-bush)) + (when (nonzero? (-> this part)) + (let ((s5-0 (get-current-task-event (-> this task)))) + (let ((v1-5 (-> this entity extra perm))) + (logior! (-> v1-5 status) (entity-perm-status bit-5)) + (set! (-> this bb-perm) v1-5) + (logior! (-> v1-5 status) (entity-perm-status bit-14)) + ) + (let* ((f30-0 (lerp-scale 15.0 128.0 (vector-vector-distance (camera-pos) (-> this root trans)) 163840.0 245760.0)) + (f28-0 15.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + (f0-4 (+ f28-0 (* (+ -1.0 (the-as float v1-10)) f30-0))) + ) + (cond + ((or (= (-> s5-0 action) (game-task-action play)) + (= (-> s5-0 action) (game-task-action show)) + (= (-> s5-0 action) (game-task-action menu)) + ) + (cond + ((= (-> this bb-perm user-object 0) 1) + (spawn-from-cspace (-> this part-off) (-> this node-list data 4)) + (spawn-from-cspace (-> this part-off) (-> this node-list data 5)) + ) + (else + (set! (-> *part-id-table* 1585 init-specs 11 initial-valuef) f0-4) + (set! (-> *part-id-table* 1586 init-specs 11 initial-valuef) (* 0.5 f0-4)) + (spawn-from-cspace (-> this part) (-> this node-list data 4)) + (spawn-from-cspace (-> this part) (-> this node-list data 5)) + ) + ) + ) + (else + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod des-burning-bush-method-34 ((this des-burning-bush)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + ) + (and *target* + (not (focus-test? *target* pilot)) + (< (fabs f30-0) 10240.0) + (< 0.0 f0-2) + (< (fabs f0-2) 20480.0) + ) + ) + ) + +(defmethod des-burning-bush-method-32 ((this des-burning-bush)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod des-burning-bush-method-33 ((this des-burning-bush)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-des-burning-bush" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch process-focusable vs des-burning-bush. +(defmethod relocate ((this des-burning-bush) (offset int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) offset) + ) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) offset) + ) + (the-as des-burning-bush ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod deactivate ((this des-burning-bush)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part-off)) + (kill-particles (-> this part-off)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +(defmethod run-logic? ((this des-burning-bush)) + "Should this process be run? Checked by execute-process-tree." + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) + ) + ) + ) + +(defmethod init-from-entity! ((this des-burning-bush) (arg0 entity-actor)) + (des-burning-bush-method-32 this) + (process-drawable-from-entity! this arg0) + (des-burning-bush-method-33 this) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-0 0.0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-0) + ) + ) + (set! (-> this required-vehicles) (res-lump-value arg0 'vehicle-type-mask game-vehicles :time -1000000000.0)) + (set! (-> this rotmin) (res-lump-float arg0 'rotmin :default -5461.3335)) + (set! (-> this rotmax) (res-lump-float arg0 'rotmax :default 5461.3335)) + (set! (-> this task) + (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) + ) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 380) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 379) this)) + (transform-post) + (go (method-of-object this idle)) + ) + +(deftype burning-bush-get-on-info (structure) + ((trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (time float) + (fov float) + ) + ) + + +(define *burning-bush-get-on-info* + (new 'static 'boxed-array :type burning-bush-get-on-info + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 15826067.0 :y 294066.6 :z 2348413.8 :w 1.0) + :quat (new 'static 'quaternion :x 0.0009 :y 0.4808 :z 0.0009 :w -0.8768) + :camera-trans (new 'static 'vector :x 15828972.0 :y 307578.47 :z 2379081.2 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9999 0.0 0.0074 -0.0009 0.9911 -0.1331 -0.0074 -0.1331 -0.991) + :time 6000.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 3697802.5 :y 412520.44 :z 6895680.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9992 :w 0.0389) + :camera-trans (new 'static 'vector :x 3630403.2 :y 428921.66 :z 6831057.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8029 0.0 -0.596 0.0794 0.991 0.1069 0.5907 -0.1332 0.7957) + :time 6900.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 5819480.5 :y 388060.38 :z 1678595.2 :w 1.0) + :quat (new 'static 'quaternion :x 0.0013 :y -0.1948 :z -0.0003 :w 0.9808) + :camera-trans (new 'static 'vector :x 5774928.5 :y 468702.4 :z 1851368.2 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8883 0.0 -0.4591 0.0899 0.9806 -0.174 0.4502 -0.1959 -0.8711) + :time 9000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 12843417.0 :y 89547.57 :z 11022830.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0015 :y 0.8039 :z 0.0002 :w 0.5946) + :camera-trans (new 'static 'vector :x 12865863.0 :y 96517.734 :z 11012419.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4931 0.0 0.8699 0.2364 0.9623 -0.134 -0.8372 0.2718 0.4745) + :time 5100.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 11575935.0 :y 108180.27 :z 14247904.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.1133 :w 0.9935) + :camera-trans (new 'static 'vector :x 11535285.0 :y 121128.55 :z 14248524.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0416 0.0 -0.9991 0.1031 0.9946 0.0042 0.9937 -0.1031 0.0413) + :time 9000.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 5470401.5 :y 51780.402 :z 7791442.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.8257 :z 0.0015 :w 0.5639) + :camera-trans (new 'static 'vector :x 5550344.5 :y 55626.137 :z 7814714.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2121 0.0 0.9772 -0.0007 0.9999 -0.0001 -0.9772 -0.0007 -0.2121) + :time 3900.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 2951720.2 :y 185922.36 :z 12151224.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0014 :y 0.4042 :z 0.0005 :w 0.9146) + :camera-trans (new 'static 'vector :x 2932693.0 :y 185689.3 :z 12123397.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9698 0.0 -0.2435 -0.1039 0.9044 -0.4138 0.2202 0.4266 0.8771) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 12339974.0 :y 181197.2 :z 1548690.2 :w 1.0) + :quat (new 'static 'quaternion :y 0.4266 :w 0.9044) + :camera-trans (new 'static 'vector :x 12309206.0 :y 227872.36 :z 1644105.8 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9842 0.0 0.1767 -0.0231 0.9913 -0.1291 -0.1751 -0.1311 -0.9757) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 7752197.0 :y 216207.36 :z 923399.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.951 :w 0.3089) + :camera-trans (new 'static 'vector :x 7668311.0 :y 260772.25 :z 917091.56 :w 1.0) + :camera-rot (new 'static 'array float 9 0.2895 0.0 -0.9571 0.4737 0.8689 0.1433 0.8317 -0.4949 0.2515) + :time 5100.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 1969225.4 :y 140065.6 :z 5292424.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.788 :w -0.6156) + :camera-trans (new 'static 'vector :x 2006893.0 :y 160366.19 :z 5227043.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.752 0.0 0.659 0.0335 0.9987 -0.0383 -0.6582 0.0509 0.751) + :time 8400.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 12238691.0 :y 98111.9 :z 11890045.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0014 :y 0.5531 :z -0.0006 :w 0.833) + :camera-trans (new 'static 'vector :x 12326140.0 :y 148922.38 :z 11845758.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7859 0.0 0.6183 -0.166 0.9632 0.211 -0.5956 -0.2684 0.757) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9236149.0 :y 43447.5 :z 6553425.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7227 :w 0.6911) + :camera-trans (new 'static 'vector :x 9367670.0 :y 67202.664 :z 6607653.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.3072 0.0 0.9516 0.1112 0.9931 0.0359 -0.9451 0.1169 -0.3051) + :time 4800.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 10618439.0 :y 113487.875 :z 10291461.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0008 :y 0.9917 :z -0.0011 :w 0.1277) + :camera-trans (new 'static 'vector :x 10764415.0 :y 127953.305 :z 10306016.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0476 0.0 0.9988 -0.1626 0.9866 0.0077 -0.9855 -0.1628 0.047) + :time 7500.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 529121.7 :y 98823.375 :z 13884964.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9481 :w -0.3177) + :camera-trans (new 'static 'vector :x 722918.2 :y 101507.07 :z 13901837.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2403 0.0 0.9706 0.264 0.9623 0.0653 -0.934 0.2719 -0.2313) + :time 7200.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 2273161.2 :y 250537.17 :z 15519410.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0007 :y -0.0731 :z -0.0014 :w 0.9973) + :camera-trans (new 'static 'vector :x 2312609.5 :y 318328.84 :z 15637414.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9419 0.0 0.3356 -0.0852 0.9671 -0.2393 -0.3246 -0.254 -0.911) + :time 9300.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 16549387.0 :y 106001.2 :z 6772071.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8949 :w 0.4461) + :camera-trans (new 'static 'vector :x 16576971.0 :y 121950.21 :z 6763736.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4199 0.0 0.9075 -0.1935 0.9769 0.0895 -0.8866 -0.2132 0.4102) + :time 5400.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 15726801.0 :y 114936.22 :z 295390.4 :w 1.0) + :quat (new 'static 'quaternion :x -0.0014 :y -0.7325 :z 0.0007 :w -0.6807) + :camera-trans (new 'static 'vector :x 15773588.0 :y 124979.2 :z 296459.88 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.0256 0.0 0.9996 -0.0761 0.997 -0.0019 -0.9967 -0.0762 -0.0255) + :time 6300.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9514424.0 :y 84128.56 :z -182453.05 :w 1.0) + :quat (new 'static 'quaternion :x -0.0015 :y 0.8943 :w 0.4472) + :camera-trans (new 'static 'vector :x 9527463.0 :y 95552.305 :z -169796.81 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.7222 0.0 0.6916 -0.0674 0.9952 -0.0704 -0.6883 -0.0975 -0.7188) + :time 6300.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9272824.0 :y 78754.2 :z -690128.9 :w 1.0) + :quat (new 'static 'quaternion :x 0.0002 :y 0.0607 :z 0.0013 :w 0.9981) + :camera-trans (new 'static 'vector :x 9232619.0 :y 192907.27 :z -843155.44 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9996 0.0 -0.0251 0.0133 0.8478 0.53 0.0213 -0.5302 0.8475) + :time 7800.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9916865.0 :y 155500.14 :z -484290.56 :w 1.0) + :quat (new 'static 'quaternion :x -0.0013 :y 0.8336 :z 0.0005 :w -0.5522) + :camera-trans (new 'static 'vector :x 10009599.0 :y 164922.58 :z -486762.9 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2507 0.0 0.968 -0.0206 0.9997 -0.0053 -0.9678 -0.0213 -0.2506) + :time 7500.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9770632.0 :y 73132.85 :z -612405.7 :w 1.0) + :quat (new 'static 'quaternion :y 0.0576 :z -0.0015 :w -0.9983) + :camera-trans (new 'static 'vector :x 9774927.0 :y 94098.64 :z -681817.3 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9577 0.0 0.2876 -0.0753 0.965 0.251 -0.2776 -0.262 0.9242) + :time 8100.0 + :fov 7281.778 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 6649945.5 :y 156115.36 :z -1471328.6 :w 1.0) + :quat (new 'static 'quaternion :x -0.0008 :y -0.731 :z 0.0013 :w -0.6823) + :camera-trans (new 'static 'vector :x 6694340.5 :y 174896.75 :z -1490136.6 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0245 0.0 0.9996 -0.1697 0.9854 0.0041 -0.9851 -0.1698 0.0241) + :time 6900.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 7562680.5 :y 78961.05 :z -2169692.2 :w 1.0) + :quat (new 'static 'quaternion :x 0.0007 :y 0.734 :z 0.0012 :w 0.679) + :camera-trans (new 'static 'vector :x 7570156.5 :y 92349.65 :z -2207594.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8539 0.0 0.5203 -0.0666 0.9917 0.1093 -0.516 -0.128 0.8469) + :time 7800.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 6538078.0 :y 288967.88 :z -777354.9 :w 1.0) + :quat (new 'static 'quaternion :x 0.0011 :y -0.8817 :z 0.0005 :w -0.4716) + :camera-trans (new 'static 'vector :x 6568851.5 :y 306831.78 :z -770489.94 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.4012 0.0 0.9159 -0.151 0.9863 -0.0661 -0.9034 -0.1648 -0.3957) + :time 6600.0 + :fov 12743.111 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 6656705.5 :y 123696.74 :z -1911393.5 :w 1.0) + :quat (new 'static 'quaternion :x 0.0011 :y 0.3455 :z 0.0007 :w 0.9383) + :camera-trans (new 'static 'vector :x 6681104.0 :y 137490.02 :z -1923000.8 :w 1.0) + :camera-rot (new 'static 'array float 9 0.3877 0.0 0.9217 -0.2533 0.9614 0.1065 -0.8862 -0.2748 0.3727) + :time 5100.0 + :fov 14563.556 + ) + ) + ) + +(deftype task-manager-desert-bbush-get-to (task-manager) + ((skill handle) + (update-fov? symbol) + ) + (:methods + (task-manager-desert-bbush-get-to-method-32 (_type_) none) + ) + ) + + +(defmethod task-manager-desert-bbush-get-to-method-32 ((this task-manager-desert-bbush-get-to)) + (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + ) + 0 + (none) + ) + +(defmethod set-time-limit ((this task-manager-desert-bbush-get-to)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (task-manager-desert-bbush-get-to-method-32 this) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this update-fov?) #f) + (when (nonzero? (-> this skill)) + (let ((a0-5 (handle->process (-> this skill)))) + (if a0-5 + (deactivate a0-5) + ) + ) + ) + (none) + ) + +(defstate active (task-manager-desert-bbush-get-to) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (send-event self 'complete) + ) + (('die) + (send-event self 'fail) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (let ((t1-1 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + (a0-3 (new 'stack-no-clear 'vector)) + ) + (logior! (-> t1-1 options) (actor-option fade-out)) + (set! (-> t1-1 fade-time) + (the-as time-frame (the int (-> *burning-bush-get-on-info* (-> self info index) time))) + ) + (set! (-> a0-3 quad) (-> *burning-bush-get-on-info* (-> self info index) trans quad)) + (+! (-> a0-3 y) 4096.0) + (set! (-> self skill) + (ppointer->handle + (birth-pickup-at-point a0-3 (pickup-type skill) (-> *FACT-bank* super-skill-inc) #t self t1-1) + ) + ) + ) + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (+ 300.0 (-> *burning-bush-get-on-info* (-> self info index) time)))) + ) + (suspend) + (send-event (handle->process (-> self skill)) 'get-notify self) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + (let ((f30-0 (-> *camera* settings fov))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) + (v1-46 (-> a2-7 rvec quad)) + (a0-15 (-> a2-7 uvec quad)) + (a1-15 (-> a2-7 fvec quad)) + (a2-8 (-> a2-7 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-46) + (set! (-> gp-0 uvec quad) a0-15) + (set! (-> gp-0 fvec quad) a1-15) + (set! (-> gp-0 trans quad) a2-8) + ) + (let ((s4-0 (new 'stack 'transformq))) + (let ((v1-52 (-> *burning-bush-get-on-info* (-> self info index))) + (a1-17 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) + (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) + (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) + (set! (-> a1-17 rvec z) (-> v1-52 camera-rot 2)) + (set! (-> a1-17 rvec w) 0.0) + (set! (-> a1-17 uvec x) (-> v1-52 camera-rot 3)) + (set! (-> a1-17 uvec y) (-> v1-52 camera-rot 4)) + (set! (-> a1-17 uvec z) (-> v1-52 camera-rot 5)) + (set! (-> a1-17 uvec w) 0.0) + (set! (-> a1-17 fvec x) (-> v1-52 camera-rot 6)) + (set! (-> a1-17 fvec y) (-> v1-52 camera-rot 7)) + (set! (-> a1-17 fvec z) (-> v1-52 camera-rot 8)) + (set! (-> a1-17 fvec w) 0.0) + (set! (-> a1-17 trans x) 0.0) + (set! (-> a1-17 trans y) 0.0) + (set! (-> a1-17 trans z) 0.0) + (set! (-> a1-17 trans w) 1.0) + (matrix->quaternion (-> s4-0 quat) a1-17) + ) + (send-event *camera* 'teleport-to-transformq s4-0) + ) + (set! (-> self update-fov?) #t) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 3)) + (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) + (suspend) + ) + ) + (set! (-> self update-fov?) #f) + (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) + (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) + (v1-75 (-> gp-0 rvec quad)) + (a0-24 (-> gp-0 uvec quad)) + (a1-19 (-> gp-0 fvec quad)) + (a3-5 (-> gp-0 trans quad)) + ) + (set! (-> a2-15 rvec quad) v1-75) + (set! (-> a2-15 uvec quad) a0-24) + (set! (-> a2-15 fvec quad) a1-19) + (set! (-> a2-15 trans quad) a3-5) + ) + ) + ) + (set! (-> *camera* settings fov) f30-0) + ) + (remove-setting! 'minimap) + (set! (-> *ACTOR-bank* birth-max) 1000) + (let ((a0-28 (get-continue-by-name *game-info* (-> self node-info reset fail-info retry continue))) + (gp-1 (new 'static 'vector :z 1.0)) + ) + (when a0-28 + (move-camera! a0-28) + (set-vector! + gp-1 + (-> *camera-combiner* inv-camera-rot uvec x) + (-> *camera-combiner* inv-camera-rot uvec y) + (-> *camera-combiner* inv-camera-rot uvec z) + 1.0 + ) + (vector-negate-in-place! gp-1) + (set-setting! 'string-startup-vector 'abs gp-1 0) + ) + ) + (persist-with-delay *setting-control* 'interp-time (seconds 0.5) 'interp-time 'abs 0.0 0) + (remove-setting! 'fov) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + (while (not (process-release? *target*)) + (suspend) + ) + (until #f + (hud-timer-handler self) + (suspend) + ) + #f + ) + ) + +(deftype wascity-burning-bush (des-burning-bush) + () + ) + + +(defskelgroup skel-wascity-burning-bush wascity-burning-bush wascity-burning-bush-lod0-jg wascity-burning-bush-idle-ja + ((wascity-burning-bush-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3.5) + ) + +(defmethod init-from-entity! ((this wascity-burning-bush) (arg0 entity-actor)) + (des-burning-bush-method-32 this) + (process-drawable-from-entity! this arg0) + (des-burning-bush-method-33 this) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-0 0.0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-0) + ) + ) + (set! (-> this rotmin) (res-lump-float arg0 'rotmin :default -5461.3335)) + (set! (-> this rotmax) (res-lump-float arg0 'rotmax :default 5461.3335)) + (set! (-> this task) + (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) + ) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 381) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 382) this)) + (transform-post) + (go (method-of-object this idle)) + ) + +(defmethod des-burning-bush-method-33 ((this wascity-burning-bush)) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-wascity-burning-bush" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + 0 + (none) + ) + +(defmethod des-burning-bush-method-35 ((this wascity-burning-bush)) + (let ((v1-1 (get-current-task-event (-> this task)))) + (let ((a0-4 (-> this entity extra perm))) + (logior! (-> a0-4 status) (entity-perm-status bit-5)) + (set! (-> this bb-perm) a0-4) + (logior! (-> a0-4 status) (entity-perm-status bit-14)) + ) + (cond + ((= (-> this bb-perm user-object 0) 1) + (if (nonzero? (-> v1-1 action)) + (spawn-from-cspace (-> this part) (-> this node-list data 3)) + ) + ) + ((= (-> v1-1 action) (game-task-action show)) + (spawn-from-cspace (-> this part) (-> this node-list data 3)) + ) + ((= (-> v1-1 action) (game-task-action play)) + (spawn-from-cspace (-> this part-off) (-> this node-list data 3)) + ) + ((= (-> v1-1 action) (game-task-action menu)) + (spawn-from-cspace (-> this part-off) (-> this node-list data 3)) + ) + (else + ) + ) + ) + 0 + (none) + ) + +(deftype city-des-burning-bush (des-burning-bush) + () + ) diff --git a/goal_src/jak3/levels/desert/des-bush-part.gc b/goal_src/jak3/levels/desert/des-bush-part.gc index 5c30f47de0..9cc4281e36 100644 --- a/goal_src/jak3/levels/desert/des-bush-part.gc +++ b/goal_src/jak3/levels/desert/des-bush-part.gc @@ -7,3 +7,558 @@ ;; DECOMP BEGINS +(defpartgroup group-spirit-goal + :id 1540 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5114 :flags (sp7)) (sp-item 5115 :flags (sp7))) + ) + +(defpart 5114 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +(defpart 5116 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.6) (meters 1)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 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-bb-ring-finder + :id 1541 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5116 :flags (sp7)) (sp-item 5115 :flags (sp7))) + ) + +(defpart 5117 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:fade-a -0.055555556) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(define *bb-ring-alpha* 50) + +(defpartgroup group-bb-ring-finder-nofade + :id 1542 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5118 :flags (sp7)) (sp-item 5115 :flags (sp7))) + ) + +(defpart 5118 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-bb-ring-fader) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-func-bb-ring-fader ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg2 coneradius) (the float *bb-ring-alpha*)) + (none) + ) + +(defpart 5115 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.5) + (:x (meters 0) (meters 1)) + (:y (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 120.0) + (:a 64.0) + (:vel-x (meters -0.006666667) (meters 0.013333334)) + (:vel-y (meters 0.006666667) (meters 0.0016666667)) + (:vel-z (meters -0.006666667) (meters 0.013333334)) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-score-drop-c + :id 1543 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5123 :flags (sp7)) + (sp-item 5124 :flags (sp6 sp7)) + (sp-item 5125 :flags (sp3) :binding 5119) + (sp-item 5119 :flags (sp2 sp3) :binding 5120) + (sp-item 5125 :flags (sp3) :binding 5121) + (sp-item 5121 :flags (sp2 sp3) :binding 5120) + (sp-item 5125 :flags (sp3) :binding 5122) + (sp-item 5122 :flags (sp2 sp3) :binding 5120) + (sp-item 5120 :flags (sp2)) + (sp-item 5120 :flags (sp2)) + (sp-item 5120 :flags (sp2)) + ) + ) + +(defpart 5123 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0 16.0) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.05) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5126) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5126 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 5124 + :init-specs ((:texture (time-bubble lbbsdrp1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5125 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5119 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:y (meters 2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5121 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:y (meters -2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5122 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5120 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-score-drop-b + :id 1544 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5130 :flags (sp7)) + (sp-item 5131 :flags (sp6 sp7)) + (sp-item 5132 :flags (sp3) :binding 5127) + (sp-item 5127 :flags (sp2 sp3) :binding 5128) + (sp-item 5132 :flags (sp3) :binding 5129) + (sp-item 5129 :flags (sp2 sp3) :binding 5128) + (sp-item 5128 :flags (sp2)) + (sp-item 5128 :flags (sp2)) + ) + ) + +(defpart 5130 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 250.0) + (:g 230.0 20.0) + (:b 16.0 16.0) + (:a 0.0) + (:scalevel-x (meters 0.05) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5133) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5133 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 5131 + :init-specs ((:texture (time-bubble lbbsdrp1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5132 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5127 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5129 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 180)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5128 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-score-drop-a + :id 1545 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5137 :flags (sp7)) + (sp-item 5138 :flags (sp6 sp7)) + (sp-item 5139 :flags (sp3) :binding 5134) + (sp-item 5134 :flags (sp2 sp3) :binding 5135) + (sp-item 5139 :flags (sp3) :binding 5136) + ) + ) + +(defpart 5137 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g :copy r) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.05) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5140) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5140 + :init-specs ((:fade-a -0.85333335)) + ) + +(defpart 5138 + :init-specs ((:texture (time-bubble lbbsdrp1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5139 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5134 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:y (meters 4)) + (:z (meters 0.2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-spirit-explode + :id 1546 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5141 :period (seconds 20) :length (seconds 0.035)) + (sp-item 5142 :period (seconds 20) :length (seconds 0.035)) + ) + ) + +(defpart 5141 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 10.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.2) + (:fade-g -0.53333336) + (:fade-a -1.7 -1.7) + (:friction 0.93) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5142 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.1) + (:fade-g -0.26666668) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) diff --git a/goal_src/jak3/levels/desert/des-bush.gc b/goal_src/jak3/levels/desert/des-bush.gc index af9221c4ce..9872a66359 100644 --- a/goal_src/jak3/levels/desert/des-bush.gc +++ b/goal_src/jak3/levels/desert/des-bush.gc @@ -5,5 +5,2433 @@ ;; name in dgo: des-bush ;; dgos: LBBSDRP1, LBBRING3, LBBRING4, LBBSDRP2, LBBRING2, LBBSPIRT, LBBSPID, LBBRING5, LBBSPRT3, LBBSPRT2, LBBRING1, LBBRING6, LBBSDRP3 +(declare-type desert-chase-ring process) + +;; +++bb-score-type +(defenum bb-score-type + :type uint8 + (small) + (medium) + (large) + ) +;; ---bb-score-type + + ;; DECOMP BEGINS +(define *tex-level-list* + (new 'static 'boxed-array :type symbol 'lbbring1 'lbbring2 'lbbring3 'lbbring4 'lbbring5 'lbbring6) + ) + +(defpartgroup group-desert-ring + :id 1547 + :duration (seconds 218.45) + :linger-duration (seconds 0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5144 :flags (is-3d sp7)) + (sp-item 5144 :flags (is-3d sp7)) + ) + ) + +(defpart 5143 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 80.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90) 1 (degrees 180)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +(defpart 5144 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 12) (meters 1)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.093333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 6.4) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.067)) + (:next-launcher 5145) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +(defpart 5145 + :init-specs ((:fade-a -1.28)) + ) + +(defpartgroup group-desert-ring-final + :id 1548 + :duration (seconds 218.45) + :linger-duration (seconds 0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5147 :flags (is-3d sp7)) + (sp-item 5147 :flags (is-3d sp7)) + ) + ) + +(defpart 5146 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 64.0) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90) 1 (degrees 180)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +(defpart 5147 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 12) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 10.0) + (:a 0.0) + (:scalevel-x (meters -0.093333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 6.4) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.067)) + (:next-launcher 5148) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +(defpart 5148 + :init-specs ((:fade-a -1.28)) + ) + +(defpartgroup group-desert-ring-explode + :id 1549 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5149 :flags (sp3 sp7)) (sp-item 5150 :flags (sp6 sp7))) + ) + +(defpart 5149 + :init-specs ((:texture (middot level-default-sprite)) + (:num 200.0) + (:x (meters 5.8)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 80.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 0.225)) + (:vel-x (meters 0.06666667) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5150 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 36)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 120.0) + (:a 20.0) + (:fade-r -17.0) + (:fade-g -8.5) + (:fade-b 0.0) + (:fade-a -0.6666667) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-x (degrees -90)) + ) + ) + +(defpartgroup group-desert-ring-explode-final + :id 1550 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5151 :flags (sp3 sp7)) (sp-item 5152 :flags (sp6 sp7))) + ) + +(defpart 5151 + :init-specs ((:texture (middot level-default-sprite)) + (:num 200.0) + (:x (meters 5.8)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 64.0) + (:omega (degrees 0.225)) + (:vel-x (meters 0.06666667) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5152 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 36)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 120.0) + (:a 20.0) + (:fade-r -17.0) + (:fade-g -8.5) + (:fade-b 0.0) + (:fade-a -0.6666667) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-x (degrees -90)) + ) + ) + +(defpartgroup group-desert-ring-birth + :id 1551 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5153 :flags (is-3d sp3 sp6 sp7)) (sp-item 5150 :flags (sp6 sp7))) + ) + +(defpart 5153 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:r 40.0) + (:g 80.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.1)) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:timer (seconds 0.4)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +(defpartgroup group-desert-ring-birth-final + :id 1552 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5154 :flags (is-3d sp3 sp6 sp7)) (sp-item 5152 :flags (sp6 sp7))) + ) + +(defpart 5154 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 64.0) + (:scalevel-x (meters 0.1)) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:timer (seconds 0.4)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +(defun find-level-name () + (dotimes (gp-0 (-> *tex-level-list* length)) + (let ((v1-3 (level-get *level* (-> *tex-level-list* gp-0)))) + (if v1-3 + (return v1-3) + ) + ) + ) + (the-as level #f) + ) + +;; WARN: Return type mismatch texture-id vs none. +(defun set-ring-particle-texture () + (let ((gp-0 (find-level-name))) + (when gp-0 + (set! (-> *part-id-table* 5143 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + (set! (-> *part-id-table* 5146 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + (set! (-> *part-id-table* 5153 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + (set! (-> *part-id-table* 5154 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + ) + ) + (none) + ) + +(define *des-ring-times* + (the-as (array (array float)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type float + 11.0 + 9.0 + 9.0 + 8.0 + 7.0 + 11.0 + 8.0 + 8.0 + 10.0 + 8.0 + 12.0 + 9.0 + 10.0 + 9.0 + 10.0 + 13.0 + 11.0 + 12.0 + 10.0 + 10.0 + 10.0 + 10.0 + 8.0 + 9.0 + 13.0 + 10.0 + 12.0 + 10.0 + 6.0 + 8.0 + 9.0 + 11.0 + 10.0 + 11.0 + 10.0 + 11.0 + 15.0 + 14.0 + 9.0 + 15.0 + 10.0 + 13.0 + 9.0 + 13.0 + 8.0 + 7.0 + ) + (new 'static 'boxed-array :type float + 11.0 + 5.2133 + 5.2066 + 5.8266 + 5.0 + 5.0 + 5.0 + 5.0 + 8.0 + 5.0 + 5.0 + 7.0 + 9.0 + 8.0 + 4.0 + 4.0 + 5.0 + 10.0 + 11.0 + 10.0 + ) + (new 'static 'boxed-array :type float + 11.0 + 4.0 + 4.0 + 3.0 + 3.0 + 6.0 + 3.0 + 4.0 + 5.0 + 7.0 + 5.0 + 4.0 + 6.0 + 6.0 + 3.0 + 4.0 + 6.0 + 3.0 + 5.0 + 4.0 + 4.0 + 9.0 + 5.0 + 9.0 + ) + (new 'static 'boxed-array :type float 11.0 6.0 7.0 8.0 5.0 5.0 7.0 6.0 5.0 5.0 5.0 6.0 8.0 7.0 6.0 6.0 8.0) + (new 'static 'boxed-array :type float + 11.0 + 5.0 + 4.0 + 5.0 + 5.0 + 5.0 + 5.0 + 6.0 + 6.0 + 6.0 + 5.0 + 6.0 + 6.0 + 5.0 + 6.0 + 6.0 + 6.0 + 4.0 + 6.0 + 7.0 + 5.0 + 5.0 + 7.0 + 6.0 + 6.0 + 5.0 + 5.0 + 4.0 + ) + (new 'static 'boxed-array :type float + 11.0 + 6.0 + 5.0 + 7.0 + 8.0 + 4.0 + 3.0 + 4.0 + 5.0 + 5.0 + 5.0 + 5.0 + 5.0 + 6.0 + 5.0 + 7.0 + 7.0 + 4.0 + 5.0 + 5.0 + 6.0 + 7.0 + 4.0 + 4.0 + 7.0 + 5.0 + 5.0 + 5.0 + 4.0 + 4.0 + 7.0 + 5.0 + 7.0 + 7.0 + 7.0 + 7.0 + 4.0 + 7.0 + ) + ) + ) + ) + +(deftype task-manager-desert-bbush-ring (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (current-ring int32) + ) + (:methods + (task-manager-desert-bbush-ring-method-32 (_type_) none) + (task-manager-desert-bbush-ring-method-33 (_type_) none) + ) + ) + + +(defstate resolution (task-manager-desert-bbush-ring) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring)) + "t-manager-1" + (none) + ) + +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring)) + (cond + ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'music 'wasring 0.0 0) + ) + (else + (set-setting! 'extra-bank '((desert2 bbush1) (nest2 bbush1)) 0.0 0) + (set-setting! 'music 'desring 0.0 0) + ) + ) + 0 + (none) + ) + +(define *bb-fail* + (new 'static 'resetter-params + :flags (resetter-flag auto-reset text-message no-audio no-slow-down) + :fail (new 'static 'resetter-spec :continue "wasstada-jump-training" :reset-mode 'life :execute #f) + :retry (new 'static 'resetter-spec :continue #f :reset-mode 'try :execute #f) + :reset-delay (seconds 1) + ) + ) + +(defmethod set-time-limit ((this task-manager-desert-bbush-ring)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (format 0 "actor-group-count: ~d~%" (-> this actor-group-count)) + (set! (-> this current-ring) 0) + (task-manager-desert-bbush-ring-method-33 this) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((a0-8 (entity-by-name (the-as string (task-manager-desert-bbush-ring-method-32 this))))) + (when a0-8 + (set! (-> this entity) (the-as entity-actor a0-8)) + (set! sv-16 (new 'static 'res-tag)) + (let ((s5-2 (res-lump-data a0-8 'actor-groups pointer :tag-ptr (& sv-16)))) + (format 0 "elt-count: ~d" (-> sv-16 elt-count)) + (cond + ((and s5-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) s5-2)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod hud-timer-handler ((this task-manager-desert-bbush-ring)) + (with-pp + (cond + ((and *target* + (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (focus-test? *target* pilot-riding) + ) + (when (nonzero? (-> this start-time)) + (let ((v1-8 (handle->process (-> this hud-timer)))) + (if (and *target* (not v1-8)) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to *target*)) + ) + ) + ) + (let ((v1-18 (- (-> this time-limit) (- (current-time) (-> this start-time))))) + (let ((a0-21 *game-info*)) + (set! (-> a0-21 timer) v1-18) + (set! (-> a0-21 timer-flash) (< v1-18 (seconds 10))) + ) + (cond + ((< v1-18 0) + (format #t "speed: ~f~%" (* 0.00024414062 (vector-length (-> *target* control transv)))) + (cond + ((< (vector-length (-> *target* control transv)) 1966.08) + (process-release? *target*) + (if *debug-segment* + (format #t "task failed: ran out of time~%") + ) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (let ((v1-41 (-> this actor-group 0 data (-> this current-ring)))) + (when v1-41 + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'fail) + (let ((t9-8 send-event-function) + (v1-42 (-> v1-41 actor)) + ) + (t9-8 + (if v1-42 + (-> v1-42 extra process) + ) + a1-9 + ) + ) + ) + ) + ) + (go (method-of-object this fail) (on-fail this 'fail)) + ) + (else + (set! (-> this time-limit) (- (current-time) (-> this start-time))) + (process-grab? *target* #f) + ) + ) + ) + (else + (process-release? *target*) + ) + ) + ) + ) + ) + (else + (call-parent-method this) + ) + ) + 0 + (none) + ) + ) + +(defstate active (task-manager-desert-bbush-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (('ring-hit) + (+! (-> self current-ring) 1) + (cond + ((< (-> self current-ring) (length (-> self actor-group 0))) + (let ((gp-1 (-> self actor-group 0 data (-> self current-ring)))) + (when gp-1 + (cond + ((= (+ (length (-> self actor-group 0)) -1) (-> self current-ring)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger-final) + (let ((t9-3 send-event-function) + (v1-17 (-> gp-1 actor)) + ) + (t9-3 + (if v1-17 + (-> v1-17 extra process) + ) + a1-2 + ) + ) + ) + ) + (else + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'trigger) + (let ((t9-4 send-event-function) + (v1-23 (-> gp-1 actor)) + ) + (t9-4 + (if v1-23 + (-> v1-23 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (* 300.0 (-> *des-ring-times* (-> self info index) (-> self current-ring))))) + ) + 0 + ) + ) + ) + (else + (send-event self 'complete) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (* 300.0 (-> *des-ring-times* (-> self info index) 0)))) + ) + ) + :exit (behavior () + (process-release? *target*) + (let ((t9-2 (-> (find-parent-state) exit))) + (if t9-2 + (t9-2) + ) + ) + 0 + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (hud-timer-handler self) + ) + :code (behavior () + (suspend) + (when (nonzero? (-> self actor-group-count)) + (let ((v1-4 (-> self actor-group 0 data))) + (when v1-4 + (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) 'trigger) + (let ((t9-0 send-event-function) + (v1-5 (-> v1-4 0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + 0 + ) + ) + ) + (until #f + (suspend) + ) + #f + ) + ) + +(defstate fail (task-manager-desert-bbush-ring) + :virtual #t + :enter (behavior ((arg0 resetter-params)) + (kill-by-type desert-chase-ring *active-pool*) + ) + ) + +(deftype task-manager-desert-bbush-ring-2 (task-manager-desert-bbush-ring) + () + ) + + +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-2)) + "t-manager-10" + (none) + ) + +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring-2)) + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + (set-setting! 'music 'desring 0.0 0) + 0 + (none) + ) + +(deftype task-manager-desert-bbush-ring-3 (task-manager-desert-bbush-ring) + () + ) + + +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-3)) + (format 0 "tag1~%") + "t-manager-2" + (none) + ) + +(deftype task-manager-desert-bbush-ring-4 (task-manager-desert-bbush-ring) + () + ) + + +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-4)) + (format 0 "tag1~%") + "t-manager-6" + (none) + ) + +(deftype task-manager-desert-bbush-ring-5 (task-manager-desert-bbush-ring) + () + ) + + +(defmethod init! ((this task-manager-desert-bbush-ring-5)) + (set-setting! 'use-alternate-bouncer? #t 0.0 0) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-5)) + (format 0 "tag1~%") + "t-manager-7" + (none) + ) + +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring-5)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'cityring 0.0 0) + 0 + (none) + ) + +(deftype task-manager-desert-bbush-ring-6 (task-manager-desert-bbush-ring) + () + ) + + +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring-6)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'cityring 0.0 0) + 0 + (none) + ) + +(defmethod init! ((this task-manager-desert-bbush-ring-6)) + (set-setting! 'use-alternate-bouncer? #t 0.0 0) + (call-parent-method this) + (none) + ) + +(define *bbush-ring-6-kg-squad-member-settings* (new 'static 'squad-unit-settings + :target-count 14 + :shot-count #x7f + :inaccuracy (the-as float #x6) + :rand-shot-delay (seconds 108.42) + ) + ) + +(defmethod set-time-limit ((this task-manager-desert-bbush-ring-6)) + (set-setting! 'kg-enemy-settings #f 0.0 *bbush-ring-6-kg-squad-member-settings*) + (call-parent-method this) + (none) + ) + +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-6)) + (format 0 "tag1~%") + "t-manager-8" + (none) + ) + +(deftype desert-chase-ring (process-drawable) + ((mat matrix :inline) + (taskman handle) + (turbo-handle handle) + (alt-actor entity-actor) + (ring-radius float) + (minimap connection-minimap) + (is-final? symbol) + (part-final sparticle-launch-control) + ) + (:state-methods + dormant + idle + die + ) + (:methods + (alloc-trsqv! (_type_) none) + ) + ) + + +(defun desert-chase-ring-cleared? ((arg0 vector) (arg1 vector) (arg2 desert-chase-ring)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (and (< (fabs (vector-dot (vector-x-quaternion! s5-0 (the-as quaternion arg0)) arg1)) (-> arg2 ring-radius)) + (< (fabs (vector-dot (vector-y-quaternion! s5-0 (the-as quaternion arg0)) arg1)) (-> arg2 ring-radius)) + (< (fabs (vector-dot (vector-z-quaternion! s5-0 (the-as quaternion arg0)) arg1)) 4096.0) + ) + ) + ) + +(defmethod run-logic? ((this desert-chase-ring)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +(defstate dormant (desert-chase-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (if (type? proc task-manager-desert-bbush-ring) + (set! (-> self taskman) (process->handle proc)) + ) + (go-virtual idle) + ) + (('trigger-final) + (when (type? proc task-manager-desert-bbush-ring) + (set! (-> self is-final?) #t) + (set! (-> self taskman) (process->handle proc)) + ) + (go-virtual idle) + ) + ) + ) + :trans (behavior () + 0 + ) + :code sleep-code + :post (behavior () + 0 + ) + ) + +(defstate idle (desert-chase-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fail) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (go-virtual die) + ) + ) + ) + :enter (behavior () + (cond + ((-> self is-final?) + (if (logtest? (-> *part-group-id-table* 1552 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1552) + :mat-joint (-> self mat) + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1552) :mat-joint (-> self mat)) + ) + ) + ((logtest? (-> *part-group-id-table* 1551 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1551) + :mat-joint (-> self mat) + ) + ) + (else + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1551) :mat-joint (-> self mat)) + ) + ) + (sound-play "ring-create") + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) + (when (-> self alt-actor) + (format 0 "setting-up turbo~%") + (turbo-pickup-spawn (-> self alt-actor extra trans)) + ) + ) + :trans (behavior () + (let ((v1-0 *target*) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (when v1-0 + (cond + ((focus-test? v1-0 pilot) + (let ((a2-1 (handle->process (-> v1-0 pilot vehicle)))) + (set! (-> a1-0 quad) (-> (the-as vehicle a2-1) root root-prim prim-core world-sphere quad)) + ) + ) + (else + (set! (-> a1-0 quad) (-> v1-0 control trans quad)) + (+! (-> a1-0 y) 12288.0) + ) + ) + (vector-! a1-0 a1-0 (-> self root trans)) + (let ((a0-12 (-> self root quat))) + (when (desert-chase-ring-cleared? (the-as vector a0-12) a1-0 self) + (if (-> self is-final?) + (sound-play "ring-final") + (sound-play "ring-pass") + ) + (send-event (handle->process (-> self taskman)) 'ring-hit) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (cond + ((-> self is-final?) + (if (logtest? (-> *part-group-id-table* 1550 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1550) + :mat-joint (-> self mat) + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1550) :mat-joint (-> self mat)) + ) + ) + ((logtest? (-> *part-group-id-table* 1549 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1549) + :mat-joint (-> self mat) + ) + ) + (else + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1549) :mat-joint (-> self mat)) + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.4)) + (cond + ((-> self is-final?) + (if (nonzero? (-> self part-final)) + (spawn-from-mat (-> self part-final) (-> self mat)) + ) + ) + (else + (if (nonzero? (-> self part)) + (spawn-from-mat (-> self part) (-> self mat)) + ) + ) + ) + ) + ) + ) + +(defstate die (desert-chase-ring) + :virtual #t + :code (behavior () + (kill-callback (-> *minimap* engine) (-> self minimap)) + (while (-> self child) + (suspend) + ) + (go-virtual dormant) + ) + ) + +;; og:preserve-this duplicate +; (defmethod run-logic? ((this desert-chase-ring)) +; "Should this process be run? Checked by execute-process-tree." +; #t +; ) + +(defmethod alloc-trsqv! ((this desert-chase-ring)) + (set! (-> this root) (new 'process 'trsqv)) + 0 + (none) + ) + +(defmethod relocate ((this desert-chase-ring) (offset int)) + (if (nonzero? (-> this part-final)) + (&+! (-> this part-final) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this desert-chase-ring)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part-final)) + (kill-particles (-> this part-final)) + ) + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this desert-chase-ring) (arg0 entity-actor)) + (set-ring-particle-texture) + (alloc-trsqv! this) + (process-drawable-from-entity! this arg0) + (set! (-> this ring-radius) (res-lump-float arg0 'ring-radius :default 24576.0)) + (quaternion->matrix (-> this mat) (-> this root quat)) + (set! (-> this mat trans quad) (-> this root trans quad)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1547) this)) + (set! (-> this part-final) (create-launch-control (-> *part-group-id-table* 1548) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this is-final?) #f) + (go (method-of-object this dormant)) + ) + +(deftype spirit (process-drawable) + ((part-subsampler sparticle-subsampler) + (sound-id sound-id) + (sound-id-2 sound-id) + (play-pixie? symbol) + (goal-part sparticle-launch-control) + (draw-start-goal? symbol) + ) + (:state-methods + idle + dormant + explode + ) + ) + + +(defstate explode (spirit) + :virtual #t + :enter (behavior () + (cond + ((logtest? (-> *part-group-id-table* 1546 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1546)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1546)) + ) + ) + ) + :code sleep-code + ) + +(defstate dormant (spirit) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-1) quad)) + v0-0 + ) + ) + (('play-pixie) + (go-virtual idle) + ) + (('goal) + (go-virtual explode) + ) + ) + ) + :trans (behavior () + (sound-play "magic-trail" :id (-> self sound-id-2)) + (spawn (-> self goal-part) (-> self root trans)) + ) + :code sleep-code + ) + +(defstate idle (spirit) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-1) quad)) + v0-0 + ) + ) + (('play-pixie) + (set! (-> self play-pixie?) #t) + (set! (-> self draw-start-goal?) #f) + #f + ) + (('goal-state) + (set! (-> self draw-start-goal?) #t) + (go-virtual dormant) + ) + ) + ) + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (init-with-vec! (-> self part-subsampler) (-> self root trans)) + (sound-play "magic-trail" :id (-> self sound-id-2)) + (sound-play-by-name + (static-sound-name "flying-pixie") + (-> self sound-id) + 1024 + (the int (* 1524.0 (doppler-pitch-shift (-> self root trans) (-> self root transv)))) + 0 + (sound-group) + #t + ) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch process-drawable vs spirit. +(defmethod relocate ((this spirit) (offset int)) + (if (nonzero? (-> this part-subsampler)) + (&+! (-> this part-subsampler) offset) + ) + (if (nonzero? (-> this goal-part)) + (&+! (-> this goal-part) offset) + ) + (the-as spirit ((method-of-type process-drawable relocate) this offset)) + ) + +(defmethod deactivate ((this spirit)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this goal-part)) + (kill-particles (-> this goal-part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defbehavior spirit-init-by-other spirit ((arg0 vector)) + (set! (-> self play-pixie?) #f) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self sound-id) (new-sound-id)) + (set! (-> self sound-id-2) (new-sound-id)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1541) self)) + self + (set! (-> self part-subsampler) + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 5117) 3.0) + ) + (set! (-> self goal-part) (create-launch-control (-> *part-group-id-table* 1540) self)) + (set! (-> self draw-start-goal?) #t) + (go-virtual dormant) + ) + +(deftype hud-spider-killed (hud-goal) + () + ) + + +(defmethod draw ((this hud-spider-killed)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 65 125) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-spider-killed)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-spider-killed)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) + (let ((s5-0 format) + (gp-1 (clear (-> this strings 1 text))) + (s4-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-07f6) #f)) + (s5-0 gp-1 s4-0 *temp-string*) + ) + 0 + (none) + ) + +(deftype task-manager-bbush-egg-spider (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (goal-score uint32) + (hud-score handle) + (hud-goal handle) + ) + (:methods + (task-manager-bbush-egg-spider-method-32 (_type_) none) + ) + ) + + +(defstate resolution (task-manager-bbush-egg-spider) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +(defmethod task-manager-method-25 ((this task-manager-bbush-egg-spider)) + (dotimes (s5-0 44) + (let ((s4-0 (-> *vehicle-info* handle-by-vehicle-type s5-0))) + (when (handle->process s4-0) + (send-event (handle->process s4-0) 'ignore-damage #f) + (send-event (handle->process s4-0) 'ignore-impulse #f) + ) + ) + ) + ((method-of-type task-manager task-manager-method-25) this) + (none) + ) + +(defmethod task-manager-bbush-egg-spider-method-32 ((this task-manager-bbush-egg-spider)) + (set-setting! 'extra-bank '((desert2 bbush2)) 0.0 0) + (set-setting! 'music 'despider 0.0 0) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod set-time-limit ((this task-manager-bbush-egg-spider)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'string-max-height 'abs (meters 8) 0) + (set-setting! 'string-max-length 'abs (meters 24) 0) + (set-setting! 'string-min-height 'abs (meters 6) 0) + (set-setting! 'string-min-length 'abs (meters 20) 0) + (adjust-player-ammo 5000.0 (pickup-type ammo-yellow)) + (adjust-player-ammo 5000.0 (pickup-type ammo-red)) + (adjust-player-ammo 5000.0 (pickup-type ammo-blue)) + (adjust-player-ammo 5000.0 (pickup-type ammo-dark)) + (set-setting! 'pilot #f 0.0 0) + (set-setting! 'gun-special-mode #t 0.0 0) + (task-manager-bbush-egg-spider-method-32 this) + (let ((s5-0 (entity-by-name "tmanager-4"))) + (when s5-0 + (set! (-> this entity) (the-as entity-actor s5-0)) + (set! (-> this goal-score) + (res-lump-value s5-0 'goal-score uint :default (the-as uint128 80) :time -1000000000.0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-20 (res-lump-data s5-0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-20 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-20)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (set! (-> this hud-score) + (ppointer->handle + (process-spawn hud-spider-killed :init hud-init-by-other :name "hud-spider-killed" :to this) + ) + ) + (set! (-> this hud-goal) + (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :name "hud-goal" :to this)) + ) + (set! (-> *game-info* goal) (the float (-> this goal-score))) + (set! (-> *game-info* score) 0.0) + (none) + ) + +(defstate active (task-manager-bbush-egg-spider) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) (seconds 60)) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'count-death) + (let* ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data 0 actor)) + (v1-7 (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + (set! (-> *game-info* score) (the float v1-7)) + (if (= v1-7 (-> self goal-score)) + (send-event self 'complete) + ) + ) + ) + (hud-timer-handler self) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (until #f + (dotimes (v1-2 44) + (let ((gp-0 (-> *vehicle-info* handle-by-vehicle-type v1-2))) + (when (handle->process gp-0) + (send-event (handle->process gp-0) 'ignore-damage #t) + (send-event (handle->process gp-0) 'ignore-impulse #t) + (goto cfg-27) + ) + ) + ) + (suspend) + ) + #f + (until #f + (label cfg-27) + (suspend) + ) + #f + ) + ) + +(deftype task-manager-bbush-spirit-chase (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (path-pos float) + (trans vector :inline) + (touched symbol) + (spirit handle) + (current-curve-distance float) + (current-curve-length float) + (min-spirit-vel float) + (current-spirit-vel float) + (high-spirit-vel float) + (fail-radius float) + (chase-distance float) + (start-offset-vel float) + (sound-id sound-id) + ) + (:methods + (get-entity-name (_type_) string) + (task-manager-bbush-spirit-chase-method-33 (_type_) float) + (task-manager-bbush-spirit-chase-method-34 (_type_) float) + (set-sbanks (_type_) none) + ) + ) + + +(defstate resolution (task-manager-bbush-spirit-chase) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-38 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 + (ppointer->handle + (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (set-time! (-> self state-time)) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (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) + ) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-38 (or (handle->process (-> self arrow)) (begin + (countdown (v1-39 4) + (when (handle->process (-> self hud v1-39)) + (set! v1-38 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-38 + ) + (suspend) + ) + ) + ) + +(defmethod set-sbanks ((this task-manager-bbush-spirit-chase)) + (cond + ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'music 'waspirit 0.0 0) + ) + (else + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + (set-setting! 'music 'despirit 0.0 0) + ) + ) + 0 + (none) + ) + +(defmethod get-entity-name ((this task-manager-bbush-spirit-chase)) + "tmanager-5" + ) + +(defmethod task-manager-bbush-spirit-chase-method-33 ((this task-manager-bbush-spirit-chase)) + 4096.0 + ) + +(defmethod task-manager-bbush-spirit-chase-method-34 ((this task-manager-bbush-spirit-chase)) + 655360.0 + ) + +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-bbush-spirit-chase)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this path-pos) 0.0) + (set! (-> this touched) #f) + (set! (-> this spirit) (ppointer->handle (process-spawn spirit *null-vector* :name "spirit" :to this))) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((s5-2 (entity-by-name (get-entity-name this)))) + (when s5-2 + (set! (-> this min-spirit-vel) (res-lump-float s5-2 'min-spirit-vel :default 163840.0)) + (set! (-> this high-spirit-vel) (res-lump-float s5-2 'high-spirit-vel :default 163840.0)) + (set! (-> this fail-radius) (res-lump-float s5-2 'fail-radius :default 655360.0)) + (set! (-> this chase-distance) (res-lump-float s5-2 'chase-distance :default 102400.0)) + (set! (-> this start-offset-vel) (res-lump-float s5-2 'start-offset-vel :default 20480.0)) + (format #t "new-vel: ~f~%" (* 0.00024414062 (-> this start-offset-vel))) + (set! (-> this entity) (the-as entity-actor s5-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-19 (res-lump-data s5-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-19 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-19)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (set-sbanks this) + (set! (-> this sound-id) (new 'static 'sound-id)) + (set! (-> this current-spirit-vel) (-> this min-spirit-vel)) + (format #t "min-spirit-vel: ~f~%" (* 0.00024414062 (-> this min-spirit-vel))) + (none) + ) + +(defstate active (task-manager-bbush-spirit-chase) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) (seconds 60)) + (set! (-> self current-curve-distance) 1.0) + (set! (-> self current-curve-distance) 0.0) + ) + :trans (behavior () + (local-vars (sv-240 vector) (sv-256 vector) (sv-272 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (nonzero? (-> self actor-group)) + (dotimes (gp-0 (+ (length (-> self actor-group 0)) -1)) + (cond + ((and (>= (-> self path-pos) (the float gp-0)) (>= (the float (+ gp-0 1)) (-> self path-pos))) + (let ((v1-7 (-> self actor-group 0 data gp-0)) + (a1-2 (-> self actor-group 0 data (+ gp-0 1))) + ) + (when (and v1-7 a1-2) + (let ((s3-0 (-> v1-7 actor)) + (s5-0 (-> a1-2 actor)) + (s4-0 (new 'stack 'cubic-curve)) + ) + (new 'stack-no-clear 'vector) + (when (and s3-0 s5-0) + (let ((s2-0 s4-0) + (s1-0 (method-of-type cubic-curve cubic-curve-method-9)) + (s0-0 (-> s3-0 trans)) + ) + (set! sv-240 (new 'stack-no-clear 'vector)) + (let ((v0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (f0-3 204800.0) + ) + (.lvf vf1 (&-> v0-1 quad)) + (let ((v1-14 f0-3)) + (.mov vf2 v1-14) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-240 quad) vf1) + (set! sv-256 (-> s5-0 trans)) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let ((v0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-0 quat))) + (f0-4 204800.0) + ) + (.lvf vf1 (&-> v0-2 quad)) + (let ((v1-19 f0-4)) + (.mov vf2 v1-19) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-272 quad) vf1) + (s1-0 s2-0 s0-0 sv-240 sv-256 sv-272) + ) + (set! (-> self current-curve-length) (vector-vector-distance (-> s3-0 trans) (-> s5-0 trans))) + (cubic-curve-method-10 s4-0 (-> self trans) (- (-> self path-pos) (the float gp-0))) + (cond + ((not (time-elapsed? (-> self state-time) (seconds 4))) + (let ((f0-9 (+ (vector-length (-> *target* control transv)) (-> self start-offset-vel)))) + (seek! (-> self current-spirit-vel) f0-9 (* 0.5 (seconds-per-frame) (-> self high-spirit-vel))) + ) + ) + ((< (vector-vector-distance (target-pos 0) (-> s5-0 trans)) + (+ (vector-vector-distance (-> self trans) (-> s5-0 trans)) (-> self chase-distance)) + ) + (let ((f0-17 (fmax (vector-length (-> *target* control transv)) (-> self high-spirit-vel)))) + (seek! (-> self current-spirit-vel) (-> self high-spirit-vel) (* 0.5 (seconds-per-frame) f0-17)) + ) + ) + (else + (seek! + (-> self current-spirit-vel) + (-> self min-spirit-vel) + (* 0.5 (seconds-per-frame) (-> self high-spirit-vel)) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> self current-curve-distance) 0.0) + ) + ) + ) + ) + (send-event (handle->process (-> self spirit)) 'trans (-> self trans)) + (cond + ((-> self touched) + (+! (-> self current-curve-distance) (* (-> self current-spirit-vel) (seconds-per-frame))) + (+! (-> self path-pos) (/ (-> self current-curve-distance) (-> self current-curve-length))) + (when (< (the float (+ (length (-> self actor-group 0)) -1)) (-> self path-pos)) + (set! (-> self path-pos) (the float (+ (length (-> self actor-group 0)) -1))) + (send-event (handle->process (-> self spirit)) 'goal-state) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel bbush) (gui-action queue) "miss001" -99.0 0) + ) + (when (< (vector-vector-distance (target-pos 0) (-> self trans)) 20480.0) + (send-event (handle->process (-> self spirit)) 'goal) + (send-event self 'complete) + ) + ) + (let ((f0-36 (-> self fail-radius))) + (if (< (* f0-36 f0-36) (vector-vector-distance-squared (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + ) + ) + (else + (set-time! (-> self state-time)) + (let ((f0-39 (vector-vector-distance-squared (target-pos 0) (-> self trans))) + (f1-23 20480.0) + ) + (when (< f0-39 (* f1-23 f1-23)) + (set! (-> self touched) #t) + (sound-play "start-pickup") + (send-event (handle->process (-> self spirit)) 'play-pixie) + ) + ) + (if (< 409600.0 (vector-vector-distance (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +(deftype task-manager-bbush-spirit-chase-2 (task-manager-bbush-spirit-chase) + () + ) + + +(defmethod get-entity-name ((this task-manager-bbush-spirit-chase-2)) + (format 0 "tag1~%") + "t-manager-4" + ) + +(defmethod task-manager-bbush-spirit-chase-method-33 ((this task-manager-bbush-spirit-chase-2)) + 18.0 + ) + +(defmethod task-manager-bbush-spirit-chase-method-34 ((this task-manager-bbush-spirit-chase-2)) + 163840.0 + ) + +(deftype task-manager-bbush-spirit-chase-3 (task-manager-bbush-spirit-chase) + () + ) + + +(defmethod get-entity-name ((this task-manager-bbush-spirit-chase-3)) + (format 0 "tag1~%") + "t-manager-5" + ) + +(defmethod set-sbanks ((this task-manager-bbush-spirit-chase-3)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'ctysprit 0.0 0) + 0 + (none) + ) + +(defmethod task-manager-bbush-spirit-chase-method-33 ((this task-manager-bbush-spirit-chase-3)) + 94208.0 + ) + +(defmethod task-manager-bbush-spirit-chase-method-34 ((this task-manager-bbush-spirit-chase-3)) + 163840.0 + ) + +(deftype bb-score-a-pickup (process-hidden) + () + ) + + +(deftype bb-score-b-pickup (process-hidden) + () + ) + + +(deftype bb-score-c-pickup (process-hidden) + () + ) + + +(defun-debug bb-score-type->string ((arg0 bb-score-type)) + (case arg0 + (((bb-score-type large)) + "large" + ) + (((bb-score-type small)) + "small" + ) + (((bb-score-type medium)) + "medium" + ) + (else + "*unknown*" + ) + ) + ) + +(deftype score-drop (process-drawable) + ((src vector :inline) + (dst vector :inline) + (pickup-radius float) + (score uint32) + (score-pickup-radius float) + (bb-score-type bb-score-type) + (traj trajectory :inline) + ) + (:state-methods + idle + dormant + die + ) + ) + + +(defstate dormant (score-drop) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (set! (-> self src quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self dst quad) (-> self root trans quad)) + (setup-from-to-duration! (-> self traj) (-> self src) (-> self dst) 300.0 -4.551111) + (go-virtual idle) + ) + ) + ) + :trans (behavior () + (add-debug-sphere #t (bucket-id debug) (-> self dst) (meters 1) *color-green*) + (add-debug-sphere #t (bucket-id debug) (-> self root trans) (meters 2) *color-red*) + ) + :code sleep-code + ) + +(defstate idle (score-drop) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v0-0 (-> self src quad))) + (set! (-> self root trans quad) v0-0) + ) + ) + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (/ (the float (- (current-time) (-> self state-time))) (-> self traj time)) + (let ((f0-3 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-1 (-> self pickup-radius)) + ) + (when (< f0-3 (* f1-1 f1-1)) + (send-event (ppointer->process (-> self parent)) 'score (-> self score)) + (case (-> self bb-score-type) + (((bb-score-type small)) + (sound-play "small-pickup") + ) + (((bb-score-type medium)) + (sound-play "medium-pickup") + ) + (((bb-score-type large)) + (sound-play "large-pickup") + ) + ) + (go-virtual die) + ) + ) + ) + :code (behavior () + (until #f + (compute-trans-at-time + (-> self traj) + (fmin (the float (- (current-time) (-> self state-time))) (-> self traj time)) + (-> self root trans) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +(defstate die (score-drop) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +(defmethod deactivate ((this score-drop)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this score-drop) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +(defbehavior score-drop-init-by-other score-drop ((arg0 entity-actor)) + (process-entity-set! self arg0) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (cond + ((= (-> arg0 etype) bb-score-a-pickup) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1545) self)) + (set! (-> self bb-score-type) (bb-score-type small)) + 0 + ) + ((= (-> arg0 etype) bb-score-b-pickup) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1544) self)) + (set! (-> self bb-score-type) (bb-score-type medium)) + ) + (else + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1543) self)) + (set! (-> self bb-score-type) (bb-score-type large)) + ) + ) + (set! (-> self pickup-radius) (res-lump-float arg0 'score-pickup-radius :default 4096.0)) + (format 0 "score-radius: ~f~%" (-> self pickup-radius)) + (set! (-> self score) + (res-lump-value arg0 'score-amount uint :default (the-as uint128 100) :time -1000000000.0) + ) + (go-virtual dormant) + ) + +(deftype task-manager-bbush-spirit-drop (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (path-pos float) + (trans vector :inline) + (touched symbol) + (spirit handle) + (score-drop-handles handle 64) + (score-drop-num int32) + (current-curve-distance float) + (current-curve-length float) + (goal-score uint32) + (current-score uint32) + (score-drop-activation-radius float) + (min-spirit-vel float) + (high-spirit-vel float) + (current-spirit-vel float) + (fail-radius float) + (hud-score handle) + (hud-goal handle) + ) + (:methods + (get-entity-name (_type_) string) + (task-manager-bbush-spirit-drop-method-33 (_type_) float) + (task-manager-bbush-spirit-drop-method-34 (_type_) float) + (task-manager-bbush-spirit-drop-method-35 (_type_) int) + (send-trigger (_type_) symbol) + (spawn-drops (_type_) symbol) + (set-sbanks (_type_) none) + ) + ) + + +(defstate resolution (task-manager-bbush-spirit-drop) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +(defmethod set-sbanks ((this task-manager-bbush-spirit-drop)) + (set-setting! 'extra-bank '((desert2 bbush1) (nest2 bbush1)) 0.0 0) + (set-setting! 'music 'desring 0.0 0) + 0 + (none) + ) + +(defmethod get-entity-name ((this task-manager-bbush-spirit-drop)) + "tmanager-6" + ) + +(defmethod task-manager-bbush-spirit-drop-method-33 ((this task-manager-bbush-spirit-drop)) + 36.0 + ) + +(defmethod task-manager-bbush-spirit-drop-method-34 ((this task-manager-bbush-spirit-drop)) + 655360.0 + ) + +(defmethod task-manager-bbush-spirit-drop-method-35 ((this task-manager-bbush-spirit-drop)) + 100 + ) + +(defmethod spawn-drops ((this task-manager-bbush-spirit-drop)) + (when (-> this actor-group 1) + (set! (-> this score-drop-num) (-> this actor-group 1 length)) + (format 0 "num-drops: ~d~%" (-> this score-drop-num)) + (when (< 1 (-> this actor-group-count)) + (format 0 "activating score-drops~%") + (dotimes (s5-0 (-> this actor-group 1 length)) + (let ((s4-0 (-> this actor-group 1 data s5-0))) + (set! (-> this score-drop-handles s5-0) + (ppointer->handle (process-spawn score-drop (-> s4-0 actor) :name "score-drop" :to this)) + ) + ) + ) + #f + ) + ) + ) + +(defmethod send-trigger ((this task-manager-bbush-spirit-drop)) + (dotimes (s5-0 (-> this score-drop-num)) + (when (handle->process (-> this score-drop-handles s5-0)) + (let ((s4-0 (-> this score-drop-handles s5-0 process 0))) + (if (< (vector-vector-distance (-> (the-as spirit s4-0) root trans) (-> this trans)) + (-> this score-drop-activation-radius) + ) + (send-event s4-0 'trigger (-> this trans)) + ) + ) + ) + ) + #f + ) + +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-bbush-spirit-drop)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this path-pos) 0.0) + (set! (-> this touched) #f) + (set! (-> this spirit) (ppointer->handle (process-spawn spirit *null-vector* :name "spirit" :to this))) + (let ((s5-2 (entity-by-name (get-entity-name this)))) + (when s5-2 + (set! (-> this entity) (the-as entity-actor s5-2)) + (set! (-> this goal-score) + (res-lump-value s5-2 'goal-score uint :default (the-as uint128 200) :time -1000000000.0) + ) + (set! (-> this score-drop-activation-radius) + (res-lump-float s5-2 'score-drop-activation-radius :default 409600.0) + ) + (format 0 "activation-radius: ~f~%" (-> this score-drop-activation-radius)) + (set! (-> this min-spirit-vel) (res-lump-float s5-2 'min-spirit-vel :default 163840.0)) + (set! (-> this high-spirit-vel) (res-lump-float s5-2 'high-spirit-vel :default 163840.0)) + (set! (-> this fail-radius) (res-lump-float s5-2 'fail-radius :default 655360.0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data s5-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-16)) + (spawn-drops this) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (if *cty-attack-controller* + (logior! (-> *cty-attack-controller* target-attacker flags) (city-attacker-info-flag cai3)) + ) + (set-sbanks this) + (set! (-> this hud-score) + (ppointer->handle (process-spawn hud-big-score :init hud-init-by-other :name "hud-big-score" :to this)) + ) + (set! (-> this hud-goal) + (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :name "hud-goal" :to this)) + ) + (set! (-> *game-info* goal) (the float (-> this goal-score))) + (set! (-> *game-info* score) 0.0) + (set! (-> this current-score) (the-as uint 0)) + (set! (-> this current-spirit-vel) (-> this min-spirit-vel)) + (format 0 "num drops: ~d~%" (length (-> this score-drop-handles))) + (none) + ) + +(defstate active (task-manager-bbush-spirit-drop) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (('score) + (let* ((v1-3 (-> block param 0)) + (v0-0 (the-as object (+ (-> self current-score) v1-3))) + ) + (set! (-> self current-score) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) (seconds 60)) + (set! (-> self current-curve-distance) 1.0) + (set! (-> self current-curve-distance) 0.0) + ) + :exit (behavior () + (if *cty-attack-controller* + (logclear! (-> *cty-attack-controller* target-attacker flags) (city-attacker-info-flag cai3)) + ) + ) + :trans (behavior () + (local-vars (sv-240 vector) (sv-256 vector) (sv-272 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> *game-info* score) (the float (-> self current-score))) + (when (nonzero? (-> self actor-group)) + (dotimes (gp-0 (+ (length (-> self actor-group 0)) -1)) + (cond + ((and (>= (-> self path-pos) (the float gp-0)) (>= (the float (+ gp-0 1)) (-> self path-pos))) + (let ((v1-9 (-> self actor-group 0 data gp-0)) + (a1-2 (-> self actor-group 0 data (+ gp-0 1))) + ) + (when (and v1-9 a1-2) + (let ((s3-0 (-> v1-9 actor)) + (s5-0 (-> a1-2 actor)) + (s4-0 (new 'stack 'cubic-curve)) + ) + (new 'stack-no-clear 'vector) + (when (and s3-0 s5-0) + (let ((s2-0 s4-0) + (s1-0 (method-of-type cubic-curve cubic-curve-method-9)) + (s0-0 (-> s3-0 trans)) + ) + (set! sv-240 (new 'stack-no-clear 'vector)) + (let ((v0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (f0-5 204800.0) + ) + (.lvf vf1 (&-> v0-1 quad)) + (let ((v1-16 f0-5)) + (.mov vf2 v1-16) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-240 quad) vf1) + (set! sv-256 (-> s5-0 trans)) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let ((v0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-0 quat))) + (f0-6 204800.0) + ) + (.lvf vf1 (&-> v0-2 quad)) + (let ((v1-21 f0-6)) + (.mov vf2 v1-21) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-272 quad) vf1) + (s1-0 s2-0 s0-0 sv-240 sv-256 sv-272) + ) + (set! (-> self current-curve-length) (vector-vector-distance (-> s3-0 trans) (-> s5-0 trans))) + (cubic-curve-method-10 s4-0 (-> self trans) (- (-> self path-pos) (the float gp-0))) + (cond + ((< (vector-vector-distance (target-pos 0) (-> s5-0 trans)) + (+ 102400.0 (vector-vector-distance (-> self trans) (-> s5-0 trans))) + ) + (let ((f0-13 (fmax (vector-length (-> *target* control transv)) (-> self high-spirit-vel)))) + (seek! (-> self current-spirit-vel) (-> self high-spirit-vel) (* 0.5 (seconds-per-frame) f0-13)) + ) + ) + (else + (seek! + (-> self current-spirit-vel) + (-> self min-spirit-vel) + (* 0.5 (seconds-per-frame) (-> self high-spirit-vel)) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> self current-curve-distance) 0.0) + ) + ) + ) + ) + (send-event (handle->process (-> self spirit)) 'trans (-> self trans)) + (send-trigger self) + (cond + ((-> self touched) + (+! (-> self current-curve-distance) (* (-> self current-spirit-vel) (seconds-per-frame))) + (+! (-> self path-pos) (/ (-> self current-curve-distance) (-> self current-curve-length))) + (when (< (the float (+ (length (-> self actor-group 0)) -1)) (-> self path-pos)) + (set! (-> self path-pos) (the float (+ (length (-> self actor-group 0)) -1))) + (send-event self 'fail) + ) + (if (< (-> self fail-radius) (vector-vector-distance (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + (if (or (< (-> self goal-score) (-> self current-score)) (= (-> self current-score) (-> self goal-score))) + (send-event self 'complete) + ) + ) + (else + (let ((f0-32 (vector-vector-distance-squared (target-pos 0) (-> self trans))) + (f1-17 20480.0) + ) + (when (< f0-32 (* f1-17 f1-17)) + (set! (-> self touched) #t) + (sound-play "start-pickup") + ) + ) + ) + ) + ) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (until #f + (suspend) + ) + #f + ) + ) diff --git a/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc b/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc index 2336c4a4b0..aafced74bd 100644 --- a/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc +++ b/goal_src/jak3/levels/desert/oasis/ash-oasis-course.gc @@ -7,3 +7,475 @@ ;; DECOMP BEGINS +(deftype ashelin-oasis (ashelin) + ((player-in-bounds-time time-frame) + (last-speech-time time-frame) + (last-speech-id int32) + (last-sound-trans vector :inline) + (last-sound-id sound-id) + (minimap connection-minimap) + ) + (:methods + (set-frontline (_type_) none) + (ashelin-oasis-method-263 (_type_ symbol) none) + ) + ) + + +(defmethod go-idle2 ((this ashelin-oasis)) + (go-idle this) + ) + +(defmethod set-frontline ((this ashelin-oasis)) + (let ((a0-1 *target*)) + (when a0-1 + (set! (-> this frontline w) + (- (+ 40960.0 (vector-dot (the-as vector (-> this frontline)) (get-trans a0-1 0)))) + ) + 0 + ) + ) + (none) + ) + +(defstate traveling (ashelin-oasis) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type ashelin traveling) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + ) + ) + +(defstate knocked (ashelin-oasis) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type ashelin knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self root penetrated-by) (penetrate vehicle)) + ) + ) + +(defmethod ashelin-method-256 ((this ashelin-oasis)) + (if (time-elapsed? (-> this last-speech-time) (seconds 10)) + ((method-of-type ashelin ashelin-method-256) this) + ) + (none) + ) + +;; WARN: Return type mismatch time-frame vs gui-connection. +(defmethod play-speech-by-id ((this ashelin-oasis) (arg0 int)) + (let* ((s4-0 (-> this course)) + (s3-0 (-> s4-0 speeches arg0)) + ) + (logior! (-> s3-0 flags) (bot-speech-info-flag playing)) + (let* ((t2-0 (-> s3-0 hold-time)) + (s5-0 (add-process + *gui-control* + this + (-> this channel) + (gui-action play) + (-> s3-0 name) + -99.0 + (the-as time-frame t2-0) + ) + ) + ) + (let ((v1-5 (-> s4-0 speech-tunings (-> s3-0 tuning-id)))) + (sound-params-set! + *gui-control* + s5-0 + (-> v1-5 trans?) + (-> v1-5 fo-min) + (-> v1-5 fo-max) + (-> v1-5 fo-curve) + -1.0 + ) + ) + (set! (-> this last-sound-id) s5-0) + ) + ) + (ashelin-oasis-method-263 this #t) + (let ((v0-3 (current-time))) + (set! (-> this last-speech-time) v0-3) + (the-as gui-connection v0-3) + ) + ) + +(defmethod ashelin-oasis-method-263 ((this ashelin-oasis) (arg0 symbol)) + (with-pp + (when (channel-active? this (gui-channel none)) + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (math-camera-pos))) + (f30-0 (vector-length s4-1)) + (v1-7 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> (math-camera-matrix) fvec) f30-0)) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (if (< f30-0 122880.0) + (set! (-> s3-2 quad) (-> v1-7 quad)) + (set! (-> s3-2 quad) (-> s4-1 quad)) + ) + (vector+! s3-2 s3-2 (math-camera-pos)) + (if arg0 + (set! (-> this last-sound-trans quad) (-> s3-2 quad)) + (vector-seek-3d-smooth! (-> this last-sound-trans) s3-2 (* 102400.0 (seconds-per-frame)) 1.0) + ) + ) + (when *sound-player-enable* + (let ((s5-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s5-1 command) (sound-command set-param)) + (set! (-> s5-1 id) (-> this last-sound-id)) + (let ((a1-4 (-> this last-sound-trans))) + (let ((gp-1 pp)) + (when (= a1-4 #t) + (if (and gp-1 (type? gp-1 process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) + (set! a1-4 (-> (the-as process-drawable gp-1) root trans)) + (set! a1-4 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s5-1 params trans) a1-4) + ) + (set! (-> s5-1 params mask) (the-as uint 32)) + (-> s5-1 id) + ) + ) + 0 + ) + 0 + (none) + ) + ) + +(defmethod enemy-common-post ((this ashelin-oasis)) + (let ((t9-0 (method-of-type ashelin enemy-common-post))) + (t9-0 this) + ) + (ashelin-oasis-method-263 this #f) + (none) + ) + +(defmethod get-inv-mass ((this ashelin-oasis)) + 0.033333335 + ) + +(defmethod event-handler ((this ashelin-oasis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('impact-impulse) + (let ((v1-1 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-1) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this knocked)) + ((method-of-type ashelin event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (else + ((method-of-type ashelin event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(define *ash-oasis-course* + (new 'static 'ashelin-course + :speech-count #x2b + :spot-count #x6 + :attack-player-speeches (new 'static 'bot-speech-list-shuffle + :flags (bot-speech-list-flag bsl1 bsl2 bsl3) + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 5 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19) + ) + :default-check-too-far #f + :waypoints (new 'static 'boxed-array :type bot-waypoint + (new 'static 'bot-waypoint + :waypoint-id 1 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-oasis)) + (bot-method-223 arg0) + (move-to-point! (-> arg0 root) (the-as vector (-> arg0 course spots 0))) + (let ((v1-6 25)) + (set! (-> arg0 hit-points) (the float v1-6)) + (set! (-> arg0 enemy-info default-hit-points) (the float v1-6)) + ) + (set! (-> arg0 waypoint-time0) 0) + (go-to-waypoint! arg0 3 #f) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + #t + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 2 + :nav-mesh-index -1 + :skip-to -1 + :on-set #f + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 3 + :nav-mesh-index -1 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-oasis)) + (send-event arg0 'hide #f) + (set! (-> arg0 minimap) (add-icon! *minimap* arg0 (the-as uint 146) (the-as int #f) (the-as vector #t) 0)) + (set-time! (-> arg0 last-speech-time)) + (ashelin-method-261 arg0 #t) + (set! (-> arg0 notice-enemy-dist) 245760.0) + (logior! (-> arg0 bot-flags) (bot-flag bf06)) + (logior! (-> arg0 bot-flags) (bot-flag bf20)) + (let ((s5-0 (-> arg0 course spots))) + (vector-! (the-as vector (-> arg0 frontline)) (the-as vector (-> s5-0 2)) (the-as vector (-> s5-0 1))) + (vector-normalize! (-> arg0 frontline) 1.0) + (set! (-> arg0 frontline w) (- (vector-dot (the-as vector (-> arg0 frontline)) (the-as vector (-> s5-0 1))))) + ) + (set-frontline arg0) + (let ((v1-23 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-23 bytes 5) 2) + (set! (-> v1-23 bytes 6) 3) + (set! (-> v1-23 bytes 7) 4) + (let ((v0-6 + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-oasis)) + (when (and (not (channel-active? arg1 (gui-channel none))) (time-elapsed? (-> arg1 last-speech-time) (seconds 5))) + (cond + ((and (not (course-speech-playing? arg1 35)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 1))) + (play-speech-by-id arg1 35) + ) + ((and (not (course-speech-playing? arg1 39)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 30))) + (play-speech-by-id arg1 39) + ) + ((and (not (course-speech-playing? arg1 37)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 60))) + (play-speech-by-id arg1 37) + ) + ((and (not (course-speech-playing? arg1 38)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 90))) + (play-speech-by-id arg1 38) + ) + ((and (not (course-speech-playing? arg1 36)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 120))) + (play-speech-by-id arg1 36) + ) + ((and (not (course-speech-playing? arg1 42)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 150))) + (play-speech-by-id arg1 42) + ) + ) + ) + ) + ) + ) + (set! (-> (the-as asht-wait-spot v1-23) check-done) (the-as (function asht-wait-spot ashelin symbol) v0-6)) + v0-6 + ) + ) + ) + :on-update (lambda ((arg0 ashelin-oasis)) + (local-vars (v0-5 bot-flag)) + (set-frontline arg0) + (let* ((a1-0 (target-pos 0)) + (f0-0 (vector-vector-xz-distance-squared (-> arg0 root trans) a1-0)) + (f1-0 409600.0) + (s5-0 (< f0-0 (* f1-0 f1-0))) + ) + (if s5-0 + (set-time! (-> arg0 player-in-bounds-time)) + ) + (when (time-elapsed? (-> arg0 player-in-bounds-time) (seconds 6)) + (send-event arg0 'instant-death) + (play-speech-by-id arg0 41) + ) + (cond + ((not s5-0) + (set! v0-5 (logior (-> arg0 bot-flags) (bot-flag bf10))) + (set! (-> arg0 bot-flags) v0-5) + ) + (else + (set! v0-5 (logclear (-> arg0 bot-flags) (bot-flag bf10))) + (set! (-> arg0 bot-flags) v0-5) + ) + ) + ) + v0-5 + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 4 + :nav-mesh-index -1 + :skip-to -1 + :on-set #f + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 5 + :nav-mesh-index -1 + :skip-to -1 + :on-set #f + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + ) + :speeches (new 'static 'inline-array bot-speech-info 43 + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha008") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha002") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf10) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha003" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf06) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha004" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf06) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha005" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha006") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha018" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha019") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha020" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha021" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha022" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha023" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha024" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha025" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha026") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha027" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha028") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha029" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf10) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha030" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha031" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha035") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha036") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha039") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha041") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha052") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha054") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha014") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha015") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha016") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha017") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf11) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha038" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf11) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha044" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf11) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha049" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha032") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha034") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha037") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha042") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash104") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash111") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash113") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash114") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash117") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash118") + ) + :speech-tunings (new 'static 'inline-array bot-speech-tuning 1 + (new 'static 'bot-speech-tuning :fo-min 15 :fo-max #x12c :fo-curve 9 :trans? #f) + ) + :spots (new 'static 'inline-array bot-spot 6 + (new 'static 'bot-spot :center (new 'static 'vector :x 2540830.8 :y 72540.16 :z 10318971.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2381537.2 :y 85770.24 :z 10326016.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2333696.0 :y 87941.12 :z 10350346.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2456617.0 :y 87777.28 :z 10412892.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2405294.0 :y 84623.36 :z 10283336.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2439454.8 :y 106086.4 :z 10570424.0 :w 16384.0)) + ) + :ouch-speeches (new 'static 'bot-speech-list-shuffle + :flags (bot-speech-list-flag bsl1 bsl2) + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 26 27 28 29 30 31 32 40) + ) + :victory-speeches (new 'static 'bot-speech-list-shuffle + :flags (bot-speech-list-flag bsl2 bsl3) + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 0 20 21 22 23 24 25) + ) + ) + ) + +(set! (-> *bot-course-table* course 0) *ash-oasis-course*) diff --git a/goal_src/jak3/levels/desert/oasis/oasis-defense.gc b/goal_src/jak3/levels/desert/oasis/oasis-defense.gc index 9957797ab3..e147964560 100644 --- a/goal_src/jak3/levels/desert/oasis/oasis-defense.gc +++ b/goal_src/jak3/levels/desert/oasis/oasis-defense.gc @@ -7,3 +7,807 @@ ;; DECOMP BEGINS +(deftype oasis-point (structure) + ((pos vector :inline) + (quat quaternion :inline) + ) + ) + + +(define *oasis-marauder-start* (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2458461.0 :y 81688.164 :z 10302577.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0006 :y 0.5862 :z -0.0012 :w 0.8101) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2450950.2 :y 82370.97 :z 10330767.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0008 :y -0.7239 :z 0.001 :w -0.6898) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2458173.8 :y 82435.69 :z 10352404.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.001 :y 0.8624 :z -0.0008 :w 0.506) + ) + ) + ) + +(define *oasis-vehicle-start* (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2378927.8 :y 89453.77 :z 10338013.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0047 :y 0.8075 :z -0.0137 :w 0.5896) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2416701.5 :y 87323.85 :z 10297737.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0007 :y -0.1249 :z -0.0329 :w 0.9916) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2411298.5 :y 90682.984 :z 10373812.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.041 :y 0.9921 :z -0.0557 :w 0.104) + ) + ) + ) + +(define *oasis-vehicle-path* (the-as (array (array oasis-point)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1643712.1 :y 135682.05 :z 10027475.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0013 :y 0.52 :z 0.0005 :w 0.8541) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1834901.5 :y 126926.03 :z 10381510.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.4936 :w 0.8696) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2164965.5 :y 103604.23 :z 10309546.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7718 :w 0.6357) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2351683.5 :y 89942.836 :z 10210302.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9924 :w -0.1222) + ) + ) + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2656992.8 :y 158144.11 :z 12118015.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9957 :w 0.092) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2729601.5 :y 154424.11 :z 11455859.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9626 :w 0.2709) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2346952.2 :y 104915.766 :z 10551702.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7954 :w 0.6059) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2446049.2 :y 93183.59 :z 10450630.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0005 :y -0.999 :z 0.0014 :w -0.044) + ) + ) + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1486110.8 :y 118251.52 :z 11689861.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9323 :w 0.3615) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1744946.0 :y 140856.11 :z 10625518.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0001 :y -0.7207 :z 0.0015 :w -0.6932) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2165376.5 :y 96137.625 :z 10535523.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9339 :w -0.3572) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2379151.2 :y 85637.12 :z 10319897.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9317 :w -0.3631) + ) + ) + ) + ) + ) + +(define *oasis-vehicle-fx-path* (the-as (array (array oasis-point)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1905749.2 :y 139053.06 :z 11196600.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.876 :w -0.4823) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2656209.8 :y 67824.44 :z 10573690.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.876 :w -0.4823) + ) + ) + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2206190.0 :y 154991.83 :z 11345007.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9882 :w -0.153) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2565465.0 :y 111149.055 :z 10101822.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9882 :w -0.153) + ) + ) + ) + ) + ) + +(define *oasis-marauder-spawn-point* (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2397388.5 :y 91552.56 :z 10411445.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8685 :w 0.4955) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2498060.2 :y 95181.62 :z 10163618.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0501 :w 0.9987) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2601913.5 :y 70653.95 :z 10246909.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.2036 :w -0.979) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2304180.2 :y 88062.36 :z 10259569.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3212 :w -0.9469) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2293810.0 :y 89958.4 :z 10373563.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7906 :w -0.6123) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2557681.8 :y 86204.01 :z 10528274.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9788 :w -0.2044) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2483336.8 :y 95299.99 :z 10500398.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9819 :w -0.189) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2579720.2 :y 69928.55 :z 10425897.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8771 :w -0.4801) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2405315.0 :y 90315.164 :z 10202601.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2878 :w -0.9576) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2543300.5 :y 79528.76 :z 10235757.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.493 :w -0.87) + ) + ) + ) + +(deftype oasis-vehicle (structure) + ((handle handle) + (path-type int8) + (path-pos int8) + (spawned-marauder? symbol) + ) + :pack-me + ) + + +(deftype oasis-marauder (structure) + ((handle handle) + (initialized? symbol) + ) + :pack-me + ) + + +(deftype task-manager-desert-oasis-defense (task-manager) + ((nav-mesh nav-mesh) + (vehicle oasis-vehicle 3 :inline) + (vehicle-count uint8) + (v-free-list (array uint8)) + (marauder oasis-marauder 7 :inline) + (m-free-list (array uint8)) + (marauder-count uint8) + (total-spawned uint8) + (total-veh-spawned uint8) + (check-timer time-frame) + (trans-timer time-frame) + (veh-fx handle 2) + (veh-fx-timer time-frame) + (ash-entity entity-actor) + (marauder-entity entity-actor) + (last-kill-time time-frame) + ) + (:methods + (spawn-v-marauder (_type_ int int) handle) + (spawn-marauder (_type_ oasis-point symbol) handle) + (task-manager-desert-oasis-defense-method-34 (_type_) none) + (task-manager-desert-oasis-defense-method-35 (_type_) none) + ) + ) + + +(defstate active (task-manager-desert-oasis-defense) + :virtual #t + :code (behavior () + (local-vars (f30-1 float)) + (when (not (task-node-closed? (game-task-node desert-oasis-defense-meeting))) + (was-squad-manager-start self) + (let ((v1-1 *was-squad-control*)) + (set! (-> v1-1 target-count) 3) + (set! (-> v1-1 reserve-count) 40) + ) + (loop + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self ash-entity extra trans quad)) + (let ((f30-0 (vector-vector-distance gp-0 (target-pos 0)))) + (when (and *was-squad-manager* (< f30-0 3276800.0)) + (set! (-> *was-squad-control* target-count) 0) + 0 + ) + (if (and (< f30-0 819200.0) (-> *setting-control* user-current turbo)) + (set-setting! 'turbo #f 0.0 0) + ) + (when (< f30-0 327680.0) + (was-squad-manager-kill) + (set-setting! 'stop-vehicle? #t 0.0 0) + (send-event *target* 'change-mode 'normal) + (set-setting! 'pilot #f 0.0 0) + #t + (goto cfg-23) + ) + ) + ) + (suspend) + 0 + ) + ) + (label cfg-23) + (when (and *target* (focus-test? *target* pilot-riding) (handle->process (-> *target* pilot vehicle))) + (-> self player-vehicle) + (let ((v1-49 (-> *target* pilot vehicle))) + (send-event (handle->process v1-49) 'ignore-damage #t) + ) + ) + (while (not (task-node-closed? (game-task-node desert-oasis-defense-meeting))) + (suspend) + ) + (when (not (task-node-closed? (game-task-node desert-oasis-defense-battle))) + (set-setting! 'string-max-length 'abs (meters 18.5) 0) + (set-setting! 'string-max-height 'abs (meters 6) 0) + (set-setting! 'music 'oasisfi 0.0 0) + (set-setting! 'fog-special-interp-rate #f 0.025 0) + (set-setting! 'fog-special-interp-targ #f 0.9 0) + (dotimes (gp-1 (length *oasis-vehicle-start*)) + (spawn-v-marauder self -1 gp-1) + ) + (dotimes (gp-2 (length *oasis-marauder-start*)) + (spawn-marauder self (-> *oasis-marauder-start* gp-2) #f) + ) + (set-time! (-> self check-timer)) + (set-time! (-> self veh-fx-timer)) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-marauder :init hud-init-by-other :name "hud-marauder" :to self)) + ) + (set! (-> *game-info* counter) (the float (- (+ (-> self marauder-count) 57) (-> self total-spawned)))) + (until (and (>= (-> self total-spawned) (the-as uint 57)) + (zero? (-> self marauder-count)) + (zero? (-> self vehicle-count)) + ) + (when (>= (+ (current-time) (seconds -20)) (-> self veh-fx-timer)) + (dotimes (gp-4 2) + (when (= (-> self veh-fx gp-4) #f) + (when (rand-vu-percent? 0.7) + (let ((s5-1 (-> *oasis-vehicle-fx-path* gp-4 0)) + (s4-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + ) + (vector-z-quaternion! (-> s4-0 vec) (-> s5-1 quat)) + (vector-float*! (-> s4-0 vec) (-> s4-0 vec) 204800.0) + (set! (-> s4-0 params object-type) (the-as uint 6)) + (set! (-> s4-0 params behavior) (the-as uint 3)) + (set! (-> s4-0 params id) (the-as uint 0)) + (set! (-> s4-0 params nav-mesh) (-> self nav-mesh)) + (set! (-> s4-0 params nav-branch) #f) + (set! (-> s4-0 params proc) #f) + (set! (-> s4-0 params handle) (the-as handle #f)) + (set! (-> s4-0 params user-data) (the-as uint 0)) + (set! (-> s4-0 params flags) (traffic-spawn-flags)) + (set! (-> s4-0 params guard-type) (the-as uint 11)) + (set! (-> s4-0 params entity) #f) + (set! (-> s4-0 params velocity quad) (-> s4-0 vec quad)) + (set! (-> s4-0 params position quad) (-> s5-1 pos quad)) + (quaternion-copy! (-> s4-0 params rotation) (-> s5-1 quat)) + (let ((s5-2 (vehicle-spawn (vehicle-type v-marauder) (-> s4-0 params)))) + (when s5-2 + (iterate-prims + (the-as collide-shape-moving (-> s5-2 root)) + (lambda ((arg0 collide-shape-prim)) (logior! (-> arg0 prim-core collide-as) (collide-spec enemy)) (none)) + ) + (logior! (-> s5-2 mask) (process-mask enemy)) + (set! (-> self veh-fx gp-4) (process->handle s5-2)) + (suspend) + (send-event + (handle->process (-> self veh-fx gp-4)) + 'ai-set-target-position + (-> *oasis-vehicle-fx-path* gp-4 1 pos) + ) + (send-event (handle->process (-> self veh-fx gp-4)) 'ai-set-target-speed 327680.0) + ) + ) + ) + ) + ) + ) + (set-time! (-> self veh-fx-timer)) + ) + (when (>= (+ (current-time) (seconds -2.5)) (-> self check-timer)) + (when (and (< (-> self vehicle-count) (the-as uint 3)) (< (-> self total-spawned) (the-as uint 57))) + (let ((gp-5 0)) + (dotimes (v1-156 3) + (let ((a0-71 (-> self vehicle v1-156))) + (if (!= (-> a0-71 handle) #f) + (set! gp-5 (logior gp-5 (ash 1 (-> a0-71 path-type)))) + ) + ) + ) + (spawn-v-marauder self (rand-vu-int-count-excluding (length *oasis-vehicle-path*) gp-5) -1) + ) + ) + (let ((gp-6 (-> (camera-matrix) fvec)) + (s5-4 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-2 (length *oasis-marauder-spawn-point*)) + (when (and (< (-> self marauder-count) (the-as uint 7)) (< (-> self total-spawned) (the-as uint 57))) + (let ((s3-1 (-> *oasis-marauder-spawn-point* s4-2))) + (vector-! s5-4 (-> s3-1 pos) (camera-pos)) + (if (< (vector-dot gp-6 s5-4) 0.0) + (spawn-marauder self s3-1 #f) + ) + ) + ) + ) + ) + (set-time! (-> self check-timer)) + ) + (let ((v1-182 (- (+ (-> self marauder-count) 57) (-> self total-spawned)))) + (cond + ((zero? v1-182) + (when (-> self hud-counter) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self hud-counter) (the-as handle #f)) + ) + ) + (else + (set! (-> *game-info* counter) (the float v1-182)) + ) + ) + ) + (suspend) + ) + (dotimes (gp-7 2) + (let ((a0-92 (handle->process (-> self veh-fx gp-7)))) + (when a0-92 + (deactivate a0-92) + (set! (-> self veh-fx gp-7) (the-as handle #f)) + ) + ) + ) + (set-setting! 'fog-special-interp-rate #f 0.2 0) + (set-setting! 'fog-special-interp-targ #f 0.2 0) + (when (handle->process (-> *game-info* dust-storm)) + 1.0 + (let ((gp-8 (-> *game-info* dust-storm))) + (until (< f30-1 0.4) + (let ((a1-37 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-37 from) (process->ppointer self)) + (set! (-> a1-37 num-params) 0) + (set! (-> a1-37 message) 'get-intensity) + (let ((t9-42 send-event-function) + (a0-102 (handle->process gp-8)) + ) + (set! f30-1 (the-as float (t9-42 a0-102 a1-37))) + ) + ) + (suspend) + ) + ) + ) + (send-event self 'complete) + ) + (sleep-code) + ) + :post (behavior () + (task-manager-desert-oasis-defense-method-35 self) + 0 + ) + ) + +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; WARN: Return type mismatch time-frame vs none. +(defmethod task-manager-method-26 ((this task-manager-desert-oasis-defense)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (time-elapsed? (-> this trans-timer) (seconds 0.1)) + (dotimes (s5-0 3) + (let ((s4-0 (-> this vehicle s5-0)) + (v1-8 (-> this vehicle s5-0 handle)) + ) + (when (!= v1-8 #f) + (let ((s3-0 (handle->process v1-8))) + (cond + (s3-0 + (when (>= (-> s4-0 path-type) 0) + (let* ((s2-0 (-> *oasis-vehicle-path* (-> s4-0 path-type) (-> s4-0 path-pos))) + (s1-0 (= (+ (length (-> *oasis-vehicle-path* (-> s4-0 path-type))) -1) (-> s4-0 path-pos))) + (f30-0 (vector-vector-distance-squared (-> s2-0 pos) (-> (the-as process-drawable s3-0) root trans))) + ) + (when (and (not s1-0) (let ((f0-0 81920.0)) + (< f30-0 (* f0-0 f0-0)) + ) + ) + (+! (-> s4-0 path-pos) 1) + (send-event s3-0 'ai-set-target-position (-> *oasis-vehicle-path* (-> s4-0 path-type) (-> s4-0 path-pos) pos)) + (send-event s3-0 'ai-set-target-speed 163840.0) + (send-event s3-0 'ai-set-target-process *target*) + ) + (if (and s1-0 (let ((f0-3 122880.0)) + (< f30-0 (* f0-3 f0-3)) + ) + ) + (send-event s3-0 'ai-set-target-speed 122880.0) + ) + (when (-> s4-0 spawned-marauder?) + (send-event s3-0 'ai-set-target-speed 81920.0) + (send-event s3-0 'ai-set-target-position (-> *oasis-vehicle-path* (-> s4-0 path-type) (-> s4-0 path-pos) pos)) + ) + (when (and s1-0 (not (-> s4-0 spawned-marauder?)) (let ((f0-6 40960.0)) + (and (< f30-0 (* f0-6 f0-6)) + (< (-> this marauder-count) (the-as uint 7)) + (< (-> this total-spawned) (the-as uint 57)) + ) + ) + ) + (let ((a1-10 (handle->process (spawn-marauder this s2-0 #t)))) + (when a1-10 + (let ((v1-83 (new 'stack-no-clear 'wvehicle-ai-drop-off-params))) + (set! (-> v1-83 proc) a1-10) + (set! (-> v1-83 dest quad) (-> s2-0 pos quad)) + (send-event s3-0 'ai-drop-off v1-83) + ) + (set! (-> s4-0 spawned-marauder?) #t) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this vehicle s5-0 handle) (the-as handle #f)) + (+! (-> this vehicle-count) -1) + (let ((s4-1 (-> this v-free-list))) + (set! (-> s4-1 (length s4-1)) (the-as uint s5-0)) + (+! (-> s4-1 length) 1) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 2) + (let ((s4-2 (handle->process (-> this veh-fx s5-1)))) + (cond + (s4-2 + (let ((f30-1 (vector-vector-distance-squared + (-> *oasis-vehicle-fx-path* s5-1 1 pos) + (-> (the-as process-drawable s4-2) root trans) + ) + ) + ) + (let ((f0-9 102400.0)) + (when (< f30-1 (* f0-9 f0-9)) + (let* ((s2-1 (-> (the-as process-drawable s4-2) root quat)) + (s3-2 (vector-normalize! (vector-x-quaternion! (new 'stack-no-clear 'vector) s2-1) 40960.0)) + (v1-109 (vector-normalize! (vector-y-quaternion! (new 'stack-no-clear 'vector) s2-1) 102400.0)) + ) + (vector+! s3-2 (-> (the-as process-drawable s4-2) root trans) s3-2) + (send-event s4-2 'apply-impulse s3-2 v1-109) + ) + ) + ) + (let ((f0-12 40960.0)) + (when (< f30-1 (* f0-12 f0-12)) + (send-event + s4-2 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (set! (-> this veh-fx s5-1) (the-as handle #f)) + ) + ) + ) + ) + (else + (set! (-> this veh-fx s5-1) (the-as handle #f)) + ) + ) + ) + ) + (dotimes (s5-2 7) + (let* ((s3-3 (-> this marauder s5-2)) + (v1-129 (-> s3-3 handle)) + ) + (when (!= v1-129 #f) + (let* ((s2-2 (handle->process v1-129)) + (s4-3 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + (cond + (s4-3 + (cond + ((not (-> s3-3 initialized?)) + (send-event s4-3 'go-hostile) + (send-event s4-3 'target-pos (target-pos 0)) + (set! (-> s3-3 initialized?) #t) + ) + ((and (-> s3-3 initialized?) + (and (-> s4-3 next-state) (= (-> s4-3 next-state name) 'dormant)) + (>= (+ (current-time) (seconds -10)) (-> this last-kill-time)) + ) + (deactivate s4-3) + ) + ) + ) + (else + (set! (-> this marauder s5-2 handle) (the-as handle #f)) + (+! (-> this marauder-count) -1) + (let ((s4-4 (-> this m-free-list))) + (set! (-> s4-4 (length s4-4)) (the-as uint s5-2)) + (+! (-> s4-4 length) 1) + ) + (set-time! (-> this last-kill-time)) + ) + ) + ) + ) + ) + ) + (set-time! (-> this trans-timer)) + ) + (none) + ) + +(defmethod task-manager-desert-oasis-defense-method-35 ((this task-manager-desert-oasis-defense)) + 0 + (none) + ) + +(defmethod spawn-marauder ((this task-manager-desert-oasis-defense) (arg0 oasis-point) (arg1 symbol)) + (let ((s5-0 (-> this m-free-list))) + (when (nonzero? (length s5-0)) + (let ((s3-0 (-> this marauder (-> s5-0 (+ (length s5-0) -1)))) + (s2-0 49) + (f30-0 30.0) + ) + (let ((v1-13 (-> *game-info* sub-task-list (game-task-node desert-oasis-defense-battle)))) + (when (and v1-13 (>= (-> v1-13 death-count) 0)) + (when (and *target* (and (>= 5.0 (-> *target* fact health)) (rand-vu-percent? 0.6))) + (set! s2-0 20) + (set! f30-0 2.0) + ) + ) + ) + (let ((s0-0 (new 'stack-no-clear 'marauder-init-by-other-params))) + (set! (-> s0-0 trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> s0-0 quat) (-> arg0 quat)) + (set! (-> s0-0 entity) (-> this marauder-entity)) + (set! (-> s0-0 directed?) #f) + (set! (-> s0-0 no-initial-move-to-ground?) #t) + (set! (-> s0-0 multi-focus) #t) + (set! (-> s0-0 skip-jump) #f) + (let* ((s1-2 (ppointer->process (process-spawn marauder this s0-0 :name "marauder" :to this))) + (s0-1 (if (type? s1-2 process-focusable) + s1-2 + ) + ) + (s1-3 (if (type? s0-1 marauder) + (the-as marauder s0-1) + ) + ) + ) + (when s1-3 + (change-to (-> this nav-mesh) s1-3) + (let ((v1-38 (-> s1-3 nav state))) + (set! (-> v1-38 current-poly) (the-as nav-poly #f)) + ) + 0 + (reset-to-collide-spec (-> s1-3 focus) (collide-spec jak bot hit-by-others-list player-list jak-vehicle)) + (logior! (-> s1-3 fact options) (actor-option dont-override-fact)) + (set! (-> s1-3 fact pickup-type) (the-as pickup-type s2-0)) + (set! (-> s1-3 fact pickup-amount) f30-0) + (set! (-> s1-3 fact pickup-spawn-amount) f30-0) + (set! (-> s3-0 handle) (process->handle s1-3)) + (set! (-> s3-0 initialized?) arg1) + (+! (-> this marauder-count) 1) + (+! (-> s5-0 length) -1) + (+! (-> this total-spawned) 1) + (add-icon! *minimap* s1-3 (the-as uint 117) (the-as int #f) (the-as vector #t) 0) + (return (-> s3-0 handle)) + ) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +(defmethod spawn-v-marauder ((this task-manager-desert-oasis-defense) (arg0 int) (arg1 int)) + (local-vars (sv-240 mystery-traffic-object-spawn-params0)) + (let ((s5-0 (-> this v-free-list)) + (s4-0 (>= arg1 0)) + ) + (when (nonzero? (length s5-0)) + (let ((s3-0 (-> this vehicle (-> s5-0 (+ (length s5-0) -1))))) + (let ((s0-0 (if s4-0 + (-> *oasis-vehicle-start* arg1) + (-> *oasis-vehicle-path* arg0 0) + ) + ) + ) + (set! sv-240 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + (vector-z-quaternion! (-> sv-240 vec) (-> s0-0 quat)) + (vector-float*! (-> sv-240 vec) (-> sv-240 vec) (if s4-0 + 0.0 + 204800.0 + ) + ) + (set! (-> sv-240 params object-type) (the-as uint 6)) + (set! (-> sv-240 params behavior) (the-as uint 3)) + (set! (-> sv-240 params id) (the-as uint 0)) + (set! (-> sv-240 params nav-mesh) (-> this nav-mesh)) + (set! (-> sv-240 params nav-branch) #f) + (set! (-> sv-240 params proc) #f) + (set! (-> sv-240 params handle) (the-as handle #f)) + (set! (-> sv-240 params user-data) (the-as uint 0)) + (set! (-> sv-240 params flags) (traffic-spawn-flags)) + (set! (-> sv-240 params guard-type) (the-as uint 11)) + (set! (-> sv-240 params entity) #f) + (set! (-> sv-240 params velocity quad) (-> sv-240 vec quad)) + (set! (-> sv-240 params position quad) (-> s0-0 pos quad)) + (quaternion-copy! (-> sv-240 params rotation) (-> s0-0 quat)) + ) + (let ((s0-1 (vehicle-spawn (vehicle-type v-marauder) (-> sv-240 params)))) + (when s0-1 + (iterate-prims + (the-as collide-shape-moving (-> s0-1 root)) + (lambda ((arg0 collide-shape-prim)) (logior! (-> arg0 prim-core collide-as) (collide-spec enemy)) (none)) + ) + (logior! (-> s0-1 mask) (process-mask enemy)) + (send-event s0-1 'ai-set-attack-delay-factor 4.0) + (send-event s0-1 'ai-set-inaccuracy-factor 2.0) + (set! arg0 (cond + (s4-0 + arg1 + ) + (else + (empty) + arg0 + ) + ) + ) + (set! (-> s3-0 path-type) arg0) + (set! (-> s3-0 path-pos) (if s4-0 + (+ (length (-> *oasis-vehicle-path* arg1)) -1) + 0 + ) + ) + (set! (-> s3-0 handle) (process->handle s0-1)) + (set! (-> s3-0 spawned-marauder?) (if s4-0 + #t + #f + ) + ) + (+! (-> this vehicle-count) 1) + (+! (-> s5-0 length) -1) + (+! (-> this total-veh-spawned) 1) + (return (-> s3-0 handle)) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-desert-oasis-defense)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (send-event (handle->process (-> this player-vehicle)) 'ignore-damage #f) + (none) + ) + +(defmethod set-time-limit ((this task-manager-desert-oasis-defense)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this nav-mesh) (get-nav-mesh (the-as actor-id #xb5d9))) + (set! (-> this v-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 3)) + (dotimes (v1-2 3) + (set! (-> this vehicle v1-2 handle) (the-as handle #f)) + (set! (-> this vehicle v1-2 spawned-marauder?) #f) + (set! (-> this v-free-list v1-2) (the-as uint v1-2)) + ) + (set! (-> this v-free-list length) 3) + (set! (-> this m-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 7)) + (dotimes (v1-7 7) + (set! (-> this marauder v1-7 handle) (the-as handle #f)) + (set! (-> this marauder v1-7 initialized?) #f) + (set! (-> this m-free-list v1-7) (the-as uint v1-7)) + ) + (set! (-> this m-free-list length) 7) + (set! (-> this ash-entity) (the-as entity-actor (entity-by-name "ashelin-npc-3"))) + (set! (-> this marauder-entity) (the-as entity-actor (entity-by-name "marauder-2"))) + (dotimes (v1-11 2) + (set! (-> this veh-fx v1-11) (the-as handle #f)) + ) + (if (= (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-snake v-toad v-fox)) + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-scorpion v-toad)) + ) + (none) + ) + +(deftype desoasis-hellcat (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-desoasis-hellcat hellcat hellcat-lod0-jg hellcat-idle-ja + ((hellcat-lod0-mg (meters 20)) (hellcat-lod1-mg (meters 40)) (hellcat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow hellcat-shadow-mg + :origin-joint-index 3 + ) + +(defstate idle (desoasis-hellcat) + :virtual #t + :code sleep-code + ) + +(defmethod init-from-entity! ((this desoasis-hellcat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 34816.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) 34816.0) + (let ((v1-4 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-4 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-4 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (add-process-drawable-to-nav-mesh (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0) this #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-desoasis-hellcat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (transform-post) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc index 1dc6f22f02..152a2def1c 100644 --- a/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc +++ b/goal_src/jak3/levels/desert/wvehicle/was-squad-control.gc @@ -521,11 +521,9 @@ ) ) -;; WARN: Return type mismatch (pointer process) vs none. (defun was-squad-manager-start ((arg0 process)) (kill-by-type was-squad-manager *active-pool*) (process-spawn was-squad-manager :name "was-squad-manager" :to arg0) - (none) ) ;; WARN: Return type mismatch symbol vs none. diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc index 187a3254f4..695382ebb5 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-effects.gc @@ -501,7 +501,7 @@ (set! (-> s5-0 wheel-radius) (* (-> s1-0 scale) (-> s1-0 radius))) (set! (-> s5-0 wheel-width) (* (-> s1-0 scale) (-> s1-0 width))) (set! (-> s5-0 wheel-rev-speed) (* (-> s2-0 rev) (-> s5-0 wheel-radius))) - (set! (-> s5-0 surface-type) (-> s2-0 surface surface-type)) + (set! (-> s5-0 surface-type) (the-as uint (-> s2-0 surface surface-type))) (if (< 0.0 (-> s2-0 sink-depth)) (set! (-> s5-0 surface-type) (the-as uint 4)) ) @@ -855,7 +855,7 @@ ) (set! (-> s3-0 vec1 w) (-> s3-0 vec1 x)) (set! (-> s3-0 vec4 quad) (-> this root trans quad)) - (let ((s2-0 (static-sound-spec "aaaabbbbccccddd" :group 1 :volume 0.0 :mask (pitch)))) + (let ((s2-0 (static-sound-spec "aaaabbbbccccddd" :group 0 :volume 0.0 :mask (pitch)))) (logior! (-> s2-0 mask) (sound-mask trans unk2)) (set! (-> s2-0 sound-name) (-> s5-0 sound idle-sound)) (set! (-> s2-0 volume) (the int (* 1024.0 (-> s3-0 vec0 x)))) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc index 0c9d13c9d0..6374102dee 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-h.gc @@ -127,6 +127,21 @@ (declare-type vehicle-wheel-surface structure) (define-extern *wvehicle-surfaces* (inline-array vehicle-wheel-surface)) +;; +++vehicle-wheel-surface-type +(defenum vehicle-wheel-surface-type + :type uint8 + (stone) + (dirt) + (sand) + (quicksand) + (water) + (wall) + (conveyor) + (none) + ) +;; ---vehicle-wheel-surface-type + + ;; DECOMP BEGINS (deftype wvehicle-sound-loop-state (structure) @@ -140,7 +155,7 @@ (deftype vehicle-wheel-surface (structure) ((flags vehicle-wheel-surface-flag) - (surface-type uint8) + (surface-type vehicle-wheel-surface-type) (friction float) (drag float) (depth float) diff --git a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc index 411929b3fb..c89936b811 100644 --- a/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc +++ b/goal_src/jak3/levels/desert/wvehicle/wvehicle-physics.gc @@ -7,60 +7,65 @@ ;; DECOMP BEGINS -(define *wvehicle-surfaces* - (new 'static 'inline-array vehicle-wheel-surface 7 - (new 'static 'vehicle-wheel-surface - :friction 1.0 - :drag 1.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) - :tire-slide-mix (new 'static 'array float 2 1.0 0.0) - ) - (new 'static 'vehicle-wheel-surface - :surface-type #x1 - :friction 0.9 - :drag 1.0 - :depth 409.6 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 0.5 0.5 0.0 0.5) - :tire-slide-mix (new 'static 'array float 2 0.5 1.0) - ) - (new 'static 'vehicle-wheel-surface - :surface-type #x2 - :friction 0.85 - :drag 2.0 - :depth 1024.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 0.0 0.0 1.0 0.25) - :tire-slide-mix (new 'static 'array float 2 0.0 0.5) - ) - (new 'static 'vehicle-wheel-surface - :flags (vehicle-wheel-surface-flag moving) - :surface-type #x3 - :friction 0.5 - :drag 5.0 - :damage 1.0 - ) - (new 'static 'vehicle-wheel-surface :surface-type #x4 :friction 0.25 :drag 4.0 :depth 2048.0 :damage 1.0) - (new 'static 'vehicle-wheel-surface - :surface-type #x5 - :friction 0.1 - :drag 1.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) - :tire-slide-mix (new 'static 'array float 2 1.0 0.0) - ) - (new 'static 'vehicle-wheel-surface - :flags (vehicle-wheel-surface-flag moving) - :surface-type #x6 - :friction 1.0 - :drag 1.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) - :tire-slide-mix (new 'static 'array float 2 1.0 0.0) - ) - ) - ) +(define *wvehicle-surfaces* (new 'static 'inline-array vehicle-wheel-surface 7 + (new 'static 'vehicle-wheel-surface + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type dirt) + :friction 0.9 + :drag 1.0 + :depth 409.6 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.5 0.5 0.0 0.5) + :tire-slide-mix (new 'static 'array float 2 0.5 1.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type sand) + :friction 0.85 + :drag 2.0 + :depth 1024.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.0 0.0 1.0 0.25) + :tire-slide-mix (new 'static 'array float 2 0.0 0.5) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type (vehicle-wheel-surface-type quicksand) + :friction 0.5 + :drag 5.0 + :damage 1.0 + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type water) + :friction 0.25 + :drag 4.0 + :depth 2048.0 + :damage 1.0 + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type wall) + :friction 0.1 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type (vehicle-wheel-surface-type conveyor) + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + ) + ) (defmethod wvehicle-method-160 ((this wvehicle) (arg0 wvehicle-physics-work)) (let ((v1-0 (-> this rbody))) diff --git a/goal_src/jak3/levels/factory/car/hvehicle.gc b/goal_src/jak3/levels/factory/car/hvehicle.gc index 35992eac83..682bcba8ca 100644 --- a/goal_src/jak3/levels/factory/car/hvehicle.gc +++ b/goal_src/jak3/levels/factory/car/hvehicle.gc @@ -490,7 +490,7 @@ (none) ) -(defmethod control-hook-player ((this hvehicle) (arg0 vehicle-controls)) +(defmethod control-hook-player ((this hvehicle)) (let ((gp-0 (new 'stack-no-clear 'vehicle-controls))) (mem-set32! (&-> gp-0 steering) 6 0) (cond diff --git a/goal_src/jak3/levels/factory/car/lfaccar-init.gc b/goal_src/jak3/levels/factory/car/lfaccar-init.gc index acbf68012c..1a1609ec6b 100644 --- a/goal_src/jak3/levels/factory/car/lfaccar-init.gc +++ b/goal_src/jak3/levels/factory/car/lfaccar-init.gc @@ -7,3 +7,21 @@ ;; DECOMP BEGINS +(defun lfaccar-activate ((arg0 level)) + (format 0 "factorya-activate~%") + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 21) (-> arg0 name)) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +(defun lfaccar-deactivate ((arg0 level)) + (format 0 "factorya-deactivate~%") + (set! (-> *traffic-info* vehicle-level) #f) + (vehicle-manager-kill) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/conveyor.gc b/goal_src/jak3/levels/factory/conveyor.gc index 49f86f4b6b..f2a81f1580 100644 --- a/goal_src/jak3/levels/factory/conveyor.gc +++ b/goal_src/jak3/levels/factory/conveyor.gc @@ -7,3 +7,378 @@ ;; DECOMP BEGINS +(deftype conveyor-section (structure) + ((start vector :inline) + (trailing plane :inline) + (pull-dir vector :inline) + (radial-dir vector :inline) + ) + ) + + +(deftype conveyor-section-array (inline-array-class) + ((data conveyor-section :inline :dynamic) + ) + ) + + +(set! (-> conveyor-section-array heap-base) (the-as uint 64)) + +(deftype conveyor (process-drawable) + ((speed float) + (belt-radius float) + (pull-y-threshold float) + (speed-mult-array (pointer float)) + (speed-mult-array-len int8) + (sections conveyor-section-array) + (leading plane :inline) + (collide-bounds sphere :inline) + ) + (:state-methods + idle + ) + (:methods + (conveyor-method-21 (_type_) float) + (get-skel (_type_) art-group) + (alloc-trsqv! (_type_) none) + (init-fields! (_type_) none) + (alloc-sound! (_type_) none) + (init-skel! (_type_) none) + (push-focus (_type_ process-focusable) symbol) + (find-pushables (_type_) symbol) + ) + ) + + +(defmethod relocate ((this conveyor) (offset int)) + (&+! (-> this sections) offset) + (call-parent-method this offset) + ) + +;; WARN: Return type mismatch symbol vs art-group. +(defmethod get-skel ((this conveyor)) + (the-as art-group #f) + ) + +(defmethod alloc-trsqv! ((this conveyor)) + (set! (-> this root) (new 'process 'trsqv)) + 0 + (none) + ) + +(defmethod init-fields! ((this conveyor)) + (local-vars (sv-16 res-tag)) + (set! (-> this speed) 24576.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this speed-mult-array) (the-as (pointer float) #f)) + (set! (-> this speed-mult-array-len) 0) + (let ((a0-1 (-> this entity))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-4 (res-lump-data a0-1 'scale-factor (pointer float) :tag-ptr (& sv-16)))) + (when v1-4 + (set! (-> this speed-mult-array) v1-4) + (set! (-> this speed-mult-array-len) (the-as int (-> sv-16 elt-count))) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod alloc-sound! ((this conveyor)) + (let ((v1-1 (res-lump-value (-> this entity) 'options uint128 :time -1000000000.0))) + (cond + ((not (logtest? #x10000 v1-1)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "conveyor" :group 0 :fo-max 80) (-> this root trans) 0.0) + ) + ) + (else + (set! (-> this sound) (the-as ambient-sound 0)) + 0 + ) + ) + ) + (none) + ) + +(defmethod push-focus ((this conveyor) (arg0 process-focusable)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> (get-trans arg0 0) quad)) + (set! (-> s4-0 w) 1.0) + (when (>= (vector4-dot s4-0 (the-as vector (-> this leading))) 0.0) + (let* ((a1-2 (-> this sections)) + (a2-0 (-> a1-2 length)) + ) + (dotimes (a0-3 a2-0) + (let ((v1-8 (-> a1-2 data a0-3))) + (when (< (vector4-dot s4-0 (the-as vector (-> v1-8 trailing))) 0.0) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (vector-! a1-3 s4-0 (-> v1-8 start)) + (when (>= (-> this belt-radius) (fabs (vector-dot a1-3 (-> v1-8 radial-dir)))) + (let* ((f0-7 (vector-dot a1-3 (-> v1-8 pull-dir))) + (f1-6 (- (-> a1-3 y) (* (-> v1-8 pull-dir y) f0-7))) + ) + (when (>= (-> this pull-y-threshold) (fabs f1-6)) + (let ((a2-8 (new 'stack-no-clear 'vector))) + (let ((f0-10 (-> this speed))) + (if (< a0-3 (-> this speed-mult-array-len)) + (set! f0-10 (* f0-10 (-> this speed-mult-array a0-3))) + ) + (vector-float*! a2-8 (-> v1-8 pull-dir) (* f0-10 (seconds-per-frame))) + ) + (send-event arg0 'push-trans a2-8 (seconds 10)) + ) + ) + ) + ) + ) + (return #f) + ) + ) + ) + ) + #f + ) + ) + ) + +(defmethod find-pushables ((this conveyor)) + (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (set! *actor-list-length* 0) + (if #t + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> this collide-bounds) *actor-list* 256)) + ) + (when #t + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-11 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? (-> a1-1 prim-core collide-as) + (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (-> this collide-bounds)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))) + ) + (when (< f0-0 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-11) + *collide-player-list* + (set! v1-11 (-> v1-11 next0)) + ) + ) + ) + ) + (when #f + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-18 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-13 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (-> a1-13 prim-core collide-as) + (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (-> this collide-bounds)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r))) + ) + (when (< f0-1 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-18) + *collide-hit-by-player-list* + (set! v1-18 (-> v1-18 next0)) + ) + ) + ) + ) + (dotimes (s5-0 *actor-list-length*) + (let* ((v1-23 (-> *actor-list* s5-0)) + (a0-9 (-> v1-23 root-prim)) + ) + (when (logtest? (-> a0-9 prim-core collide-as) + (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (.lvf vf1 (&-> this collide-bounds quad)) + (.lvf vf2 (&-> a0-9 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-2 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-10 vf3) + (let ((s4-0 (-> v1-23 process))) + (b! (< f0-2 a0-10) cfg-27) + (let ((a1-29 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if a1-29 + (push-focus this (the-as process-focusable a1-29)) + ) + ) + ) + ) + (label cfg-27) + 0 + ) + ) + ) + #f + ) + ) + +(defmethod conveyor-method-21 ((this conveyor)) + (local-vars (sv-32 conveyor-section) (sv-48 conveyor-section)) + (let* ((s5-0 (-> this path)) + (s4-0 (-> s5-0 curve num-cverts)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((s2-0 (new 'process 'conveyor-section-array (+ s4-0 -1)))) + (set! (-> this sections) s2-0) + (set! (-> this collide-bounds quad) (the-as uint128 0)) + (get-point-in-path! s5-0 s3-0 0.0 'exact) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) + (let ((s1-0 (+ s4-0 -1))) + (set! sv-32 (the-as conveyor-section #f)) + (dotimes (s0-0 s1-0) + (set! sv-48 (-> s2-0 data s0-0)) + (set! (-> sv-48 start quad) (-> s3-0 quad)) + (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) + (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) + (vector-normalize! (-> sv-48 pull-dir) 1.0) + (set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad)) + (set! (-> sv-48 trailing y) 0.0) + (vector-normalize! (-> sv-48 trailing) 1.0) + (set-vector! (-> sv-48 radial-dir) (- (-> sv-48 trailing z)) 0.0 (-> sv-48 trailing x) 1.0) + (set! (-> sv-48 trailing w) (- (vector-dot s3-0 (the-as vector (-> sv-48 trailing))))) + (when sv-32 + (vector+! + (the-as vector (-> sv-32 trailing)) + (the-as vector (-> sv-32 trailing)) + (the-as vector (-> sv-48 trailing)) + ) + (vector-normalize! (-> sv-32 trailing) 1.0) + (set! (-> sv-32 trailing w) (- (vector-dot (-> sv-48 start) (the-as vector (-> sv-32 trailing))))) + ) + (set! sv-32 sv-48) + sv-32 + ) + ) + ) + (let ((s2-1 (-> this sections data))) + (set! (-> this leading quad) (-> s2-1 0 pull-dir quad)) + (set! (-> this leading y) 0.0) + (vector-normalize! (-> this leading) 1.0) + (set! (-> this leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> this leading))))) + ) + (let ((f0-19 (/ 1.0 (the float s4-0))) + (f30-0 0.0) + ) + (vector-float*! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) f0-19) + (dotimes (s2-2 s4-0) + (get-point-in-path! s5-0 s3-0 (the float s2-2) 'exact) + (let ((f0-22 (vector-vector-distance-squared s3-0 (-> this collide-bounds)))) + (if (< f30-0 f0-22) + (set! f30-0 f0-22) + ) + ) + ) + (set! (-> this collide-bounds r) (+ (sqrtf f30-0) (-> this belt-radius))) + ) + ) + ) + +(defstate idle (conveyor) + :virtual #t + :code sleep-code + :post (behavior () + (find-pushables self) + (if (nonzero? (-> self sound)) + (update! (-> self sound)) + ) + ) + ) + +;; WARN: Return type mismatch draw-control vs none. +(defmethod init-skel! ((this conveyor)) + (if (get-skel this) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + ) + (none) + ) + +(defmethod init-from-entity! ((this conveyor) (arg0 entity-actor)) + (alloc-trsqv! this) + (process-drawable-from-entity! this arg0) + (init-skel! this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) + (go process-drawable-art-error "bad path") + ) + (init-fields! this) + (alloc-sound! this) + (conveyor-method-21 this) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/factory/fac-gunturret.gc b/goal_src/jak3/levels/factory/fac-gunturret.gc index bd31e2f2eb..e56f0b95a0 100644 --- a/goal_src/jak3/levels/factory/fac-gunturret.gc +++ b/goal_src/jak3/levels/factory/fac-gunturret.gc @@ -7,3 +7,1037 @@ ;; DECOMP BEGINS +(defpartgroup group-fac-gunturret-hit + :id 779 + :duration (seconds 3) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2914 :period (seconds 3) :length (seconds 0.017)) + (sp-item 2915 :period (seconds 0.067) :length (seconds 0.017)) + (sp-item 2916 :period (seconds 5) :length (seconds 0.017)) + (sp-item 2917 :period (seconds 0.335) :length (seconds 0.017)) + (sp-item 2918 :period (seconds 5) :length (seconds 2)) + ) + ) + +(defpart 2914 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters -2)) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 50.0) + (:b 0.0) + (:a 32.0) + (:fade-a -0.053333335) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2915 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.0 2.0) + (:x (meters -1) (meters 2)) + (:y (meters -3) (meters 1)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 5) (meters 5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 180.0) + (:a 128.0) + (:omega (degrees 9011.25)) + (:scalevel-x (meters -0.16666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067) (seconds 0.065)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2916 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2917 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 1 50.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 20.0 50.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 0.167) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2918 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.2 3.0) + (:y (meters -3)) + (:scale-x (meters 3) (meters 5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 255.0) + (:g 80.0 20.0) + (:b 20.0) + (:a 255.0) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:timer (seconds 0.035) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +(defpartgroup group-fac-gunturret-smoke + :id 780 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2919 :flags (sp7))) + ) + +(defpart 2919 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 16.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.10666667) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fac-gunturret-casing + :id 781 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2920 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 2921 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 2921 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 32.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.56) + (:fade-g -2.56) + (:fade-b 2.56) + (:fade-a -0.32) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.167)) + (:next-launcher 2922) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2922 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667)) + ) + +(defpart 2920 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:z (meters -0.4)) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.15) (meters 0.02)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:fade-b -8.0) + (:accel-y (meters -0.0016666667) (meters -0.0016666667)) + (:friction 0.9 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.05)) + (:next-launcher 2923) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2923 + :init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96)) + ) + +(defskelgroup skel-fac-gunturret fac-gun-tower-turret fac-gun-tower-turret-lod0-jg fac-gun-tower-turret-idle-ja + ((fac-gun-tower-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(defskelgroup skel-fac-gunturret-explode fac-gun-tower-turret fac-gun-tower-turret-explode-lod0-jg fac-gun-tower-turret-explode-idle-ja + ((fac-gun-tower-turret-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +(define *fac-gunturret-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(deftype fac-gun-tower-turret-params (structure) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (left-barrel-joint int32) + (right-barrel-joint int32) + (left-gun-joint int32) + (right-gun-joint int32) + ) + ) + + +(deftype fac-gunturret (enemy) + ((left-gun-tilt-jm joint-mod) + (right-gun-tilt-jm joint-mod) + (params fac-gun-tower-turret-params) + (aim-pos vector :inline) + (gun-twist float) + (gun-tilt float) + (desired-twist float) + (desired-tilt float) + (los-clear symbol) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (flash-state symbol) + (can-shoot symbol) + (last-hit-time time-frame) + (init-mat matrix :inline) + (activate-distance float) + (aim-offset vector :inline) + (use-alt-barrel symbol) + (rotate-sound sound-id) + (rotate-sound-playing symbol) + (snd-cmd-time time-frame) + ) + (:methods + (track-target (_type_ symbol) none) + (check-los (_type_) none) + (reset-aim (_type_) none) + (fire-shot (_type_ symbol) none) + (init-turret-params! (_type_) none) + (go-explode (_type_) (pointer joint-exploder)) + ) + ) + + +(define *fac-gunturret-enemy-info* (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 2 + :param1 2 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 4 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :bullseye-joint 9 + :notice-distance (meters 50) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +(set! (-> *fac-gunturret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defmethod track-target ((this fac-gunturret) (arg0 symbol)) + (cond + ((and arg0 (-> this los-clear)) + (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-2 + (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + (vector+! (-> this aim-pos) (-> this aim-pos) (-> this aim-offset)) + ) + ) + ) + (else + (reset-aim this) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params track-joint)))) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> this aim-pos) (-> this root trans)) + (vector-flatten! s4-0 s4-0 (-> this init-mat uvec)) + (vector-normalize! s4-0 1.0) + (set! (-> this desired-twist) + (atan (vector-dot (the-as vector (-> this init-mat)) s4-0) (vector-dot (-> this init-mat fvec) s4-0)) + ) + (cond + (#t + (vector-normalize-copy! + s3-0 + (-> this node-list data (-> this params right-barrel-joint) bone transform uvec) + 1.0 + ) + (vector-! s4-0 (-> this aim-pos) s5-1) + (vector-normalize! s4-0 1.0) + (set! (-> this desired-tilt) (- (asin (-> s4-0 y)))) + (set! (-> this desired-tilt) (fmax -14563.556 (fmin 0.0 (+ 3640.889 (-> this desired-tilt))))) + ) + (else + ) + ) + ) + (vector-normalize-copy! + (-> this aim-pos) + (-> this node-list data (-> this params left-gun-joint) bone transform uvec) + (vector-vector-distance s5-1 (-> this aim-pos)) + ) + ) + (vector+! + (-> this aim-pos) + (-> this aim-pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params left-barrel-joint))) + ) + (let ((s5-3 (new 'stack-no-clear 'matrix))) + (+! (-> this gun-twist) + (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-twist) (-> this gun-twist))))) + ) + (matrix-rotate-y! s5-3 (-> this gun-twist)) + (matrix*! s5-3 s5-3 (-> this init-mat)) + (matrix->quaternion (-> this root quat) s5-3) + ) + (+! (-> this gun-tilt) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-tilt) (-> this gun-tilt)))))) + (quaternion-axis-angle! (-> this left-gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) + (quaternion-axis-angle! (-> this right-gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) + 0 + (none) + ) + +(defmethod check-los ((this fac-gunturret)) + (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) + (if a0-2 + (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + ) + ) + (let* ((s4-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params left-gun-joint))) + ) + (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) s4-0)) + ) + (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> this init-mat fvec)) + (cos 364.0889) + ) + (let ((a1-5 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-5 start-pos quad) (-> s4-0 quad)) + (set! (-> a1-5 move-dist quad) (-> s5-3 quad)) + (let ((v1-17 a1-5)) + (set! (-> v1-17 radius) 409.6) + (set! (-> v1-17 collide-with) + (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) + ) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-5) 0.0) + (set! (-> this los-clear) #f) + (set! (-> this los-clear) #t) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod reset-aim ((this fac-gunturret)) + (vector+float*! (-> this aim-pos) (-> this root trans) (-> this init-mat fvec) 163840.0) + (vector-reset! (-> this aim-offset)) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod fire-shot ((this fac-gunturret) (arg0 symbol)) + (let ((s0-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params right-barrel-joint))) + ) + (s3-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params left-barrel-joint))) + ) + (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (let* ((s1-1 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) s0-0)) + (f30-0 (/ 2013265900.0 (vector-length s1-1))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 ent) (-> this entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options)) + (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) + (set! (-> s4-0 pos quad) (-> s0-0 quad)) + (set! (-> s4-0 notify-handle) (process->handle this)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 target-handle) (the-as handle #f)) + (set! (-> s4-0 target-pos quad) (the-as uint128 0)) + (set! (-> s4-0 ignore-handle) (process->handle this)) + (let* ((v1-24 *game-info*) + (a0-15 (+ (-> v1-24 attack-id) 1)) + ) + (set! (-> v1-24 attack-id) a0-15) + (set! (-> s4-0 attack-id) a0-15) + ) + (set! (-> s4-0 timeout) (seconds 4)) + (set! (-> s4-0 damage) 2.0) + (logior! (-> s4-0 options) (projectile-options po14)) + (vector-normalize-copy! (-> s4-0 vel) s1-1 491520.0) + (let ((f30-1 (fmin 16384.0 f30-0))) + (set-vector! s2-0 (-> s1-1 z) (-> s1-1 y) (- (-> s1-1 x)) 1.0) + (vector-normalize! s2-0 (rand-vu-float-range (- f30-1) f30-1)) + (vector+! (-> s4-0 vel) (-> s4-0 vel) s2-0) + (vector-cross! s2-0 s2-0 (-> s4-0 vel)) + (vector-normalize! s2-0 (rand-vu-float-range (- f30-1) f30-1)) + ) + (vector+! (-> s4-0 vel) (-> s4-0 vel) s2-0) + ) + (if (-> this use-alt-barrel) + (set! (-> s4-0 pos quad) (-> s3-0 quad)) + ) + (set! (-> this use-alt-barrel) (not (-> this use-alt-barrel))) + (spawn-projectile fturret-shot s4-0 this *default-dead-pool*) + ) + (if arg0 + (sound-play "smallturret-fir") + ) + (set! (-> this flash-state) #t) + (none) + ) + +(defstate hostile (fac-gunturret) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (ja :group! (-> self draw art-group data (-> self params idle-anim))) + (set! (-> self flash-state) #f) + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (>= 2 (the-as int (-> self focus aware))) + (go-stare self) + ) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (reset-aim self) + (until #f + (current-time) + (until (time-elapsed? (-> self last-hit-time) (seconds 2)) + (suspend) + ) + (when (task-node-closed? (game-task-node factory-sky-battle-wave2)) + (cleanup-for-death self) + (go-virtual die-fast) + ) + (check-los self) + (when (-> self los-clear) + (new 'stack-no-clear 'vector) + (rand-vu-sphere-point-uniform! (-> self aim-offset) (* 61440.0 (rand-vu))) + ) + (set! (-> self rotate-sound-playing) #t) + (sound-play-by-name + (static-sound-name "smallturret-rot") + (-> self rotate-sound) + 1024 + (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) + 0 + (sound-group) + (-> self root trans) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.75)) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> self aim-pos quad)) + (track-target self #t) + (vector-! s5-2 (-> self aim-pos) s5-2) + (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) + 0.0 + (vector-length s5-2) + (sound-play-by-name + (static-sound-name "smallturret-rot") + (-> self rotate-sound) + 1024 + (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) + 0 + (sound-group) + (-> self root trans) + ) + (set-time! (-> self snd-cmd-time)) + ) + ) + (suspend) + ) + ) + (when (-> self rotate-sound-playing) + (sound-stop (-> self rotate-sound)) + (set! (-> self rotate-sound-playing) #f) + ) + (ja :group! (-> self draw art-group data (-> self params shoot-anim))) + (let ((s5-4 0) + (gp-3 #t) + ) + (sound-play "smallturret-fir") + (cond + ((not (-> self can-shoot)) + ) + ((time-elapsed? (the-as time-frame s5-4) (seconds 0.05)) + (fire-shot self gp-3) + (current-time) + (not gp-3) + ) + (else + (set! (-> self flash-state) #f) + ) + ) + ) + (ja :num! (loop!)) + (set! (-> self flash-state) #f) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self params idle-anim))) + ) + #f + ) + ) + +(defstate stare (fac-gunturret) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (!= (-> self activate-distance) 0.0) + (track-target self #f) + ) + ) + ) + +(defmethod event-handler ((this fac-gunturret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) + (set-time! (-> this last-hit-time)) + ) + (case arg2 + (('start) + (let ((v0-0 (the-as object #t))) + (set! (-> this can-shoot) (the-as symbol v0-0)) + v0-0 + ) + ) + (('stop) + (set! (-> this can-shoot) #f) + #f + ) + (('bonk) + (send-event arg0 'target-mech-get-off (seconds 0.3)) + (send-event arg0 'shove #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) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + #f + ) + (('flash-state) + (-> this flash-state) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer joint-exploder). +(defmethod go-explode ((this fac-gunturret)) + (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 'joint-exploder-tuning (the-as uint 0)))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sound-play "explosion") + (let ((v1-2 (-> s5-0 fountain-rand-transv-lo))) + (let ((a0-5 (-> this root trans))) + (let ((a1-2 *up-vector*)) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-2 quad)) + ) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-2 quad) vf6) + ) + (vector-float*! s4-0 *up-vector* (* 4096.0 (rand-vu-float-range 20.0 30.0))) + (let ((a1-4 (-> s5-0 fountain-rand-transv-lo))) + (let ((v1-4 s4-0)) + (let ((a0-7 *identity-vector*)) + (let ((a2-5 -204800.0)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-7 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-4 quad) vf6) + ) + (let ((a0-8 (-> s5-0 fountain-rand-transv-hi))) + (let ((v1-5 *identity-vector*)) + (let ((a1-6 204800.0)) + (.mov vf7 a1-6) + ) + (.lvf vf5 (&-> v1-5 quad)) + ) + (.lvf vf4 (&-> s4-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-8 quad) vf6) + ) + ) + (set! (-> s5-0 gravity) -122880.0) + (process-spawn + joint-exploder + (-> this params explode-sg) + 9 + s5-0 + *fac-gunturret-exploder-params* + :name "joint-exploder" + :to this + :unk 0 + ) + ) + ) + ) + +(defstate die (fac-gunturret) + :virtual #t + :enter (behavior () + (on-dying self) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self hit-points) 0.0) + (when (-> self rotate-sound-playing) + (sound-stop (-> self rotate-sound)) + (set! (-> self rotate-sound-playing) #f) + ) + ) + :code (behavior () + (go-explode self) + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) + (sound-play "smallturret-exp") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (+! (-> gp-1 y) 12288.0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2)) + (spawn (-> self part) gp-1) + (suspend) + ) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defmethod init-enemy-collision! ((this fac-gunturret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 9216.0 4096.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 8192.0 0.0 18432.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 5) + (set-vector! (-> v1-16 local-sphere) 0.0 24576.0 0.0 4096.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-18 transform-index) 7) + (set-vector! (-> v1-18 local-sphere) 0.0 24576.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod is-pfoc-in-mesh? ((this fac-gunturret) (arg0 process-focusable) (arg1 vector)) + (if (= (-> this activate-distance) 0.0) + (return #t) + (return (< (fabs (vector-dot + (vector-! (new 'stack-no-clear 'vector) (get-trans arg0 3) (-> this root trans)) + (-> this init-mat fvec) + ) + ) + (-> this activate-distance) + ) + ) + ) + (the-as symbol 0) + ) + +(defmethod deactivate ((this fac-gunturret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (-> this rotate-sound-playing) + (sound-stop (-> this rotate-sound)) + (set! (-> this rotate-sound-playing) #f) + ) + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this casing-part)) + (kill-particles (-> this casing-part)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +(defmethod coin-flip? ((this fac-gunturret)) + #f + ) + +;; WARN: Return type mismatch enemy vs fac-gunturret. +(defmethod relocate ((this fac-gunturret) (offset int)) + (if (nonzero? (-> this left-gun-tilt-jm)) + (&+! (-> this left-gun-tilt-jm) offset) + ) + (if (nonzero? (-> this right-gun-tilt-jm)) + (&+! (-> this right-gun-tilt-jm) offset) + ) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this casing-part)) + (&+! (-> this casing-part) offset) + ) + (the-as fac-gunturret ((method-of-type enemy relocate) this offset)) + ) + +(defmethod init-turret-params! ((this fac-gunturret)) + (let ((s5-0 + (new 'static 'fac-gun-tower-turret-params + :idle-anim 4 + :shoot-anim 4 + :track-joint 3 + :left-barrel-joint 6 + :right-barrel-joint 8 + :left-gun-joint 7 + :right-gun-joint 5 + ) + ) + ) + (set! (-> s5-0 normal-sg) + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gunturret" (the-as (pointer level) #f))) + ) + (set! (-> s5-0 explode-sg) + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gunturret-explode" (the-as (pointer level) #f)) + ) + ) + (set! (-> s5-0 enemy-info) *fac-gunturret-enemy-info*) + (set! (-> this params) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this fac-gunturret)) + (init-turret-params! this) + (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) + (init-enemy-defaults! this (-> this params enemy-info)) + (set! (-> this draw light-index) (the-as uint 10)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 779) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 780) this)) + (set! (-> this casing-part) (create-launch-control (-> *part-group-id-table* 781) this)) + (set! (-> this left-gun-tilt-jm) + (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this params left-gun-joint)) + ) + (set! (-> this right-gun-tilt-jm) + (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this params right-gun-joint)) + ) + (set! (-> this los-clear) #f) + (set! (-> this gun-twist) 0.0) + (set! (-> this gun-tilt) 0.0) + (set! (-> this desired-twist) 0.0) + (set! (-> this desired-tilt) 0.0) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this last-hit-time) 0) + (set! (-> this use-alt-barrel) #f) + (set! (-> this rotate-sound) (new-sound-id)) + (set! (-> this rotate-sound-playing) #f) + (set-time! (-> this snd-cmd-time)) + (quaternion->matrix (-> this init-mat) (-> this root quat)) + (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance)) + (set! (-> this activate-distance) 163840.0) + 0 + (none) + ) + +(defmethod go-idle2 ((this fac-gunturret)) + (go (method-of-object this idle)) + ) + +(deftype fac-gun-tower-turret (fac-gunturret) + () + ) diff --git a/goal_src/jak3/levels/factory/fac-part.gc b/goal_src/jak3/levels/factory/fac-part.gc index 318340ea54..4ac6d85305 100644 --- a/goal_src/jak3/levels/factory/fac-part.gc +++ b/goal_src/jak3/levels/factory/fac-part.gc @@ -5,5 +5,2388 @@ ;; name in dgo: fac-part ;; dgos: FACTORYA +(define-extern *range-ffexplo-dust-color* curve-color-fast) +(define-extern *range-ffexplo-dust-alpha* curve2d-fast) +(define-extern *range-ffexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ffexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ffexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ffexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ffexplo-dust-scale-y* curve2d-fast) +(define-extern *range-ffexplo-color* curve-color-fast) +(define-extern *range-ffexplo-alpha* curve2d-fast) +(define-extern *range-ffexplo-scale-x* curve2d-fast) +(define-extern *range-ffexplo-scale-y* curve2d-fast) +(define-extern *curve-ffexplo-alpha* curve2d-fast) +(define-extern *curve-ffexplo-scale-x* curve2d-fast) +(define-extern *curve-ffexplo-scale-y* curve2d-fast) +(define-extern *range-fgtexplo-color* curve-color-fast) +(define-extern *range-fgtexplo-alpha* curve2d-fast) +(define-extern *range-fgtexplo-scale-x* curve2d-fast) +(define-extern *range-fgtexplo-scale-y* curve2d-fast) +(define-extern *curve-fgtexplo-alpha* curve2d-fast) +(define-extern *curve-fgtexplo-scale-x* curve2d-fast) +(define-extern *curve-fgtexplo-scale-y* curve2d-fast) +(define-extern *range-ftexplo-dust-color* curve-color-fast) +(define-extern *range-ftexplo-dust-alpha* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *range-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-dust-alpha* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-dust-scale-y* curve2d-fast) +(define-extern *range-ftexplo-color* curve-color-fast) +(define-extern *range-ftexplo-alpha* curve2d-fast) +(define-extern *range-ftexplo-scale-x* curve2d-fast) +(define-extern *range-ftexplo-scale-y* curve2d-fast) +(define-extern *curve-ftexplo-alpha* curve2d-fast) +(define-extern *curve-ftexplo-scale-x* curve2d-fast) +(define-extern *curve-ftexplo-scale-y* curve2d-fast) +(define-extern *range-gthoexplo-color* curve-color-fast) +(define-extern *range-gthoexplo-alpha* curve2d-fast) +(define-extern *range-gthoexplo-scale-x* curve2d-fast) +(define-extern *range-gthoexplo-scale-y* curve2d-fast) +(define-extern *curve-gthoexplo-alpha* curve2d-fast) +(define-extern *curve-gthoexplo-scale-x* curve2d-fast) +(define-extern *curve-gthoexplo-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-hellcat-thrust + :id 728 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2761 :flags (is-3d sp3 sp7)) (sp-item 2762 :flags (sp3 sp7))) + ) + +(defpart 2761 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 1.0) + (:z (meters 0)) + (:scale-x (meters 0)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 200.0) + (:vel-y (meters 0)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2762 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0)) + (:scale-y (meters 0)) + (:r 40.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 30.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thrust-afterburn + :id 729 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2763 :flags (sp3 sp7))) + ) + +(defpart 2763 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 4) (meters 1)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 128.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fac-fighter-explosion + :id 730 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2765 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2766 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2767 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2768 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2769 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2770 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2771 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2772 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 2765 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2766 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2767 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2768 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2769 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ffexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ffexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ffexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ffexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ffexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ffexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ffexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-fighter-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2769 init-specs 14 initial-valuef) + (the-as float *part-fac-fighter-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* color-start) *range-ffexplo-dust-color*) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* alpha-start) *range-ffexplo-dust-alpha*) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-x-start) *range-ffexplo-dust-scale-x*) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-y-start) *range-ffexplo-dust-scale-y*) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* a-scalar) *curve-ffexplo-dust-alpha*) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-x-scalar) *curve-ffexplo-dust-scale-x*) + +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-y-scalar) *curve-ffexplo-dust-scale-y*) + +(defpart 2771 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2772 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ffexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ffexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ffexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ffexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ffexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ffexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ffexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-fighter-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2772 init-specs 16 initial-valuef) + (the-as float *part-fac-fighter-explosion-texture-curve-settings*) + ) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* color-start) *range-ffexplo-color*) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* alpha-start) *range-ffexplo-alpha*) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-x-start) *range-ffexplo-scale-x*) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-y-start) *range-ffexplo-scale-y*) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* a-scalar) *curve-ffexplo-alpha*) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-x-scalar) *curve-ffexplo-scale-x*) + +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-y-scalar) *curve-ffexplo-scale-y*) + +(defpart 2770 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2773 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2764 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-fac-gun-tower-explosion + :id 731 + :duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2775 :flags (sp3) :period (seconds 5) :length (seconds 0.017)) + (sp-item 2776 :flags (sp3) :period (seconds 5) :length (seconds 0.017)) + (sp-item 2777 :flags (sp3) :period (seconds 5) :length (seconds 0.017)) + (sp-item 2778 :period (seconds 5) :length (seconds 0.335)) + (sp-item 2779 :period (seconds 5) :length (seconds 0.5)) + (sp-item 2780 :flags (sp3) :binding 2774) + (sp-item 2780 :flags (sp3) :binding 2774) + (sp-item 2780 :flags (sp3) :binding 2774) + (sp-item 2774 :flags (sp2) :period (seconds 5) :length (seconds 2)) + (sp-item 2774 :flags (sp2) :period (seconds 5) :length (seconds 2)) + (sp-item 2774 :flags (sp2) :period (seconds 5) :length (seconds 2)) + ) + ) + +(defpart 2775 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 200)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2776 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 10.0) + (:scale-x (meters 20) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.4)) + (:scalevel-x (meters 0.06666667)) + (:rotvel-z (degrees -0.2) 1 (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85 -0.85) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2778 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 30) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 2.6666667) (meters 1)) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.7) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2779 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 4.0) + (:x (meters -10) (meters 20)) + (:y (meters 0) (meters 10)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.16666667)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-fgtexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fgtexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fgtexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fgtexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fgtexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fgtexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fgtexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-tower-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2779 init-specs 16 initial-valuef) + (the-as float *part-fac-tower-explosion-texture-curve-settings*) + ) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* color-start) *range-fgtexplo-color*) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* alpha-start) *range-fgtexplo-alpha*) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-x-start) *range-fgtexplo-scale-x*) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-y-start) *range-fgtexplo-scale-y*) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* a-scalar) *curve-fgtexplo-alpha*) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-x-scalar) *curve-fgtexplo-scale-x*) + +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-y-scalar) *curve-fgtexplo-scale-y*) + +(defpart 2777 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 200)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -3.3333333)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2780 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 20)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters -0.13333334) (meters -0.13333334)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2774 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 0.5) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 80.0) + (:a 128.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-fac-tank-explosion + :id 732 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2782 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2783 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2784 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2785 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2786 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2787 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2788 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2789 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 2782 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 60.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2783 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0 20.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2784 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0 20.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2785 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2786 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ftexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-tank-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2786 init-specs 14 initial-valuef) + (the-as float *part-fac-tank-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* color-start) *range-ftexplo-dust-color*) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* alpha-start) *range-ftexplo-dust-alpha*) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-x-start) *range-ftexplo-dust-scale-x*) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-y-start) *range-ftexplo-dust-scale-y*) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* a-scalar) *curve-ftexplo-dust-alpha*) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-x-scalar) *curve-ftexplo-dust-scale-x*) + +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-y-scalar) *curve-ftexplo-dust-scale-y*) + +(defpart 2788 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2789 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-ftexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-tank-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2789 init-specs 16 initial-valuef) + (the-as float *part-fac-tank-explosion-texture-curve-settings*) + ) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* color-start) *range-ftexplo-color*) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* alpha-start) *range-ftexplo-alpha*) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-x-start) *range-ftexplo-scale-x*) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-y-start) *range-ftexplo-scale-y*) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* a-scalar) *curve-ftexplo-alpha*) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-x-scalar) *curve-ftexplo-scale-x*) + +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-y-scalar) *curve-ftexplo-scale-y*) + +(defpart 2787 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2790 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.02) (meters -0.02)) + (:rotvel-z (degrees -300) (degrees 600)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 70)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2781 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 100.0) + (:a 128.0) + (:fade-r -1.7) + (:fade-g -1.3333334) + (:fade-b -1.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + ) + ) + +(defpartgroup group-fac-target-explosion + :id 733 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2791 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2792 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2793 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +(defpart 2791 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 200.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2792 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.8) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2793 + :init-specs ((:texture (dust-sparkle factorya-sprite)) + (:num 10.0 10.0) + (:y (meters 2)) + (:scale-x (meters 5) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2794 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.75)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees -4) (degrees 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 2795 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 20.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 9013.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +(defpart 2796 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 20.0 20.0) + (:a 64.0) + (:omega (degrees 9013.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +(defpartgroup group-gun-tower-hit-explosion + :id 734 + :duration (seconds 4) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2797 :flags (sp3 sp7))) + ) + +(defpart 2797 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0) + (:b 0.0) + (:a 255.0) + (:vel-z (meters -0.033333335)) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -4.25) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-gun-tower-hit-object + :id 735 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2799 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2800 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2801 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2802 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2803 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2804 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +(defpart 2799 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2800 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2801 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2803 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2804 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-gthoexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-gthoexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-gthoexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-gthoexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-gthoexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-gthoexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-gthoexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-gun-tower-hit-object-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2804 init-specs 16 initial-valuef) + (the-as float *part-gun-tower-hit-object-texture-curve-settings*) + ) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* color-start) *range-gthoexplo-color*) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* alpha-start) *range-gthoexplo-alpha*) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-x-start) *range-gthoexplo-scale-x*) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-y-start) *range-gthoexplo-scale-y*) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* a-scalar) *curve-gthoexplo-alpha*) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-x-scalar) *curve-gthoexplo-scale-x*) + +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-y-scalar) *curve-gthoexplo-scale-y*) + +(defpart 2802 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2805 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2798 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-fac-positionlight-yellow-glow + :id 736 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2806 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2806 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-launchpad-red-glow + :id 737 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2807 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2807 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-hangingbrace-white-glow + :id 738 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2808 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2808 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-spot-white-glow + :id 739 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 2809 :fade-after (meters 400) :flags (sp6)) + (sp-item 2810 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + (sp-item 2811 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + (sp-item 2812 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + (sp-item 2813 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + ) + ) + +(defpart 2809 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 13.500001)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 2810 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2811 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2812 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 2813 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpartgroup group-fac-bulb-red-glow + :id 740 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2814 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2814 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-topsidewall-white-glow + :id 741 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2815 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2815 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-cornertower-white-glow + :id 742 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2816 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2816 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-supportarm-white-glow + :id 743 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2817 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2817 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-blinklite-glow + :id 744 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2818 :flags (sp6))) + ) + +(defpart 2818 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-steam + :id 745 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 2819 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +(defpart 2819 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1 0.1) + (:x (meters -2) (meters 4)) + (:y (meters -1) (meters 2)) + (:z (meters 0)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters -0.0033333334) (meters -0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.26666668) + (:accel-y (meters 0.00006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 2820) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2820 + :init-specs ((:fade-a -0.03809524 -0.03809524)) + ) + +(defpartgroup group-fac-volumelight-yellow-glow + :id 746 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2821 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2821 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 80.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-fac-glowlite-yellow-glow + :id 747 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2822 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2822 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-glowt-yellow-glow + :id 748 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2823 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2823 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 5.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-grate-yellow-glow + :id 749 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2824 :fade-after (meters 120) :flags (sp6))) + ) + +(defpart 2824 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 80.0 5.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-break-floor-bust + :id 750 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2825 :flags (sp7) :period (seconds 20) :length (seconds 0.067))) + ) + +(defpart 2825 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0) + (:x (meters 0) (meters 4)) + (:scale-x (meters 2) (meters 3)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 190.0) + (:g 170.0) + (:b 150.0) + (:a 64.0 64.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.06666667) (degrees 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 80) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-fac-break-fence-bust + :id 751 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2826 :flags (sp7) :period (seconds 20) :length (seconds 0.067))) + ) + +(defpart 2826 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 10.0) + (:x (meters -6) (meters 12)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 100.0 80.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fac-robopod-bust + :id 752 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2827 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2828 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2829 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +(defpart 2827 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 200.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 2828 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.8) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2829 + :init-specs ((:texture (dust-sparkle factorya-sprite)) + (:num 10.0 10.0) + (:y (meters 2)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-fac-switch-glow-red + :id 753 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2830 :flags (sp6 sp7))) + ) + +(defpart 2830 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-switch-glow-green + :id 754 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2831 :flags (sp6 sp7))) + ) + +(defpart 2831 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-fac-rotfan-barrier + :id 755 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2832 :flags (is-3d sp7))) + ) + +(defpart 2832 + :init-specs ((:texture (fan-blade factorya-sprite)) + (:num 0.017) + (:scale-x (meters 38)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 70.0) + (:b 128.0) + (:a 40.0 10.0) + (:rotvel-y (degrees -3.0000002)) + (:timer (seconds 2)) + (:flags ()) + (:rotate-y (degrees 0)) + ) + ) diff --git a/goal_src/jak3/levels/factory/fac-robotank-turret.gc b/goal_src/jak3/levels/factory/fac-robotank-turret.gc index db39112f39..58fe1b4af3 100644 --- a/goal_src/jak3/levels/factory/fac-robotank-turret.gc +++ b/goal_src/jak3/levels/factory/fac-robotank-turret.gc @@ -5,5 +5,903 @@ ;; name in dgo: fac-robotank-turret ;; dgos: LFACTORY +;; +++fac-robotank-turret-flag +(defenum fac-robotank-turret-flag + :type uint16 + :bitfield #t + (frt0 0) + (frt1 1) + (frt2 2) + (frt3 3) + (frt4 4) + (frt5 5) + (frt6 6) + (frt7 7) + (frt8 8) + (frt9 9) + (frt10 10) + ) +;; ---fac-robotank-turret-flag + + ;; DECOMP BEGINS +(deftype fac-robotank-turret (process-focusable) + ((los los-control :inline) + (tank-quat quaternion :inline) + (tank-quat-vibe-only quaternion :inline) + (rotate-quat quaternion :inline) + (rotate-rate float) + (rotate-mult float) + (shot-range float) + (fov-mult float) + (offset vector :inline) + (sight-pos vector :inline) + (firing-sight-pos vector :inline) + (aim-pos vector 3 :inline) + (gun-timer time-frame) + (gun-elev-jmod joint-mod) + (gun-elev float) + (gun-elev-cam float) + (gun-joint-l int32 2) + (gun-joint-r int32 2) + (gun-spread float) + (gun-index int32) + (flags fac-robotank-turret-flag) + (turn-sound-id sound-id) + ) + (:state-methods + ready + fire + die + ) + (:methods + (fac-robotank-turret-method-31 (_type_ vector vector) object) + (fac-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer ftank-shot)) + (fac-robotank-turret-method-33 (_type_) none) + (fac-robotank-turret-method-34 (_type_ vector float) symbol) + ) + ) + + +(deftype fac-robotank-reticle (process-drawable) + ((shadow-jmod joint-mod-set-local) + (sight-jmod joint-mod-set-local) + (ring-jmod joint-mod 3) + (ring-timer time-frame) + (sight-scale vector :inline) + (collide-dist float) + ) + (:state-methods + unlock + lock + ) + ) + + +(defpartgroup group-robotank-steamescape + :id 782 + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 2924 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +(defpart 2924 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 1.0) + (:x (meters -3) (meters 5)) + (:y (meters -0.1) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.005) (meters 0.0025)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 2925) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2925 + :init-specs ((:fade-a -0.064 -0.064)) + ) + +(defbehavior fac-robotank-reticle-post fac-robotank-reticle () + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (camera-pos)) + (s4-0 (-> self draw shadow-ctrl settings shadow-dir)) + (gp-0 (-> self draw shadow-ctrl settings bot-plane)) + (s2-0 (-> self draw shadow-ctrl settings top-plane)) + ) + (-> self draw shadow-ctrl settings) + (vector-normalize! s5-0 1.0) + (vector-negate! s1-0 s5-0) + (set! (-> s4-0 x) (-> s5-0 x)) + (set! (-> s4-0 y) (-> s5-0 y)) + (set! (-> s4-0 z) (-> s5-0 z)) + (set! (-> s4-0 w) -16384.0) + (set! (-> s2-0 quad) (-> s5-0 quad)) + (set! (-> gp-0 quad) (-> s5-0 quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector+float*! s4-1 (-> self root trans) s5-0 -4096.0) + (set! (-> s2-0 w) (- (vector-dot s4-1 s5-0))) + (vector+float*! s4-1 (-> self root trans) s5-0 (-> self collide-dist)) + (let* ((a1-6 (vector-! (new 'stack-no-clear 'vector) s3-0 s4-1)) + (f1-0 (vector-length a1-6)) + (a2-2 + (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-6 (fmax -20480.0 (fmin 20480.0 (* 0.75 f1-0)))) + ) + (v1-26 (vector-float*! (new 'stack-no-clear 'vector) s5-0 (- (vector-dot a2-2 s5-0)))) + ) + (vector+! s4-1 s4-1 v1-26) + ) + (set! (-> gp-0 w) (- (vector-dot s4-1 s5-0))) + ) + ) + 0 + (vector-seek! (-> self sight-jmod transform scale) (-> self sight-scale) (* 6.0 (seconds-per-frame))) + (ja-post) + (none) + ) + +(defbehavior fac-robotank-reticle-handler fac-robotank-reticle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('update-trans-only) + (set! v0-0 (-> self root trans)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + (('update) + (let ((s5-0 (the-as vector (-> arg3 param 0))) + (gp-0 (the-as vector (-> arg3 param 1))) + ) + (let ((a1-3 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0) 1.0) + ) + ) + (set! (-> self root trans quad) (-> s5-0 quad)) + (forward-up->quaternion (-> self root quat) a1-3 *up-vector*) + ) + (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0))) + (gp-1 (-> self sight-scale)) + ) + (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) + (set! (-> gp-1 x) f0-1) + (set! (-> gp-1 y) f0-1) + f0-1 + ) + ) + ) + ) + (('collide-dist) + (set! (-> self collide-dist) (the-as float (-> arg3 param 0))) + ) + (('on) + (let ((v1-14 (-> self draw shadow-ctrl))) + (logclear! (-> v1-14 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('off) + (let ((v1-19 (-> self draw shadow-ctrl))) + (logior! (-> v1-19 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('spotlight-on) + (let ((v1-25 (-> self draw shadow-ctrl))) + (logclear! (-> v1-25 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (('spotlight-off) + (let ((v1-27 (-> self draw shadow-ctrl))) + (logior! (-> v1-27 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (('lock) + (go-virtual lock) + ) + (('unlock) + (go-virtual unlock) + ) + (('die) + (go empty-state) + ) + ) + ) + +(defskelgroup skel-fac-robotank-turret fac-robotank-top fac-robotank-top-lod0-jg fac-robotank-top-idle-ja + ((fac-robotank-top-lod0-mg (meters 20)) (fac-robotank-top-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :origin-joint-index 3 + ) + +(defpart 2926 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 0.0) + (:b :copy g) + (:a 96.0 64.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer ftank-shot). +(defmethod fac-robotank-turret-method-32 ((this fac-robotank-turret) (arg0 (inline-array vector))) + (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s5-0 (-> arg0 0)) + (gp-0 (-> arg0 1)) + ) + (set! (-> s4-0 ent) (-> this entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options)) + (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) + (set! (-> s4-0 pos quad) (-> s5-0 quad)) + (set! (-> s4-0 notify-handle) (process->handle this)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 target-handle) (the-as handle #f)) + (set! (-> s4-0 target-pos quad) (the-as uint128 0)) + (set! (-> s4-0 ignore-handle) (process->handle this)) + (let* ((v1-12 *game-info*) + (a0-13 (+ (-> v1-12 attack-id) 1)) + ) + (set! (-> v1-12 attack-id) a0-13) + (set! (-> s4-0 attack-id) a0-13) + ) + (set! (-> s4-0 timeout) (seconds 4)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (rand-vu-sphere-point-uniform! s2-0 (* 40960.0 (rand-vu))) + (vector+! gp-0 gp-0 s2-0) + ) + (vector-! (-> s4-0 vel) gp-0 s5-0) + ) + (vector-normalize! (-> s4-0 vel) 512000.0) + (the-as (pointer ftank-shot) (spawn-projectile ftank-shot s4-0 this *default-dead-pool*)) + ) + ) + +;; WARN: Return type mismatch (pointer ftank-shot) vs none. +(defmethod fac-robotank-turret-method-33 ((this fac-robotank-turret)) + (local-vars (sv-144 vector) (sv-160 vector)) + (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) + (s5-0 (new 'stack-no-clear 'inline-array 'vector 2)) + ) + (-> this node-list data 11) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (-> this sight-pos)) + (s2-0 (-> this gun-index)) + ) + 0.0 + 0.0 + (vector<-cspace! (-> s3-0 0) (-> this node-list data (-> this gun-joint-l s2-0))) + (vector<-cspace! (-> s3-0 1) (-> this node-list data (-> this gun-joint-r s2-0))) + (let ((f30-0 (* 0.5 (vector-length (vector-! (new 'stack-no-clear 'vector) (-> s3-0 1) (-> s3-0 0)))))) + (let ((f28-0 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 0))))))) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-l s2-0) bone transform fvec) 1.0) + (let ((s0-0 vector-rotate-y!)) + (set! sv-144 s4-0) + (set! sv-160 s4-0) + (let ((a2-1 (- 16384.0 (acos (/ f30-0 f28-0))))) + (s0-0 sv-144 sv-160 a2-1) + ) + ) + (set! (-> s5-0 0 quad) (-> s3-0 0 quad)) + (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) + (set! (-> this shot-range) (fmin 204800.0 f28-0)) + ) + (fac-robotank-turret-method-32 this s5-0) + (let ((f28-1 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 1))))))) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-r s2-0) bone transform fvec) 1.0) + (vector-rotate-y! s4-0 s4-0 (- (- 16384.0 (acos (/ f30-0 f28-1))))) + (set! (-> s5-0 0 quad) (-> s3-0 1 quad)) + (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) + (set! (-> this shot-range) (fmin 204800.0 f28-1)) + ) + ) + ) + (fac-robotank-turret-method-32 this s5-0) + ) + (none) + ) + +(defmethod fac-robotank-turret-method-31 ((this fac-robotank-turret) (arg0 vector) (arg1 vector)) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (f30-0 307200.0) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-float*! (-> s5-0 move-dist) arg1 f30-0) + (let ((v1-4 s5-0)) + (set! (-> v1-4 radius) 4096.0) + (set! (-> v1-4 collide-with) (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list)) + (set! (-> v1-4 ignore-process0) (ppointer->process (-> this parent))) + (set! (-> v1-4 ignore-process1) this) + (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 semi-solid)) + ) + (let ((f28-0 (fill-and-probe-using-line-sphere *collide-cache* s5-0)) + (s4-1 (-> this sight-pos)) + ) + (cond + ((>= f28-0 0.0) + (let ((f0-3 (vector-length (-> s5-0 move-dist)))) + (if (>= 20480.0 (* f0-3 f28-0)) + (set! f28-0 (/ 20480.0 f0-3)) + ) + ) + (vector+float*! s4-1 (-> s5-0 start-pos) (-> s5-0 move-dist) f28-0) + (let* ((s5-1 (-> s5-0 best-other-tri collide-ptr)) + (s3-0 (if (type? s5-1 collide-shape-prim) + s5-1 + ) + ) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-2 quad) (-> s4-1 quad)) + (vector+float*! s5-2 s5-2 (-> (math-camera-matrix) fvec) -2048.0) + (if (and s3-0 + (logtest? (process-mask target enemy) (-> (the-as collide-shape-prim s3-0) cshape process mask)) + (>= 307200.0 (vector-vector-distance s5-2 arg0)) + ) + #f + (+ 12288.0 (* f30-0 f28-0)) + ) + ) + ) + (else + (vector+! s4-1 (-> s5-0 start-pos) (-> s5-0 move-dist)) + ) + ) + ) + ) + ) + +;; WARN: Return type mismatch collide-prim-core vs vector. +(defmethod get-trans ((this fac-robotank-turret) (arg0 int)) + "Get the `trans` for this process." + (the-as vector (-> this root root-prim prim-core)) + ) + +(defbehavior turret-post fac-robotank-turret () + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and (logtest? (-> self flags) (fac-robotank-turret-flag frt0)) gp-0) + (if (logtest? (-> self flags) (fac-robotank-turret-flag frt9)) + (format 0 "Fix Los control update~%") + ) + (if *target* + (look-at! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) 'attacking self) + ) + (set! (-> self aim-pos 0 quad) (-> self aim-pos 1 quad)) + (set! (-> self aim-pos 1 quad) (-> (get-trans gp-0 0) quad)) + (let ((s5-2 (-> self aim-pos 2)) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-joint-l 0)))) + ) + (let ((v1-24 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-joint-r 0))))) + (vector-! s5-2 (-> self aim-pos 1) (the-as vector (-> self aim-pos))) + (vector-float*! s5-2 s5-2 (* 0.8 (-> self clock frames-per-second))) + (set! (-> s5-2 y) 0.0) + (vector+! s5-2 (-> self aim-pos 1) s5-2) + (+! (-> s5-2 y) 8192.0) + (vector+! s4-0 s4-0 v1-24) + ) + (vector-float*! s4-0 s4-0 0.5) + (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) s5-2 s4-0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> self firing-sight-pos) s4-0)) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (vector-length gp-2))) + (vector-normalize! gp-2 1.0) + (vector-normalize! s3-1 1.0) + (if (logtest? (-> self flags) (fac-robotank-turret-flag frt3)) + (set! (-> s5-3 quad) (-> s3-1 quad)) + (set! (-> s5-3 quad) (-> gp-2 quad)) + ) + (when (logtest? (-> self flags) (fac-robotank-turret-flag frt7)) + (let ((f0-6 (lerp-scale 1.0 0.2 f30-0 8192.0 327680.0))) + (seek! (-> self fov-mult) f0-6 (* 2.0 (seconds-per-frame))) + ) + (set-setting! 'fov 'rel (-> self fov-mult) 0) + ) + ) + (let* ((f30-1 (vector-y-angle s5-3)) + (f0-11 (quaternion-y-angle (-> self rotate-quat))) + (f0-12 (deg-diff f0-11 f30-1)) + ) + (* (-> self rotate-mult) f0-12) + (let ((f1-6 25486.223)) + (set! (-> self rotate-rate) (fmax (fmin (* 4.0 f0-12) f1-6) (- f1-6))) + ) + ) + (let ((f30-3 (fmax -16384.0 (fmin 16384.0 (- 16384.0 (acos (- (vector-dot s5-3 *y-vector*)))))))) + (let* ((f0-28 (fmax -16384.0 (fmin 16384.0 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) + (f2-1 (- (-> self gun-elev-cam) f0-28)) + (f1-12 (if (< f2-1 0.0) + (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + 910.2222 + ) + ) + ) + (seek! (-> self gun-elev-cam) f0-28 (* f1-12 (seconds-per-frame))) + ) + (let* ((f28-2 (quaternion-y-angle (-> self rotate-quat))) + (f0-32 (quaternion-y-angle (-> self tank-quat))) + (f0-34 (* 2.0 (deg-diff f0-32 f28-2))) + (f0-35 (cos f0-34)) + ) + 0.0 + (if (< 0.0 f0-35) + (* 182.04445 (lerp 4.0 90.0 f0-35)) + (* 182.04445 (lerp 4.0 18.0 (- f0-35))) + ) + ) + (seek! (-> self gun-elev) f30-3 (* 16384.0 (seconds-per-frame))) + ) + ) + ) + (quaternion-axis-angle! (-> self gun-elev-jmod quat) 1.0 0.0 0.0 (-> self gun-elev)) + ) + (else + ) + ) + ) + (when (and (logtest? (-> self flags) (fac-robotank-turret-flag frt0)) + (not (logtest? (-> self flags) (fac-robotank-turret-flag frt3))) + ) + (let* ((a1-26 (-> self node-list data (-> self gun-joint-l 0))) + (s4-1 (-> self node-list data (-> self gun-joint-r 0))) + (gp-4 + (vector+! + (new 'stack-no-clear 'vector) + (vector<-cspace! (new 'stack-no-clear 'vector) a1-26) + (vector<-cspace! (new 'stack-no-clear 'vector) s4-1) + ) + ) + (a2-16 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self node-list data 11 bone transform fvec) 1.0) + ) + ) + (vector-float*! gp-4 gp-4 0.5) + (fac-robotank-turret-method-31 self gp-4 a2-16) + ) + ) + (cond + ((logtest? (-> self flags) (fac-robotank-turret-flag frt6)) + (sound-play "robotank-turret" :id (-> self turn-sound-id) :position (-> self root trans)) + (when (< (fabs (-> self rotate-rate)) 728.1778) + (logclear! (-> self flags) (fac-robotank-turret-flag frt6)) + (sound-stop (-> self turn-sound-id)) + (sound-play "robo-turret-end") + ) + ) + (else + (if (< 2184.5334 (fabs (-> self rotate-rate))) + (logior! (-> self flags) (fac-robotank-turret-flag frt6)) + ) + ) + ) + (quaternion-rotate-y! + (-> self rotate-quat) + (-> self rotate-quat) + (* (-> self rotate-rate) (seconds-per-frame)) + ) + (quaternion*! (-> self root quat) (-> self rotate-quat) (-> self tank-quat-vibe-only)) + (quaternion-normalize! (-> self root quat)) + (transform-post) + (none) + ) + +(defbehavior robotank-turret-handler fac-robotank-turret ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('fire-suppress) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt4))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (fac-robotank-turret-flag frt4))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('set-spread) + (set! (-> self gun-spread) (the-as float (-> arg3 param 0))) + ) + (('use-los) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt9))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (fac-robotank-turret-flag frt9))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('limit-reticle-elev) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt10))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (fac-robotank-turret-flag frt10))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('pov-cam-on) + (let ((v1-14 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + ) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt7))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + v0-0 + ) + (('pov-cam-off) + (let ((v1-19 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self flags) (fac-robotank-turret-flag frt7)) + (remove-setting! 'fov) + ) + (('get-rotate-quat) + (-> self rotate-quat) + ) + (('get-gun-elevation-cam) + (-> self gun-elev-cam) + ) + (('update) + (-> arg3 param 1) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((s4-0 (the-as cspace (-> arg3 param 2)))) + (vector<-cspace+vector! (-> self root trans) s4-0 (-> self offset)) + (matrix->quaternion s5-0 (-> s4-0 bone transform)) + ) + (quaternion-copy! (-> self tank-quat) s5-0) + ) + (quaternion-copy! (-> self tank-quat-vibe-only) (the-as quaternion (-> arg3 param 3))) + ) + (('die) + (go-virtual die) + ) + ) + ) + +(defmethod fac-robotank-turret-method-34 ((this fac-robotank-turret) (arg0 vector) (arg1 float)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> s4-1 quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s3-0 s5-0) (cos arg1)) + ) + ) + +(defstate ready (fac-robotank-turret) + :virtual #t + :event robotank-turret-handler + :enter (behavior () + (logior! (-> self flags) (fac-robotank-turret-flag frt0)) + (set-time! (-> self gun-timer)) + ) + :trans (behavior () + (if (logtest? (-> self flags) (fac-robotank-turret-flag frt4)) + (set-time! (-> self gun-timer)) + ) + (let ((gp-0 *target*)) + (if (and (if (type? gp-0 process-focusable) + gp-0 + ) + (or (not (logtest? (-> self flags) (fac-robotank-turret-flag frt9))) (should-check-los? (-> self los) 0)) + (time-elapsed? (-> self gun-timer) (seconds 1)) + ) + (go-virtual fire) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! fac-robotank-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post turret-post + ) + +(defstate fire (fac-robotank-turret) + :virtual #t + :event robotank-turret-handler + :enter (behavior () + (logior! (-> self flags) (fac-robotank-turret-flag frt8)) + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-1 + (set! (-> self aim-pos 0 quad) (-> (get-trans a0-1 0) quad)) + (set! (-> self aim-pos 1 quad) (-> self aim-pos 0 quad)) + (set! (-> self aim-pos 2 quad) (-> self aim-pos 0 quad)) + ) + ) + ) + :trans (behavior () + (let ((gp-0 *target*)) + (when (or (not (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (and (logtest? (-> self flags) (fac-robotank-turret-flag frt9)) + (not (logtest? (-> self flags) (fac-robotank-turret-flag frt3))) + (los-control-method-11 (-> self los) 0) + ) + (logtest? (-> self flags) (fac-robotank-turret-flag frt4)) + ) + (logclear! (-> self flags) (fac-robotank-turret-flag frt8)) + (go-virtual ready) + ) + ) + ) + :code (behavior () + (local-vars (v1-2 symbol)) + (until #f + (until v1-2 + (suspend) + (set! v1-2 (and (fac-robotank-turret-method-34 self (-> self aim-pos 2) 2730.6667) + (logtest? (-> self draw status) (draw-control-status on-screen)) + ) + ) + ) + (logior! (-> self flags) (fac-robotank-turret-flag frt3)) + (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) + 0 + (dotimes (s5-2 gp-2) + (let ((s4-1 (max 2 (min 4 (rand-vu-int-range 1 8))))) + (dotimes (s3-2 s4-1) + (ja-no-eval :group! fac-robotank-fire-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (fac-robotank-turret-method-33 self) + (ja-no-eval :group! fac-robotank-fire-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self gun-index) (- 1 (-> self gun-index))) + (suspend) + (if (< (vector-length (vector-! (new 'stack-no-clear 'vector) (-> self firing-sight-pos) (-> self root trans))) + 73728.0 + ) + (goto cfg-22) + ) + ) + ) + (let ((f30-0 (rand-vu-float-range 0.05 0.43)) + (s4-2 (current-time)) + ) + (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) + (suspend) + ) + ) + ) + ) + (label cfg-22) + (logclear! (-> self flags) (fac-robotank-turret-flag frt3)) + (until (fac-robotank-turret-method-34 self (-> self aim-pos 2) 2730.6667) + (suspend) + ) + (let ((f30-1 (rand-vu-float-range + (if (< 2730.6667 (-> self rotate-rate)) + 1.2 + 0.32 + ) + 2.11 + ) + ) + (gp-3 (current-time)) + ) + (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) + (suspend) + ) + ) + ) + #f + ) + :post turret-post + ) + +(defstate die (fac-robotank-turret) + :virtual #t + :code (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (while (-> self child) + (suspend) + ) + ) + ) + +(defmethod deactivate ((this fac-robotank-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (logclear! (-> this flags) (fac-robotank-turret-flag frt6)) + (sound-stop (-> this turn-sound-id)) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-focusable vs fac-robotank-turret. +(defmethod relocate ((this fac-robotank-turret) (offset int)) + (if (nonzero? (-> this gun-elev-jmod)) + (&+! (-> this gun-elev-jmod) offset) + ) + (the-as fac-robotank-turret ((method-of-type process-focusable relocate) this offset)) + ) + +(defbehavior fac-robotank-turret-init-by-other fac-robotank-turret ((arg0 vector) (arg1 quaternion) (arg2 vector) (arg3 float)) + (let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s2-0 reaction) cshape-reaction-default) + (set! (-> s2-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s1-0 (new 'process 'collide-shape-prim-group s2-0 (the-as uint 4) 0))) + (set! (-> s2-0 total-prims) (the-as uint 5)) + (set! (-> s1-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s1-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s1-0 prim-core action) (collide-action solid)) + (set-vector! (-> s1-0 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s2-0 root-prim) s1-0) + ) + (pusher-init s2-0) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 8) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 4096.0 6553.6) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 5) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 4096.0 6553.6) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 20480.0 4096.0 31129.6) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-23 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> self root) s2-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (set! (-> self offset quad) (-> arg2 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robotank-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self draw light-index) (the-as uint 10)) + (init-los! (-> self los) self (seconds 0.1) 327680.0 (collide-spec backgnd)) + (set! (-> self gun-elev-jmod) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 4)) + (set! (-> self gun-elev) 0.0) + (set! (-> self gun-elev-cam) 0.0) + (set! (-> self gun-spread) 728.1778) + (quaternion-axis-angle! (-> self gun-elev-jmod quat) 1.0 0.0 0.0 (-> self gun-elev)) + (quaternion-zero! (-> self tank-quat)) + (quaternion-copy! (-> self rotate-quat) arg1) + (set! (-> self rotate-rate) 0.0) + (set! (-> self rotate-mult) arg3) + (set! (-> self aim-pos 0 quad) (-> self root trans quad)) + (set! (-> self aim-pos 1 quad) (-> self root trans quad)) + (set! (-> self aim-pos 2 quad) (-> self root trans quad)) + (set-time! (-> self gun-timer)) + (set! (-> self flags) (fac-robotank-turret-flag)) + (set! (-> self fov-mult) 1.0) + (set! (-> self shot-range) 204800.0) + (set! (-> self gun-joint-l 0) 10) + (set! (-> self gun-joint-r 0) 7) + (set! (-> self gun-joint-l 1) 9) + (set! (-> self gun-joint-r 1) 6) + (set! (-> self gun-index) 0) + (let ((v1-51 (new 'stack-no-clear 'vector))) + (set! (-> v1-51 quad) (-> self root trans quad)) + (+! (-> v1-51 z) 40960.0) + (+! (-> v1-51 y) 32768.0) + ) + (ja-no-eval :group! fac-robotank-idle-ja :num! zero) + (transform-post) + (set! (-> self turn-sound-id) (new-sound-id)) + (go-virtual ready) + ) diff --git a/goal_src/jak3/levels/factory/fac-robotank.gc b/goal_src/jak3/levels/factory/fac-robotank.gc index 4f6060b409..47f7acc43d 100644 --- a/goal_src/jak3/levels/factory/fac-robotank.gc +++ b/goal_src/jak3/levels/factory/fac-robotank.gc @@ -5,5 +5,894 @@ ;; name in dgo: fac-robotank ;; dgos: LFACTORY +;; +++robotank-segment-flag +(defenum robotank-segment-flag + :type uint16 + :bitfield #t + ) +;; ---robotank-segment-flag + + +;; +++robotank-flag +(defenum robotank-flag + :type uint16 + :bitfield #t + (r0 0) + (r1 1) + (r2 2) + (r3 3) + (r4 4) + (r5 5) + (r6 6) + (r7 7) + ) +;; ---robotank-flag + + +(declare-type fort-robotank process-drawable) + ;; DECOMP BEGINS +(defpartgroup group-robotank-barrel-sparks + :id 783 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2927 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7))) + ) + +(defpart 2927 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0 6.0) + (:x (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-x 4) + (:scale-y (meters 0.05) (meters 0.05)) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375)) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters -0.0026666666) (meters -0.001)) + (:friction 0.875) + (:timer (seconds 0.085) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017) (seconds 0.98)) + (:next-launcher 2928) + (:conerot-x (degrees -45) (degrees 90)) + (:conerot-y (degrees -45) (degrees 90)) + (:conerot-z (degrees -45) (degrees 90)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +(defpart 2928 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.85333335 -1.7066667)) + ) + +(deftype fac-robotank-segment-event (structure) + ((source uint64) + (event-type symbol) + (actor string) + (pos-norm float) + (param basic) + (param-obj object :overlay-at param) + (param-func (function fort-robotank none) :overlay-at param) + (param-sym symbol :overlay-at param) + ) + ) + + +(deftype fac-robotank-segment (structure) + ((flags robotank-segment-flag) + (max-speed float) + (next-segment int32) + (next-segment-start float) + (event-count int32) + (event-tbl (inline-array fac-robotank-segment-event)) + ) + ) + + +(deftype fac-robotank-path-info (structure) + ((dir vector :inline) + (u float) + (du float) + (du-final float) + (prev-u float) + (max-speed float) + (dist float) + (dir-y-angle float) + (start-y-angle float) + ) + ) + + +(deftype fac-robotank-path-info-array (inline-array-class) + ((data fac-robotank-path-info :inline :dynamic) + ) + ) + + +(set! (-> fac-robotank-path-info-array heap-base) (the-as uint 48)) + +(deftype fac-robotank-wheel-info (structure) + ((jmod joint-mod-spinner) + (radius float) + ) + ) + + +(deftype fac-robotank-tread-info (structure) + ((wheel fac-robotank-wheel-info 7 :inline) + (texture texture-anim) + (locator-joint int32) + (pos vector :inline) + ) + ) + + +(deftype fac-robotank (process-focusable) + ((parent (pointer factory-manager) :override) + (self fac-robotank :override) + (ppointer (pointer fac-robotank) :override) + (barrel-part sparticle-launch-control) + (vibe-jmod joint-mod-blend-local :inline) + (tread fac-robotank-tread-info 2 :inline) + (path-info fac-robotank-path-info-array) + (flags robotank-flag) + (mgr handle) + (pov-cam-offset vector 2 :inline) + (explode-sg skeleton-group) + (turret handle) + (no-collision-timer time-frame) + (buzz-timer time-frame) + (engine-vibe-rate float) + (engine-vibe-amp float) + (attack-id uint32) + (path-index int32) + (path-count int32) + (continue-index int32) + (hit-points float) + (engine-sound sound-id) + (engine-sound-playing symbol) + (snd-cmd-time time-frame) + ) + (:state-methods + turning + moving + pause + die + ) + (:methods + (fac-robotank-method-32 (_type_) none) + (fac-robotank-method-33 (_type_) none) + (go-explode (_type_) (pointer joint-exploder)) + ) + ) + + +(defskelgroup skel-fac-robotank fac-robotank fac-robotank-lod0-jg fac-robotank-idle-ja + ((fac-robotank-lod0-mg (meters 20)) (fac-robotank-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + :origin-joint-index 3 + ) + +(defskelgroup skel-fac-robotank-explode fac-robotank fac-robotank-explode-lod0-jg fac-robotank-explode-idle-ja + ((fac-robotank-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(define *fac-robotank-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; WARN: Return type mismatch event-message-block vs none. +(defmethod fac-robotank-method-32 ((this fac-robotank)) + (with-pp + (let ((v1-0 (-> this root))) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v0-1 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v0-1 from-handle) (process->handle pp)) + (set! (-> v0-1 to-handle) (process->handle (handle->process (-> this turret)))) + (set! (-> v0-1 num-params) 4) + (set! (-> v0-1 message) 'update) + (set! (-> v0-1 param 0) (the-as uint (-> v1-0 trans))) + (set! (-> v0-1 param 1) (the-as uint (-> v1-0 quat))) + (set! (-> v0-1 param 2) (the-as uint (-> this node-list data 3))) + (set! (-> v0-1 param 3) (the-as uint (-> this vibe-jmod transform quat))) + ) + ) + ) + (none) + ) + ) + +(defbehavior fac-robotank-post fac-robotank () + (when (and (nonzero? (-> self no-collision-timer)) + (time-elapsed? (-> self no-collision-timer) (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-7 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set! (-> self no-collision-timer) 0) + 0 + ) + (fac-robotank-method-32 self) + (dotimes (gp-0 2) + (let* ((s5-0 (-> self tread gp-0)) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s5-0 locator-joint)))) + ) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> s5-0 pos)))) + (let ((s2-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (if (= gp-0 1) + (vector-float*! s2-0 s2-0 -1.0) + ) + (let ((s1-0 (get-field-spec-by-id (-> *part-id-table* 2924) (sp-field-id spt-num))) + (f30-0 (vector-length s3-1)) + (f28-0 (* 12288.0 (seconds-per-frame))) + ) + (set! (-> s1-0 initial-valuef) (lerp-scale 0.0 0.5 f30-0 0.0 f28-0)) + (set! (-> s1-0 random-rangef) (lerp-scale 0.0 1.0 f30-0 0.0 f28-0)) + ) + (let ((a1-8 (forward-up-nopitch->inv-matrix (new 'stack-no-clear 'matrix) s2-0 *up-vector*))) + (set! (-> a1-8 trans quad) (-> s4-0 quad)) + (+! (-> a1-8 trans y) -2498.56) + (spawn-from-mat (-> self part) a1-8) + ) + ) + (vector-inv-orient-by-quat! s3-1 s3-1 (-> self root quat)) + (let ((f30-1 (fabs (-> s3-1 z)))) + (dotimes (s3-2 7) + (let ((s2-1 (-> s5-0 wheel s3-2))) + (set! (-> s2-1 jmod spin-rate) (* (atan f30-1 (-> s2-1 radius)) (-> self clock frames-per-second))) + ) + ) + ) + ) + (set! (-> s5-0 pos quad) (-> s4-0 quad)) + ) + ) + (let ((v1-48 (-> self path-info data (-> self path-index)))) + (cond + ((and (logtest? (-> self flags) (robotank-flag r2)) (!= (-> v1-48 u) (-> v1-48 prev-u))) + (seek! (-> self engine-vibe-rate) 3.0 (seconds-per-frame)) + (seek! (-> self engine-vibe-amp) 1.0 (seconds-per-frame)) + ) + (else + (seek! (-> self engine-vibe-rate) 1.0 (seconds-per-frame)) + (seek! (-> self engine-vibe-amp) 0.4 (seconds-per-frame)) + ) + ) + ) + (let* ((f0-23 30.0) + (f1-4 65536.0) + (f2-1 (the float (current-time))) + (f0-24 (/ (* f1-4 (- f2-1 (* (the float (the int (/ f2-1 f0-23))) f0-23))) f0-23)) + (f30-2 (sin f0-24)) + (f28-1 (* 300.0 (/ 1.0 (-> self engine-vibe-rate)))) + (f0-27 (the float (current-time))) + (f26-0 (/ (- f0-27 (* (the float (the int (/ f0-27 f28-1))) f28-1)) f28-1)) + (f30-3 (* f30-2 (sin (* 65536.0 f26-0)))) + ) + (let* ((f0-32 (sin 7281.778)) + (f1-13 (- 1.0 f0-32)) + ) + 0.0 + (when (and (or (< f0-32 f26-0) (< f26-0 f1-13)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f28-1)))) + (let* ((gp-1 *target*) + (a0-37 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (if a0-37 + (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (get-trans a0-37 0)) 81920.0 327680.0) + ) + ) + (set-time! (-> self buzz-timer)) + ) + ) + (quaternion-axis-angle! + (-> self vibe-jmod transform quat) + 0.0 + 0.0 + 1.0 + (* 182.04445 (* (-> self engine-vibe-amp) f30-3)) + ) + ) + (when (logtest? (-> self flags) (robotank-flag r7)) + (let ((gp-3 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self root quat))) + (a1-21 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-21 from) (process->ppointer self)) + (set! (-> a1-21 num-params) 0) + (set! (-> a1-21 message) 'get-rotate-quat) + (let ((s5-2 (send-event-function (handle->process (-> self turret)) a1-21)) + (s4-2 (new 'stack-no-clear 'quaternion)) + (s2-3 (-> (the-as fac-robotank-turret (handle->process (-> self turret))) root trans)) + (s1-1 (-> self root trans)) + (s3-4 (new 'stack-no-clear 'vector)) + ) + (let ((a1-23 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-23 from) (process->ppointer self)) + (set! (-> a1-23 num-params) 0) + (set! (-> a1-23 message) 'get-gun-elevation-cam) + (let ((f30-4 (the-as float (send-event-function (handle->process (-> self turret)) a1-23)))) + (vector-! s3-4 s2-3 s1-1) + (vector-orient-by-quat! s3-4 s3-4 gp-3) + (quaternion*! s4-2 (the-as quaternion s5-2) gp-3) + (quaternion-normalize! s4-2) + (quaternion-rotate-local-x! s4-2 s4-2 f30-4) + ) + ) + (vector-orient-by-quat! (the-as vector (-> self pov-cam-offset)) (-> self pov-cam-offset 1) s4-2) + (vector+! (the-as vector (-> self pov-cam-offset)) (the-as vector (-> self pov-cam-offset)) s3-4) + ) + ) + ) + (pusher-post) + (none) + ) + +(defbehavior fac-robotank-handler fac-robotank ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (when (and *target* (< (-> self continue-index) (the-as int (-> arg3 param 0)))) + (if (< (-> self continue-index) 0) + (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv107" -99.0 0) + ) + (logior! (-> self flags) (robotank-flag r5)) + (let ((v0-0 (the-as object (-> arg3 param 0)))) + (set! (-> self continue-index) (the-as int v0-0)) + v0-0 + ) + ) + ) + (('trans) + (-> self root trans) + ) + (('die) + (go-virtual die) + ) + (('fire-suppress-on) + (send-event (handle->process (-> self turret)) 'fire-suppress #t) + ) + (('fire-suppress-off) + (send-event (handle->process (-> self turret)) 'fire-suppress #f) + ) + (('attack) + (let ((v1-26 (the-as attack-info (-> arg3 param 1)))) + 0.0 + (let ((f1-0 (if (logtest? (attack-mask damage) (-> v1-26 mask)) + (-> v1-26 damage) + 0.0 + ) + ) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f1-0))) + ) + ) + (when (>= 0.0 (-> self hit-points)) + (go-explode self) + (go-virtual die) + ) + ) + (('stop-music) + (remove-setting! 'music) + (remove-setting! 'music-volume) + (remove-setting! 'sound-mode) + ) + ) + ) + +(defstate turning (fac-robotank) + :virtual #t + :event fac-robotank-handler + :enter (behavior () + (set! (-> self path-info data (-> self path-index) start-y-angle) (quaternion-y-angle (-> self root quat))) + ) + :trans (behavior () + (let* ((gp-0 (-> self path-info data (-> self path-index))) + (s5-0 (-> self root)) + (f30-0 (quaternion-y-angle (-> s5-0 quat))) + (f28-0 (fabs (deg-diff f30-0 (-> gp-0 start-y-angle)))) + (f30-1 (fabs (deg-diff f30-0 (vector-y-angle (-> gp-0 dir))))) + ) + (let* ((f0-3 (fmin f28-0 f30-1)) + (f0-6 (fmax 728.1778 (fmin 10012.444 (* 4.0 f0-3)))) + ) + (seek-toward-heading-vec! s5-0 (-> gp-0 dir) f0-6 (seconds 0.02)) + ) + (if (< f30-1 36.40889) + (go-virtual pause) + ) + ) + ) + :code sleep-code + :post (behavior () + (fac-robotank-post) + ) + ) + +(defmethod get-trans ((this fac-robotank) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +(defstate moving (fac-robotank) + :virtual #t + :event fac-robotank-handler + :enter (behavior () + (let ((v1-3 (-> self path-info data (-> self path-index)))) + (set! (-> v1-3 u) 0.0) + (set! (-> v1-3 prev-u) -1.0) + (set! (-> v1-3 du) 0.0) + (set! (-> v1-3 du-final) 0.01) + ) + (sound-play "tank-engine" :id (-> self engine-sound) :position (-> self root trans)) + (set! (-> self engine-sound-playing) #t) + (set-time! (-> self snd-cmd-time)) + ) + :exit (behavior () + (logclear! (-> self flags) (robotank-flag r2)) + ) + :trans (behavior () + (if (not *target*) + (go-virtual die) + ) + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-1 + (if (< (-> (get-trans a0-1 0) y) (+ -18432.0 (-> self root trans y))) + (go-virtual die) + ) + ) + ) + (let ((v1-14 (-> self path-index))) + (when (= (-> self path-info data v1-14 u) 1.0) + ) + ) + ) + :code (behavior () + (logclear! (-> self flags) (robotank-flag r2)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) + (suspend) + ) + ) + (logior! (-> self flags) (robotank-flag r2)) + (sleep-code) + ) + :post (behavior () + (when (logtest? (-> self flags) (robotank-flag r2)) + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (cond + (a0-1 + (get-trans a0-1 0) + ) + (else + ) + ) + ) + (let ((gp-1 (-> self path-info data (-> self path-index)))) + (let* ((s5-0 (the-as factory-manager (handle->process (-> self mgr)))) + (s2-0 (-> s5-0 tpath path (-> self path-index))) + (s1-0 (new 'stack-no-clear 'vector)) + (f28-0 (-> gp-1 u)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (-> self root)) + (f30-0 (seconds-per-frame)) + ) + (get-point-at-percent-along-path! s2-0 (-> s4-0 trans) f28-0 'interp) + (+! (-> s4-0 trans y) 1024.0) + (displacement-between-points-at-percent-normalized! s2-0 s3-0 f28-0) + (path-control-method-15 s2-0 s1-0 f28-0 (-> gp-1 du-final)) + (seek-toward-heading-vec! s4-0 s3-0 16384.0 (seconds 0.02)) + (set! (-> gp-1 prev-u) (-> gp-1 u)) + (set! (-> gp-1 u) + (path-control-method-26 (-> s5-0 tpath path (-> self path-index)) (-> gp-1 u) (* 40960.0 f30-0)) + ) + ) + (if (>= (-> gp-1 u) 1.0) + (go-virtual die) + ) + ) + 0 + ) + (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.5)) + (sound-play "tank-engine" :id (-> self engine-sound) :vol 80 :position (-> self root trans)) + (set! (-> self engine-sound-playing) #t) + (set-time! (-> self snd-cmd-time)) + ) + (fac-robotank-post) + ) + ) + +(defstate pause (fac-robotank) + :virtual #t + :event fac-robotank-handler + :enter (behavior () + '() + ) + :trans (behavior () + (when (logtest? (-> self flags) (robotank-flag r5)) + (logclear! (-> self flags) (robotank-flag r5)) + (go-virtual moving) + ) + ) + :code sleep-code + :post fac-robotank-post + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer joint-exploder). +(defmethod go-explode ((this fac-robotank)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (sound-play "tank-explode") + (cond + ((logtest? (-> *part-group-id-table* 732 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 732)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 732)) + ) + ) + (let ((s5-3 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((v1-34 (new 'stack-no-clear 'vector))) + (let ((a0-17 (-> s5-3 fountain-rand-transv-lo))) + (let ((a1-9 (-> this root trans))) + (let ((a2-12 *up-vector*)) + (let ((a3-6 2048.0)) + (.mov vf7 a3-6) + ) + (.lvf vf5 (&-> a2-12 quad)) + ) + (.lvf vf4 (&-> a1-9 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-17 quad) vf6) + ) + (vector-float*! v1-34 *up-vector* 81920.0) + (let ((a2-14 (-> s5-3 fountain-rand-transv-lo))) + (let ((a0-20 v1-34)) + (let ((a1-11 *identity-vector*)) + (let ((a3-8 -40960.0)) + (.mov vf7 a3-8) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-20 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-14 quad) vf6) + ) + (let ((a1-12 (-> s5-3 fountain-rand-transv-hi))) + (let ((a0-21 *identity-vector*)) + (let ((a2-16 40960.0)) + (.mov vf7 a2-16) + ) + (.lvf vf5 (&-> a0-21 quad)) + ) + (.lvf vf4 (&-> v1-34 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-12 quad) vf6) + ) + ) + (set! (-> s5-3 gravity) -122880.0) + (set! (-> s5-3 rot-speed) 16.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-robotank-explode" (the-as (pointer level) #f)) + 9 + s5-3 + *fac-robotank-exploder-params* + :name "joint-exploder" + :to this + :unk 0 + ) + ) + ) + ) + +(defstate die (fac-robotank) + :virtual #t + :code (behavior () + (send-event (handle->process (-> self turret)) 'die) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (while (-> self child) + (suspend) + ) + (let ((v1-20 (handle->process (-> self mgr)))) + (+! (-> v1-20 stack 2) -1) + ) + ) + ) + +(defmethod deactivate ((this fac-robotank)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this engine-sound-playing) + (sound-stop (-> this engine-sound)) + ) + (if (nonzero? (-> this barrel-part)) + (kill-particles (-> this barrel-part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defmethod relocate ((this fac-robotank) (offset int)) + (if (nonzero? (-> this barrel-part)) + (&+! (-> this barrel-part) offset) + ) + (if (nonzero? (-> this path-info)) + (&+! (-> this path-info) offset) + ) + ;; og:preserve-this + (dotimes (v1-8 2) + (dotimes (a0-1 7) + (if (nonzero? (-> this tread v1-8 wheel a0-1 jmod)) + (&+! (-> this tread v1-8 wheel a0-1 jmod) offset) + ) + ) + ) + (call-parent-method this offset) + ) + +(defbehavior fac-robotank-birth-path fac-robotank ((arg0 factory-manager)) + (local-vars (v0-0 int)) + 0 + (until (not (logtest? (-> arg0 tpath inout v0-0 flags) (factory-inout-flag fi0 fi2))) + (set! v0-0 (rand-vu-int-range 0 (+ (-> arg0 tpath npath) -1))) + ) + v0-0 + ) + +(defbehavior fac-robotank-init-by-other fac-robotank () + (set! (-> self mgr) (ppointer->handle (-> self parent))) + (let ((gp-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> gp-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> gp-0 reaction) cshape-reaction-default) + (set! (-> gp-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s5-0 (new 'process 'collide-shape-prim-group gp-0 (the-as uint 1) 0))) + (set! (-> gp-0 total-prims) (the-as uint 2)) + (set! (-> s5-0 prim-core collide-as) (collide-spec enemy obstacle camera-blocker pusher)) + (set! (-> s5-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s5-0 prim-core action) (collide-action solid)) + (set-vector! (-> s5-0 local-sphere) 0.0 0.0 0.0 47104.0) + (set! (-> gp-0 root-prim) s5-0) + ) + (pusher-init gp-0) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-20 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> self root) gp-0) + ) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self level) (level-get *level* 'factoryb)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robotank" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self explode-sg) + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-robotank-explode" (the-as (pointer level) #f)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (set! (-> self draw light-index) (the-as uint 10)) + (set! (-> self fact) + (new 'process 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> self flags) (robotank-flag)) + (set! (-> self no-collision-timer) 0) + (set! (-> self engine-vibe-rate) 1.0) + (set! (-> self buzz-timer) 0) + (let* ((v1-37 *game-info*) + (a0-24 (+ (-> v1-37 attack-id) 1)) + ) + (set! (-> v1-37 attack-id) a0-24) + (set! (-> self attack-id) a0-24) + ) + (set! (-> self hit-points) 1.0) + (let ((gp-2 (handle->process (-> self mgr)))) + (set! (-> self path-count) (-> (the-as factory-manager gp-2) tpath npath)) + (set! (-> self path-info) (new 'process 'fac-robotank-path-info-array (-> self path-count))) + (set! (-> self path-index) (fac-robotank-birth-path (the-as factory-manager (handle->process (-> self mgr))))) + (set! (-> self continue-index) -1) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (get-point-at-percent-along-path! + (-> (the-as factory-manager gp-2) tpath path 0) + (-> self root trans) + 0.0 + 'interp + ) + (+! (-> self root trans y) 1024.0) + (displacement-between-points-at-percent-normalized! (-> (the-as factory-manager gp-2) tpath path 0) s5-2 0.0) + (set-heading-vec! (-> self root) s5-2) + ) + ) + (ja-no-eval :group! fac-robotank-idle-ja :num! zero) + (transform-post) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (set-vector! gp-3 0.0 12541.952 -6778.88 1.0) + (set! (-> self turret) (ppointer->handle (process-spawn + fac-robotank-turret + (-> self root trans) + (-> self root quat) + gp-3 + 32.0 + :name "fac-robotank-turret" + :to self + ) + ) + ) + ) + (init (-> self vibe-jmod) self (the-as uint 4) (joint-mod-base-flags attached)) + (set! (-> self vibe-jmod blend) 0.5) + (quaternion-axis-angle! (-> self vibe-jmod transform quat) 0.0 0.0 1.0 0.0) + (let ((gp-4 (-> self tread))) + (set! (-> gp-4 0 wheel 0 jmod) (new 'process 'joint-mod-spinner self 5 *x-vector* 0.0)) + (set! (-> gp-4 0 wheel 0 radius) 2048.0) + ) + (let ((gp-5 (the-as object (&-> self stack 240)))) + (set! (-> (the-as fac-robotank-tread-info gp-5) wheel 0 jmod) + (new 'process 'joint-mod-spinner self 6 *x-vector* 0.0) + ) + (set! (-> (the-as fac-robotank-tread-info gp-5) wheel 0 radius) 2048.0) + ) + (let ((gp-6 (the-as fac-robotank-tread-info (&-> self stack 256)))) + (set! (-> gp-6 wheel 0 jmod) (new 'process 'joint-mod-spinner self 7 *x-vector* 0.0)) + (set! (-> gp-6 wheel 0 radius) 2048.0) + ) + (let ((gp-7 (the-as fac-robotank-tread-info (&-> self stack 272)))) + (set! (-> gp-7 wheel 0 jmod) (new 'process 'joint-mod-spinner self 8 *x-vector* 0.0)) + (set! (-> gp-7 wheel 0 radius) 2048.0) + ) + (let ((gp-8 (the-as fac-robotank-tread-info (&-> self stack 288)))) + (set! (-> gp-8 wheel 0 jmod) (new 'process 'joint-mod-spinner self 9 *x-vector* 0.0)) + (set! (-> gp-8 wheel 0 radius) 2048.0) + ) + (let ((gp-9 (the-as fac-robotank-tread-info (&-> self stack 304)))) + (set! (-> gp-9 wheel 0 jmod) (new 'process 'joint-mod-spinner self 10 *x-vector* 0.0)) + (set! (-> gp-9 wheel 0 radius) 2048.0) + ) + (let ((gp-10 (the-as fac-robotank-tread-info (&-> self stack 320)))) + (set! (-> gp-10 wheel 0 jmod) (new 'process 'joint-mod-spinner self 11 *x-vector* 0.0)) + (set! (-> gp-10 wheel 0 radius) 2048.0) + ) + (let ((gp-11 (-> self tread 1))) + (set! (-> gp-11 wheel 0 jmod) (new 'process 'joint-mod-spinner self 12 *x-vector* 0.0)) + (set! (-> gp-11 wheel 0 radius) 2048.0) + ) + (let ((gp-12 (the-as fac-robotank-tread-info (&-> self stack 384)))) + (set! (-> gp-12 wheel 0 jmod) (new 'process 'joint-mod-spinner self 13 *x-vector* 0.0)) + (set! (-> gp-12 wheel 0 radius) 2048.0) + ) + (let ((gp-13 (the-as fac-robotank-tread-info (&-> self stack 400)))) + (set! (-> gp-13 wheel 0 jmod) (new 'process 'joint-mod-spinner self 14 *x-vector* 0.0)) + (set! (-> gp-13 wheel 0 radius) 2048.0) + ) + (let ((gp-14 (the-as fac-robotank-tread-info (&-> self stack 416)))) + (set! (-> gp-14 wheel 0 jmod) (new 'process 'joint-mod-spinner self 15 *x-vector* 0.0)) + (set! (-> gp-14 wheel 0 radius) 2048.0) + ) + (let ((gp-15 (the-as fac-robotank-tread-info (&-> self stack 432)))) + (set! (-> gp-15 wheel 0 jmod) (new 'process 'joint-mod-spinner self 16 *x-vector* 0.0)) + (set! (-> gp-15 wheel 0 radius) 2048.0) + ) + (let ((gp-16 (the-as fac-robotank-tread-info (&-> self stack 448)))) + (set! (-> gp-16 wheel 0 jmod) (new 'process 'joint-mod-spinner self 17 *x-vector* 0.0)) + (set! (-> gp-16 wheel 0 radius) 2048.0) + ) + (let ((gp-17 (the-as fac-robotank-tread-info (&-> self stack 464)))) + (set! (-> gp-17 wheel 0 jmod) (new 'process 'joint-mod-spinner self 18 *x-vector* 0.0)) + (set! (-> gp-17 wheel 0 radius) 2048.0) + ) + (let ((v1-105 8)) + (set! (-> self tread 0 locator-joint) v1-105) + (vector<-cspace! (-> self tread 0 pos) (-> self node-list data v1-105)) + ) + (let ((v1-109 15)) + (set! (-> self tread 1 locator-joint) v1-109) + (vector<-cspace! (-> self tread 1 pos) (-> self node-list data v1-109)) + ) + (set-vector! (-> self pov-cam-offset 0) 0.0 13516.8 -13516.8 1.0) + (set-vector! (-> self pov-cam-offset 1) 0.0 13516.8 -13516.8 1.0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 782) self)) + (set! (-> self barrel-part) (create-launch-control (-> *part-group-id-table* 783) self)) + (set! (-> self engine-sound) (new-sound-id)) + (set! (-> self engine-sound-playing) #f) + (set-time! (-> self snd-cmd-time)) + (go-virtual moving) + ) + +;; WARN: Return type mismatch process vs fac-robotank. +(defun fac-robotank-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn fac-robotank :name "fac-robotank" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as fac-robotank gp-0) + ) + ) diff --git a/goal_src/jak3/levels/factory/fac-tower.gc b/goal_src/jak3/levels/factory/fac-tower.gc index cea487e300..ef82ac1a65 100644 --- a/goal_src/jak3/levels/factory/fac-tower.gc +++ b/goal_src/jak3/levels/factory/fac-tower.gc @@ -7,3 +7,1018 @@ ;; DECOMP BEGINS +(define *fac-tower-impact-pos* (new 'static 'vector :w 1.0)) + +(defskelgroup skel-fac-gun-tower-base fac-gun-tower-base fac-gun-tower-base-lod0-jg fac-gun-tower-base-idle-ja + ((fac-gun-tower-base-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +(defskelgroup skel-fac-gun-tower-base-broken-north fac-gun-tower-base fac-gun-tower-base-broken-north-lod0-jg fac-gun-tower-base-broken-north-idle-ja + ((fac-gun-tower-base-broken-north-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +(defskelgroup skel-fac-gun-tower-base-broken-south fac-gun-tower-base fac-gun-tower-base-broken-south-lod0-jg fac-gun-tower-base-broken-south-idle-ja + ((fac-gun-tower-base-broken-south-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +(defskelgroup skel-fac-gun-tower-base-broken-east fac-gun-tower-base fac-gun-tower-base-broken-east-lod0-jg fac-gun-tower-base-broken-east-idle-ja + ((fac-gun-tower-base-broken-east-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +(defskelgroup skel-fac-gun-tower-base-broken-west fac-gun-tower-base fac-gun-tower-base-broken-west-lod0-jg fac-gun-tower-base-broken-west-idle-ja + ((fac-gun-tower-base-broken-west-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +(defskelgroup skel-fac-gun-tower fac-gun-tower fac-gun-tower-lod0-jg fac-gun-tower-idle-ja + ((fac-gun-tower-lod0-mg (meters 20)) (fac-gun-tower-lod1-mg (meters 999999))) + :bounds (static-spherem 0 25 0 75) + ) + +(defskelgroup skel-fac-gun-tower-break fac-gun-tower fac-gun-tower-break-lod0-jg fac-gun-tower-break-idle-ja + ((fac-gun-tower-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + ) + +(define *fac-gun-tower-break-anim-idx* 0) + +(defbehavior fac-gun-tower-base-broken-init-by-other fac-gun-tower-base-broken ((arg0 vector) (arg1 quaternion)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 409600.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 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak bot player-list)) + (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 409600.0) + ) + (let ((v1-10 (new + 'process + 'collide-shape-prim-mesh + s4-0 + (the-as uint (if (zero? *fac-gun-tower-break-anim-idx*) + 0 + 1 + ) + ) + (the-as uint 0) + ) + ) + ) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 409600.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> self root) s4-0) + ) + (set! (-> self level) (level-get *level* 'factoryb)) + (cond + ((zero? *fac-gun-tower-break-anim-idx*) + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-north" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-north" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + ((= *fac-gun-tower-break-anim-idx* 1) + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-south" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-south" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + ((= *fac-gun-tower-break-anim-idx* 2) + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-east" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-east" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + (else + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-west" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-west" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (vector-identity! (-> self root scale)) + (go-virtual idle) + ) + +(defstate idle (fac-gun-tower-base-broken) + :virtual #t + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post ja-post + ) + +(defbehavior fac-gun-tower-break-init-by-other fac-gun-tower-break ((arg0 int) (arg1 vector) (arg2 quaternion)) + (let ((s3-1 (max 0 (+ (* *fac-gun-tower-break-anim-idx* 2) -1)))) + (cond + ((or (= arg0 3) (= arg0 1) (= arg0 2)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-2 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-2 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-2 prim-core action) (collide-action solid)) + (set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 0.0) + (set! (-> s4-0 root-prim) s3-2) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 0.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-16 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> self root) s4-0) + ) + ) + (else + (let ((s4-1 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-1 penetrated-by) (penetrate)) + (let ((s2-0 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 2) 0))) + (set! (-> s4-1 total-prims) (the-as uint 3)) + (set! (-> s2-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s2-0 prim-core action) (collide-action solid)) + (set-vector! (-> s2-0 local-sphere) 0.0 0.0 0.0 409600.0) + (set! (-> s4-1 root-prim) s2-0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint s3-1) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 0) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 409600.0) + ) + (let ((v1-27 (new + 'process + 'collide-shape-prim-mesh + s4-1 + (the-as uint (if (zero? s3-1) + 0 + (+ s3-1 1) + ) + ) + (the-as uint 0) + ) + ) + ) + (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 0) + (set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 409600.0) + ) + (set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w))) + (let ((v1-30 (-> s4-1 root-prim))) + (set! (-> s4-1 backup-collide-as) (-> v1-30 prim-core collide-as)) + (set! (-> s4-1 backup-collide-with) (-> v1-30 prim-core collide-with)) + ) + (set! (-> self root) s4-1) + ) + ) + ) + ) + (set! (-> self level) (level-get *level* 'factoryb)) + (let ((s4-2 (art-group-get-by-name *level* "skel-fac-gun-tower-break" (the-as (pointer level) #f)))) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower-break" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-copy! (-> self root quat) arg2) + (vector-identity! (-> self root scale)) + (if s4-2 + (ja :group! (-> self draw art-group data 7) :num! min) + ) + ) + (go-virtual idle-stick) + ) + +(defstate idle (fac-gun-tower-break) + :virtual #t + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + :post ja-post + ) + +(defstate idle-stick (fac-gun-tower-break) + :virtual #t + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + ) + :post ja-post + ) + +(defun start-destroyed-fac-gun-tower-base ((arg0 vector) (arg1 quaternion) (arg2 process)) + (let ((s3-0 0)) + (if (< 819200.0 (-> arg0 x)) + (+! s3-0 1) + ) + (if (< 819200.0 (-> arg0 z)) + (+! s3-0 2) + ) + (format + #t + "destroyed xz pos ~M ~M - currently (task-node-close! (game-task-node factory-sky-battle-tower~d))~%" + (-> arg0 x) + (-> arg0 z) + (+ s3-0 1) + ) + (cond + ((zero? s3-0) + (task-node-close! (game-task-node factory-sky-battle-tower1) 'event) + ) + ((= s3-0 1) + (task-node-close! (game-task-node factory-sky-battle-tower2) 'event) + ) + ((= s3-0 2) + (task-node-close! (game-task-node factory-sky-battle-tower4) 'event) + ) + ((= s3-0 3) + (task-node-close! (game-task-node factory-sky-battle-tower3) 'event) + ) + ) + ) + (process-spawn fac-gun-tower-base-broken arg0 arg1 :name "fac-gun-tower-base-broken" :to arg2) + (let ((v0-8 (logand (+ *fac-gun-tower-break-anim-idx* 1) 3))) + (set! *fac-gun-tower-break-anim-idx* v0-8) + v0-8 + ) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer fac-gun-tower-break). +(defun start-destroyed-fac-gun-tower ((arg0 vector) (arg1 quaternion) (arg2 process)) + (process-spawn fac-gun-tower-break 3 arg0 arg1 :name "fac-gun-tower-break" :to arg2) + ) + +(deftype fac-gun-tower-base (process-focusable) + () + (:state-methods + idle + explode + ) + ) + + +(defmethod init-from-entity! ((this fac-gun-tower-base) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 102400.0 0.0 286720.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 163840.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 0) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 184320.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower-base" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw lod-set lod 0 dist) 14336000.0) + (set! (-> this draw lod-set lod 1 dist) 14336000.0) + (set! (-> this draw lod-set lod 2 dist) 14336000.0) + (logior! (-> this draw status) (draw-control-status no-draw)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (go (method-of-object this idle)) + ) + +(defstate explode (fac-gun-tower-base) + :virtual #t + :enter (behavior () + '() + ) + :code sleep-code + ) + +(defstate idle (fac-gun-tower-base) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (and (type? proc projectile) (not (type? proc warf-projectile))) + (let ((s4-0 (the-as projectile proc))) + (when (not (vector= *fac-tower-impact-pos* (-> s4-0 root trans))) + (set! (-> *fac-tower-impact-pos* quad) (-> s4-0 root trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (let ((s4-1 (the-as projectile (get-process *default-dead-pool* part-tracker-subsampler #x4000 0)))) + (when s4-1 + (let ((t9-4 (method-of-type part-tracker-subsampler activate))) + (t9-4 + (the-as part-tracker-subsampler s4-1) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-5 run-function-in-process) + (a0-13 s4-1) + (a1-6 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 776)) + (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-13 a1-6 *part-tracker-subsampler-params-default*) + ) + (-> s4-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ) + ) + (-> block param 1) + (when (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (and proc (= (-> proc type) fac-gun-tower)) + ) + (start-destroyed-fac-gun-tower-base (-> self root trans) (-> self root quat) (the-as process *entity-pool*)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-47 (-> self root root-prim))) + (set! (-> v1-47 prim-core collide-as) (collide-spec)) + (set! (-> v1-47 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v0-0 (logior (-> self draw status) (draw-control-status no-draw)))) + (set! (-> self draw status) v0-0) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! fac-gun-tower-base-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +(deftype gun-tower-base (fac-gun-tower-base) + () + ) + + +(defmethod init-from-entity! ((this fac-gun-tower) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (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 enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 102400.0 0.0 245760.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 10) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 12288.0 16384.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 245760.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 8) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw lod-set lod 0 dist) 14336000.0) + (set! (-> this draw lod-set lod 1 dist) 14336000.0) + (set! (-> this draw lod-set lod 2 dist) 14336000.0) + (set! (-> this yaw) 0.0) + (set! (-> this yawvel) 0.0) + (set! (-> this pitch) 16384.0) + (set! (-> this pitchvel) 0.0) + (set! (-> this dyaw) 0.0) + (set! (-> this dpitch) 0.0) + (set! (-> this invincable) #t) + (set! (-> this hit-points) 64.0) + (set-time! (-> this last-fire)) + (set! (-> this gun-idx) 0) + (let* ((v1-32 *game-info*) + (a0-29 (+ (-> v1-32 attack-id) 1)) + ) + (set! (-> v1-32 attack-id) a0-29) + (set! (-> this attack-id) (the-as int a0-29)) + ) + (set! (-> this gunrot) 8) + (set! (-> this muzzle) 9) + (set! (-> this blade-sound) (new-sound-id)) + (set! (-> this blade-sound-playing) #f) + (set! (-> this rotate-sound) (new-sound-id)) + (set! (-> this rotate-sound-playing) #f) + (set-time! (-> this snd-cmd-time)) + (set! (-> this gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this gunrot))) + (quaternion-identity! (-> this root quat)) + (go (method-of-object this idle)) + ) + +(defmethod deactivate ((this fac-gun-tower)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this rotate-sound-playing) + (sound-stop (-> this rotate-sound)) + ) + (if (-> this blade-sound-playing) + (sound-stop (-> this blade-sound)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +(defmethod relocate ((this fac-gun-tower) (offset int)) + (if (nonzero? (-> this gun-tilt-jm)) + (&+! (-> this gun-tilt-jm) offset) + ) + (call-parent-method this offset) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this fac-gun-tower)) + (let ((v0-0 0)) + (if (and (-> this next-state) (= (-> this next-state name) 'open)) + (set! v0-0 (logior v0-0 40)) + ) + (the-as search-info-flag v0-0) + ) + ) + +(defmethod get-trans ((this fac-gun-tower) (arg0 int)) + "Get the `trans` for this process." + (let ((v1-0 (-> this root))) + (cond + ((= arg0 3) + (let ((a2-1 (-> this node-list data 10 bone transform)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! gp-0 0.0 0.0 0.0 1.0) + (vector-matrix*! gp-0 gp-0 a2-1) + (set! (-> gp-0 w) 8192.0) + gp-0 + ) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + +(defmethod fire-shot ((this fac-gun-tower)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (let ((s2-0 (-> this node-list data 10 bone transform)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a2-0 (-> this node-list data (-> this gunrot) bone transform))) + (set-vector! s5-0 0.0 0.0 40960.0 1.0) + (vector-matrix*! s5-0 s5-0 a2-0) + ) + (set! (-> s3-0 quad) (-> s2-0 fvec quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! (the-as vector s3-0) 1.0) + (vector-rotate-around-axis! (the-as vector s3-0) s3-0 (-> this pitch) (-> s2-0 rvec)) + (let ((a0-11 s4-0)) + (let ((v1-11 s5-0)) + (let ((a1-5 409600.0)) + (.mov vf7 a1-5) + ) + (.lvf vf5 (&-> s3-0 quad)) + (.lvf vf4 (&-> v1-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-11 quad) vf6) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'vector)) + (a1-6 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-6 from) (process->ppointer pp)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'get-vehicle) + (let ((a0-14 (the-as vehicle (send-event-function *target* a1-6)))) + (when a0-14 + (vector-float*! s3-1 (-> a0-14 rbody lin-velocity) 0.0) + (vector+! s4-0 s4-0 s3-1) + ) + ) + ) + (spawn-fac-gun-tower-projectile this s5-0 s4-0 1638400.0) + ) + ) + ) + ) + ) + +(defmethod send-attack ((this fac-gun-tower) (arg0 process-focusable)) + (let* ((a0-2 (get-trans arg0 3)) + (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-2 (-> this root trans))) + ) + (if (< (vector-length v1-2) 409600.0) + (send-event + arg0 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint (-> this attack-id))) + (damage 128.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'explode) + (attacker-velocity v1-2) + (penetrate-using (penetrate explode enemy-yellow-shot)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defmethod fac-gun-tower-method-36 ((this fac-gun-tower)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (set! (-> s5-0 w) 409600.0) + (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) + (let* ((s2-0 (-> s4-0 s3-0)) + (v1-5 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when v1-5 + (let* ((s1-0 (-> v1-5 process)) + (s2-1 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-1 + (if (and (!= *target* s2-1) + (!= this s2-1) + (not (focus-test? (the-as process-focusable s2-1) disable dead inactive)) + (type? s2-1 fac-gun-tower-base) + ) + (send-attack this (the-as process-focusable s2-1)) + ) + ) + ) + ) + ) + ) + ) + (let* ((s3-1 *target*) + (s4-1 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) s5-0) (-> s5-0 w))) + (if (and (!= *target* s4-1) + (!= this s4-1) + (not (focus-test? s4-1 disable dead inactive)) + (type? s4-1 fac-gun-tower-base) + ) + (send-attack this s4-1) + ) + ) + ) + ) + 0 + (none) + ) + +(defbehavior fac-gun-tower-standard-event-handler fac-gun-tower ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((gp-0 (the-as object (-> arg3 param 1))) + (a2-1 (the-as object (-> arg3 param 0))) + ) + 0.0 + (let ((f30-0 (if (logtest? (attack-mask damage) (-> (the-as attack-info gp-0) mask)) + (-> (the-as attack-info gp-0) damage) + 0.0 + ) + ) + ) + (when (and (the-as touching-shapes-entry a2-1) (not (-> self invincable))) + (let ((a0-3 (-> (the-as touching-shapes-entry a2-1) head))) + (when a0-3 + (let ((a0-4 (get-touched-prim a0-3 (-> self root) (the-as touching-shapes-entry a2-1)))) + 0 + (when a0-4 + (case (-> a0-4 prim-id) + ((1) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f30-0))) + (set-time! (-> self last-hit-time)) + ) + ) + ) + ) + ) + ) + ) + (when (and (>= f30-0 128.0) (not (-> self invincable))) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (-> self node-list data 10 bone transform)) + ) + (set-vector! s5-0 0.0 0.0 -32768.0 1.0) + (vector-matrix*! s5-0 s5-0 s3-0) + (vector-! s4-0 (the-as vector (+ (the-as uint gp-0) 0)) s5-0) + (vector-normalize! s4-0 1.0) + (when (or (< 0.0 (vector-dot s4-0 (-> s3-0 fvec))) + (< (vector-vector-distance s5-0 (the-as vector (+ (the-as uint gp-0) 0))) 36864.0) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f30-0))) + (set-time! (-> self last-hit-time)) + ) + ) + ) + ) + ) + (when (>= 0.0 (-> self hit-points)) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (activate! *camera-smush-control* 3276.8 60 390 0.9 0.9 (-> self clock)) + (start-destroyed-fac-gun-tower (-> self root trans) (-> self root quat) (the-as process *entity-pool*)) + (cond + ((logtest? (-> *part-group-id-table* 731 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 731)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 731)) + ) + ) + (fac-gun-tower-method-36 self) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-78 (-> self root root-prim))) + (set! (-> v1-78 prim-core collide-as) (collide-spec)) + (set! (-> v1-78 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "tower-explode") + (cleanup-for-death self) + (go-virtual die-fast) + ) + ) + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defmethod fac-gun-tower-method-33 ((this fac-gun-tower)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (+! (-> this yaw) (* (-> this yawvel) (seconds-per-frame))) + (if (< 65536.0 (-> this yaw)) + (+! (-> this yaw) -65536.0) + ) + (matrix-rotate-y! s5-0 (-> this yaw)) + (matrix->quaternion (-> this root quat) s5-0) + ) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this pitch)) + (when (time-elapsed? (-> this snd-cmd-time) (seconds 0.2)) + (sound-play-by-name + (static-sound-name "gtower-openloop") + (-> this rotate-sound) + 1024 + (the int (* 1524.0 (+ 1.0 (* 0.00001 (-> this yawvel))))) + 0 + (sound-group) + (-> this root trans) + ) + (sound-play-by-name + (static-sound-name "gtower-blade") + (-> this blade-sound) + (the int (* 1024.0 (fmax 0.0 (fmin 0.5 (* 0.00001 (-> this yawvel)))))) + (the int (* 1524.0 (+ 1.3 (* 0.00001 (-> this yawvel))))) + 0 + (sound-group) + (-> this root trans) + ) + (set-time! (-> this snd-cmd-time)) + ) + (none) + ) + +(defun fac-deg-delta ((arg0 float) (arg1 float)) + (the float (sar (- (shl (the int arg0) 48) (shl (the int arg1) 48)) 48)) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defmethod fac-gun-tower-method-34 ((this fac-gun-tower)) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'matrix)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 quad) (-> (get-trans *target* 3) quad)) + (vector-! s4-0 s3-0 s2-0) + ) + (vector-negate! s4-0 s4-0) + (let ((f30-0 (vector-length s4-0))) + (let* ((f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-9 (fac-deg-delta f0-7 (-> this yaw))) + (f1-1 (- f0-9 (-> this dyaw))) + ) + (set! (-> this dyaw) f0-9) + (let ((f1-3 (+ (* 160.0 f1-1) (* 10.0 f0-9)))) + (+! (-> this yawvel) (* f1-3 (seconds-per-frame))) + ) + ) + (let* ((f0-19 (- (atan (-> s4-0 y) (sqrtf (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z))))))) + (f0-21 (fac-deg-delta f0-19 (-> this pitch))) + (f1-9 (- f0-21 (-> this dpitch))) + ) + (set! (-> this dpitch) f0-21) + (let ((f1-11 (+ (* 160.0 f1-9) (* 10.0 f0-21)))) + (+! (-> this pitchvel) (* f1-11 (seconds-per-frame))) + ) + ) + (matrix-rotate-y! s5-0 (-> this yaw)) + (matrix->quaternion (-> this root quat) s5-0) + (when (and (time-elapsed? (-> this last-fire) (seconds 2)) + (and (< f30-0 409600.0) (< 204800.0 f30-0)) + (not (focus-test? *target* dead)) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + ) + (set-time! (-> this last-fire)) + (fire-shot this) + ) + ) + ) + ) + (+! (-> this yaw) (* (-> this yawvel) (seconds-per-frame))) + (+! (-> this pitch) (* (-> this pitchvel) (seconds-per-frame))) + (set! (-> this pitch) (fmax -10922.667 (fmin 6371.5557 (-> this pitch)))) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this pitch)) + (none) + ) + +(defstate idle (fac-gun-tower) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (and (type? proc projectile) (not (type? proc warf-projectile))) + (when (not (vector= *fac-tower-impact-pos* (-> (the-as projectile proc) root trans))) + (set! (-> *fac-tower-impact-pos* quad) (-> (the-as projectile proc) root trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ) + ) + (('trigger) + (if (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 1024000.0) + (< 716800.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) + ) + (go-virtual open) + ) + ) + ) + ) + :enter (behavior () + (ja :group! fac-gun-tower-idle-ja :num! min) + (set-time! (-> self state-time)) + (set! (-> self pitch) 16384.0) + (quaternion-axis-angle! (-> self gun-tilt-jm quat) 1.0 0.0 0.0 (-> self pitch)) + (transform-post) + ) + :trans (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + ) + :code sleep-code + ) + +(defstate open (fac-gun-tower) + :virtual #t + :event fac-gun-tower-standard-event-handler + :enter (behavior () + (ja :group! fac-gun-tower-dooropen-ja :num! min) + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 149) (the-as int #f) (the-as vector #t) 0)) + (sound-play "gtower-open") + (sound-play "gtower-openloop" :id (-> self rotate-sound) :position (-> self root trans)) + (set! (-> self rotate-sound-playing) #t) + (sound-play "gtower-blade" :id (-> self blade-sound) :position (-> self root trans)) + (set! (-> self blade-sound-playing) #t) + ) + :trans (behavior () + '() + ) + :code (behavior () + (while (< (-> self yawvel) 131072.0) + (seek! (-> self yawvel) 131072.0 (* 65536.0 (seconds-per-frame))) + (ja :num-func num-func-identity :frame-num 0.0) + (fac-gun-tower-method-33 self) + ) + (while (< 3276.8 (-> self yawvel)) + (seek! (-> self yawvel) 3276.8 (* 21845.334 (seconds-per-frame))) + (ja :num! (seek!)) + (seek! (-> self pitch) 0.0 (* 8192.0 (seconds-per-frame))) + (fac-gun-tower-method-33 self) + (suspend) + ) + (set! (-> self invincable) #f) + (when (-> self rotate-sound-playing) + (sound-stop (-> self rotate-sound)) + (set! (-> self rotate-sound-playing) #f) + ) + (when (-> self blade-sound-playing) + (sound-stop (-> self blade-sound)) + (set! (-> self blade-sound-playing) #f) + ) + (sound-play "gtower-open-end") + (until #f + (fac-gun-tower-method-34 self) + (ja :num! (seek!)) + (suspend) + ) + #f + ) + :post transform-post + ) + +(defstate die-fast (fac-gun-tower) + :virtual #t + :code nothing + ) + +(defstate die (fac-gun-tower) + :virtual #t + :enter (behavior () + (ja :group! fac-gun-tower-dooropen-ja :num! max) + (set-time! (-> self state-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (while (< (-> self yawvel) 131072.0) + (seek! (-> self yawvel) 131072.0 (* 65536.0 (seconds-per-frame))) + (ja :num-func num-func-identity :frame-num 0.0) + (fac-gun-tower-method-33 self) + ) + ) + :post transform-post + ) diff --git a/goal_src/jak3/levels/factory/factory-boss-part.gc b/goal_src/jak3/levels/factory/factory-boss-part.gc index e238cea934..ab7b023a90 100644 --- a/goal_src/jak3/levels/factory/factory-boss-part.gc +++ b/goal_src/jak3/levels/factory/factory-boss-part.gc @@ -5,5 +5,1221 @@ ;; name in dgo: factory-boss-part ;; dgos: FACD +(define-extern *range-factory-boss-shot-explo-color* curve-color-fast) +(define-extern *range-factory-boss-shot-explo-alpha* curve2d-fast) +(define-extern *range-factory-boss-shot-explo-scale-x* curve2d-fast) +(define-extern *range-factory-boss-shot-explo-scale-y* curve2d-fast) +(define-extern *curve-factory-boss-shot-explo-alpha* curve2d-fast) +(define-extern *curve-factory-boss-shot-explo-scale-x* curve2d-fast) +(define-extern *curve-factory-boss-shot-explo-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-factory-boss-shot-trail + :id 1359 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4530 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 4531 :flags (sp6))) + ) + +(defpart 4531 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -0.8) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +(defpart 4530 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 32.0 32.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.2) + (:fade-g -1.6) + (:fade-b -3.2) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.135)) + (:next-launcher 4532) + ) + ) + +(defpart 4532 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668 -0.42666668)) + ) + +(defpart 4533 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.2) + (:fade-g -1.6) + (:fade-b -3.2) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.135)) + (:next-launcher 4534) + ) + ) + +(defpart 4534 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668 -0.42666668)) + ) + +(defpartgroup group-factory-boss-shot-explosion + :id 1360 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4535 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4536 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4537 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4538 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4539 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +(defpart 4537 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4535 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +(defpart 4536 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4538 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4539 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-factory-boss-shot-explo-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-factory-boss-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4539 init-specs 16 initial-valuef) + (the-as float *part-factory-boss-shot-explosion-texture-curve-settings*) + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* color-start) + *range-factory-boss-shot-explo-color* + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* alpha-start) + *range-factory-boss-shot-explo-alpha* + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-x-start) + *range-factory-boss-shot-explo-scale-x* + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-y-start) + *range-factory-boss-shot-explo-scale-y* + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* a-scalar) + *curve-factory-boss-shot-explo-alpha* + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-x-scalar) + *curve-factory-boss-shot-explo-scale-x* + ) + +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-y-scalar) + *curve-factory-boss-shot-explo-scale-y* + ) + +(defpartgroup group-factory-boss-machine-damaged-high-smoke + :id 1361 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4540 :flags (sp7))) + ) + +(defpart 4540 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 2) (meters 2)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0) (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64 0.64) + (:accel-y (meters 0.00033333333) (meters 0.00066666666)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.335)) + (:next-launcher 4541) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4541 + :init-specs ((:fade-a -0.256 -0.256)) + ) + +(defpartgroup group-factory-boss-machine-damaged-low-smoke + :id 1362 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4542 :flags (sp7))) + ) + +(defpart 4542 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3) + (:x (meters -1) (meters 2)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 16.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28) + (:accel-y (meters 0.00016666666) (meters 0.00033333333)) + (:friction 0.97 0.01) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.335)) + (:next-launcher 4543) + (:conerot-x (degrees 60)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4543 + :init-specs ((:fade-a -0.11636364 -0.11636364)) + ) + +(defpartgroup group-factory-boss-machine-ring1 + :id 1363 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4544 :flags (is-3d sp6 sp7))) + ) + +(defpart 4544 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.38)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-machine-ring2 + :id 1364 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4545 :flags (is-3d sp6 sp7))) + ) + +(defpart 4545 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.38)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 1.0) + (:b 1.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-machine-ring3 + :id 1365 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4546 :flags (is-3d sp6 sp7))) + ) + +(defpart 4546 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.45)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 128.0) + (:b 1.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-machine-ring4 + :id 1366 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4547 :flags (is-3d sp6 sp7))) + ) + +(defpart 4547 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.38)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 1.0) + (:b 128.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-machine-explosion + :id 1367 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4548 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4549 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4550 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4551 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4552 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +(defpart 4550 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4548 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +(defpart 4549 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4551 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4552 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-factory-boss-shot-explo-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-factory-boss-machine-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4552 init-specs 16 initial-valuef) + (the-as float *part-factory-boss-machine-explosion-texture-curve-settings*) + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* color-start) + *range-factory-boss-shot-explo-color* + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* alpha-start) + *range-factory-boss-shot-explo-alpha* + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-x-start) + *range-factory-boss-shot-explo-scale-x* + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-y-start) + *range-factory-boss-shot-explo-scale-y* + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* a-scalar) + *curve-factory-boss-shot-explo-alpha* + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-x-scalar) + *curve-factory-boss-shot-explo-scale-x* + ) + +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-y-scalar) + *curve-factory-boss-shot-explo-scale-y* + ) + +(defpartgroup group-missile-bot-fizzle + :id 1368 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4553 :flags (sp7)) (sp-item 4553 :flags (sp7))) + ) + +(defpart 4554 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -0.5) (meters 1.5)) + (:scale-x (meters 4) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 4) (meters 3)) + (:r 64.0) + (:g 128.0 64.0) + (:b 196.0 64.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.08 -0.16) + (:friction 0.95 0.03) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-missile-bot-spark + :id 1369 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4555 :flags (sp7))) + ) + +(defpart 4556 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.05)) + (:rot-x (degrees 0.675)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 255.0) + (:b 0.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1228.8) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4557 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 1) (meters 0.05)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-missile-bot-thruster + :id 1370 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4558 :fade-after (meters 120) :falloff-to (meters 120) :flags (is-3d sp7)) + (sp-item 4559 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + (sp-item 4560 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + (sp-item 4561 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7)) + (sp-item 4562 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7)) + ) + ) + +(defpart 4558 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 1.0) + (:z (meters 0.5)) + (:scale-x (meters 0.5) (meters 0.1)) + (:scale-y (meters 1) (meters 0.1)) + (:r 96.0 32.0) + (:g 0.0 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4559 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 1) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0 32.0) + (:b 0.0) + (:a 8.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4560 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.0 1.0) + (:y (meters 0) (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 1) (meters 0.6)) + (:r 255.0) + (:g 64.0) + (:b 0.0) + (:a 16.0 16.0) + (:vel-y (meters 0.06666667) (meters 0.016666668)) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:scalevel-y (meters 0.016666668) (meters 0.033333335)) + (:fade-r -1.28 -1.28) + (:fade-g 1.0) + (:fade-b 2.0) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.94) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.167)) + (:next-launcher 4563) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4563 + :init-specs ((:r 64.0 128.0) (:g :copy r) (:b :copy g) (:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.128 -0.256)) + ) + +(defpart 4561 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1 0.1) + (:y (meters 0.25) (meters 0.5)) + (:scale-x (meters 0.05)) + (:scale-y (meters 0.5)) + (:r 192.0 64.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.026666667)) + (:scalevel-x (meters 0.001)) + (:scalevel-y (meters -0.017)) + (:fade-g 0.0) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters -0.00016666666) (meters -0.0005)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.1)) + (:next-launcher 4564) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4564 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0))) + ) + +(defpart 4562 + :init-specs ((:num 0.6) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-y (meters 0.06666667) (meters 0.016666668)) + (:fade-r 32.768) + (:fade-g 26.623999) + (:fade-b 28.671999) + (:accel-x (meters 0) (meters 0.0016666667)) + (:friction 0.94) + (:timer (seconds 0.335)) + (:flags (distort)) + (:next-time (seconds 0.167)) + (:next-launcher 4565) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4565 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096)) + ) + +(defpartgroup group-factory-boss-bomb-reticle + :id 1371 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4566 :flags (is-3d sp7))) + ) + +(defpart 4566 + :init-specs ((:texture (errolbomb-target-reg-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-bomb-corner + :id 1372 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4567 :flags (is-3d sp7))) + ) + +(defpart 4567 + :init-specs ((:texture (errolbomb-target-reg-corner-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-bomb-dot + :id 1373 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4568 :flags (is-3d sp7))) + ) + +(defpart 4568 + :init-specs ((:texture (errolbomb-target-dot-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-bomb-arrow + :id 1374 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4569 :flags (is-3d sp7))) + ) + +(defpart 4569 + :init-specs ((:texture (errolbomb-target-indicator-arrow-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 1.2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-superbomb-reticle + :id 1375 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4570 :flags (is-3d sp7))) + ) + +(defpart 4570 + :init-specs ((:texture (errolbomb-target-supr-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-superbomb-ring + :id 1376 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4571 :flags (is-3d sp7))) + ) + +(defpart 4571 + :init-specs ((:texture (errolbomb-target-supr-ring-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-boss-launch-critter + :id 1377 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4572 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4573 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4574 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 4572 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.10666667)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4573 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 48.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees 70) (degrees 40)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4574 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 9011.25)) + (:scalevel-x (meters 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.4) + (:timer (seconds 0.15)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +(defpartgroup group-facboss-sparks + :id 1378 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4555 :flags (sp7)) (sp-item 4553 :flags (sp7)) (sp-item 4553 :flags (sp7))) + ) + +(defpart 4555 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:fade-r -0.10666667) + (:fade-g -0.10666667) + (:fade-a -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.94 0.04) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4553 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.1) + (:x (meters -2) (meters 4)) + (:y (meters -2) (meters 4)) + (:z (meters 1)) + (:scale-x (meters 1) (meters 3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 255.0) + (:a -512.0 5 128.0) + (:scalevel-x (meters -0.1)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) diff --git a/goal_src/jak3/levels/factory/factory-boss-scenes.gc b/goal_src/jak3/levels/factory/factory-boss-scenes.gc index a8807461d5..fec6f2df0c 100644 --- a/goal_src/jak3/levels/factory/factory-boss-scenes.gc +++ b/goal_src/jak3/levels/factory/factory-boss-scenes.gc @@ -5,5 +5,2145 @@ ;; name in dgo: factory-boss-scenes ;; dgos: FACD +(define-extern *range-fbme-dust-color* curve-color-fast) +(define-extern *range-fbme-dust-alpha* curve2d-fast) +(define-extern *range-fbme-dust-scale-x* curve2d-fast) +(define-extern *range-fbme-dust-scale-y* curve2d-fast) +(define-extern *curve-fbme-dust-alpha* curve2d-fast) +(define-extern *curve-fbme-dust-scale-x* curve2d-fast) +(define-extern *curve-fbme-dust-scale-y* curve2d-fast) +(define-extern *range-fbme-color* curve-color-fast) +(define-extern *range-fbme-alpha* curve2d-fast) +(define-extern *range-fbme-scale-x* curve2d-fast) +(define-extern *range-fbme-scale-y* curve2d-fast) +(define-extern *curve-fbme-alpha* curve2d-fast) +(define-extern *curve-fbme-scale-x* curve2d-fast) +(define-extern *curve-fbme-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(defskelgroup skel-fac-fma-breaking-bits fac-fma-breaking-bits fac-fma-breaking-bits-lod0-jg fac-fma-breaking-bits-idle-ja + ((fac-fma-breaking-bits-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :origin-joint-index 3 + ) + +(defskelgroup skel-eco-crystal-light-fma eco-crystal-light eco-crystal-light-lod0-jg eco-crystal-light-idle-ja + ((eco-crystal-light-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(defskelgroup skel-fac-drop-plat-fma fac-drop-plat fac-drop-plat-lod0-jg fac-drop-plat-idle-ja + ((fac-drop-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +(set! (-> *lightning-spec-id-table* 40) (new 'static 'lightning-spec + :name "warp-gate-lightning-shock-small" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x40 :g #x10 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8601.6 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +(load-scene (new 'static 'scene + :name "factory-boss-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-204" + :art-group "scenecamera" + :anim "factory-boss-res" + :parts 11 + :command-list '((0 + (send-event "factory-boss-1" 'complete) + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryd) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (setting-reset borrow mode '((factorya 1 lfacrm2 special))) + (kill "fac-drop-plat-21") + (kill "fac-drop-plat-30") + (kill "fac-drop-plat-32") + (kill "fac-drop-plat-45") + (kill "fac-drop-plat-57") + (kill "fac-drop-plat-58") + (kill "fac-drop-plat-62") + (kill "fac-drop-plat-64") + (kill "fac-drop-plat-77") + (kill "fac-drop-plat-78") + (kill "fac-drop-plat-79") + (kill "fac-drop-plat-90") + (kill "fac-drop-plat-92") + (kill "fac-drop-plat-102") + (kill "fac-drop-plat-104") + (kill "fac-drop-plat-108") + (kill "fac-drop-plat-133") + (kill "fac-drop-plat-137") + (kill "fac-drop-plat-145") + (kill "fac-drop-plat-148") + (kill "fac-drop-plat-156") + (kill "fac-drop-plat-159") + (kill "fac-drop-plat-162") + (kill "fac-drop-plat-166") + (kill "fac-drop-plat-178") + (kill "fac-drop-plat-179") + (kill "fac-drop-plat-185") + (kill "fac-drop-plat-190") + (kill "fac-drop-plat-212") + (kill "fac-drop-plat-216") + (kill "fac-drop-plat-218") + (kill "fac-drop-plat-219") + (kill "fac-drop-plat-226") + (kill "fac-drop-plat-227") + (kill "fac-drop-plat-241") + (kill "fac-drop-plat-255") + (kill "fac-drop-plat-258") + ) + (81 (part-tracker + "group-fac-boss-missile-explosion" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 81 111) + ) + ) + (132 (part-tracker + "group-placeholder-small" + entity + "light-eco-crystal" + joint + "main" + track + #t + duration + (frame-range 132 133) + ) + ) + (133 (part-tracker + "group-placeholder-small" + entity + "light-eco-crystal" + joint + "main" + track + #t + duration + (frame-range 133 134) + ) + ) + (143 (part-tracker + "group-placeholder-small" + entity + "light-eco-crystal" + joint + "main" + track + #t + duration + (frame-range 143 144) + ) + ) + (279 + (part-tracker + "group-enter-dark-warpgate" + entity + "particleman" + joint + "particleW" + track + #f + duration + (frame-range 279 295) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleT" + duration + (frame-range 279 300) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleU" + duration + (frame-range 279 320) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleV" + duration + (frame-range 279 305) + ) + ) + (304 (part-tracker + "group-factory-daxter-impact-dust" + entity + "sidekick-highres" + joint + "Rball" + track + #f + duration + (frame-range 304 305) + ) + ) + (388 + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 388 422) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleP" + track + #t + duration + (frame-range 388 422) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleQ" + track + #t + duration + (frame-range 388 422) + ) + ) + (399 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-time-30 10) + ) + ) + (400 + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "a" + track + #t + duration + (frame-range 400 655) + ) + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "b" + track + #t + duration + (frame-range 400 655) + ) + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "c" + track + #t + duration + (frame-range 400 655) + ) + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "d" + track + #t + duration + (frame-range 400 655) + ) + ) + (401 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleF" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleK" + track + #f + duration + (frame-time-30 10) + ) + ) + (402 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleH" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleI" + track + #f + duration + (frame-time-30 10) + ) + ) + (403 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleG" + track + #f + duration + (frame-time-30 10) + ) + ) + (438 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-time-30 10) + ) + ) + (440 + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 440 475) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleP" + track + #t + duration + (frame-range 388 422) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleQ" + track + #t + duration + (frame-range 388 422) + ) + ) + (446 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-time-30 10) + ) + ) + (448 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleK" + track + #f + duration + (frame-time-30 10) + ) + ) + (457 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-time-30 10) + ) + ) + (476 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleR" + track + #f + duration + (frame-time-30 10) + ) + ) + (487 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-time-30 10) + ) + ) + (489 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleG" + track + #f + duration + (frame-time-30 10) + ) + ) + (490 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleF" + track + #f + duration + (frame-time-30 10) + ) + ) + (514 (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleR" + track + #t + duration + (frame-range 514 534) + ) + ) + (520 + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 520 547) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleP" + track + #t + duration + (frame-range 520 547) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleQ" + track + #t + duration + (frame-range 520 547) + ) + ) + (526 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 526 527) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleH" + track + #f + duration + (frame-time-30 10) + ) + ) + (533 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleI" + track + #f + duration + (frame-time-30 10) + ) + ) + (534 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-time-30 10) + ) + ) + (550 (part-tracker + "group-factory-daxter-impact-dust" + entity + "jakc-highres" + joint + "Lball" + track + #f + duration + (frame-range 550 551) + ) + ) + (559 (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleS" + track + #t + duration + (frame-range 559 577) + ) + ) + (567 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-time-30 10) + ) + ) + (568 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-time-30 10) + ) + ) + (578 (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleS" + track + #t + duration + (frame-range 578 605) + ) + ) + (586 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleF" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleL" + track + #t + duration + (frame-range 586 587) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleM" + track + #t + duration + (frame-range 586 587) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 586 587) + ) + ) + (587 (part-tracker + "group-factory-daxter-impact-dust" + entity + "jakc-highres" + joint + "Lball" + track + #f + duration + (frame-range 587 588) + ) + ) + (588 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleG" + track + #f + duration + (frame-time-30 10) + ) + ) + (589 (part-tracker + "group-factory-debris-impact" + entity + "light-eco-crystal" + joint + "main" + track + #f + duration + (frame-time-30 10) + ) + ) + (600 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-time-30 10) + ) + ) + (601 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-time-30 10) + ) + ) + (648 + (part-tracker + "group-enter-dark-warpgate" + entity + "particleman" + joint + "particleW" + track + #f + duration + (frame-range 648 670) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleT" + duration + (frame-range 648 689) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleU" + duration + (frame-range 648 674) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleV" + duration + (frame-range 648 692) + ) + ) + (send-event self 'user-data-set! (task-closed? "factory-boss-resolution")) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-boss-resolution") + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'factorya + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((239 243)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "errol" + :level 'factorya + :art-group "skel-errol" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-fma-breaking-bits" + :level 'factorya + :art-group "skel-fac-fma-breaking-bits" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "a-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "b-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "g-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "i-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "l-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "m-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "n-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "o-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "p-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "r-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "s-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "t-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "u-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "v-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "x-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "y-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "z-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "aa-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ab-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ac-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ad-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ae-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ai-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ak-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "al-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "am-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "an-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "eco-crystal-light-fma" + :level 'factoryd + :art-group "skel-eco-crystal-light-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factoryd-res-fma" + :end-point "freehq-post-boss" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe7 + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup026")) + ) + ) + +(defpartgroup group-fac-boss-missile-explosion + :id 1379 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4575 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4576 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4577 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4578 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4579 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4580 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +(defpart 4575 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +(defpart 4576 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4577 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-fbme-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fbme-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fbme-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fbme-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fbme-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fbme-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fbme-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-boss-missile-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4577 init-specs 14 initial-valuef) + (the-as float *part-fac-boss-missile-explosion-dust-in-curve-settings*) + ) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* color-start) *range-fbme-dust-color*) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* alpha-start) *range-fbme-dust-alpha*) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-x-start) *range-fbme-dust-scale-x*) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-y-start) *range-fbme-dust-scale-y*) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* a-scalar) *curve-fbme-dust-alpha*) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-x-scalar) *curve-fbme-dust-scale-x*) + +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-y-scalar) *curve-fbme-dust-scale-y*) + +(defpart 4579 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4580 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-fbme-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fbme-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fbme-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fbme-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fbme-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fbme-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fbme-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-fac-boss-missile-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 4580 init-specs 16 initial-valuef) + (the-as float *part-fac-boss-missile-explosion-texture-curve-settings*) + ) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* color-start) *range-fbme-color*) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* alpha-start) *range-fbme-alpha*) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-x-start) *range-fbme-scale-x*) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-y-start) *range-fbme-scale-y*) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* a-scalar) *curve-fbme-alpha*) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-x-scalar) *curve-fbme-scale-x*) + +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-y-scalar) *curve-fbme-scale-y*) + +(defpart 4578 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-enter-dark-warpgate + :id 1380 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4581 :flags (sp3)) + (sp-item 4582 :flags (sp3)) + (sp-item 4583 :period (seconds 2) :length (seconds 0.167)) + ) + ) + +(defpart 4581 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.16666667)) + (:scalevel-y (meters 0.26666668)) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4582 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y (meters 0.13333334)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 4583 + :init-specs ((:texture (middot level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.01125)) + (:vel-z (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.42666668) + (:fade-g -0.21333334 -0.21333334) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -30) (degrees 60)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-factory-errol-jetpack-l + :id 1381 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4584 :flags (is-3d sp7)) (sp-item 4585 :flags (sp6 sp7)) (sp-item 4586 :flags (sp7))) + ) + +(defpart 4584 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 6.0) + (:x (meters 0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-x (degrees 60)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 1) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 30.0 30.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4585 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 80.0 2.0) + (:fade-a -0.12) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4586 + :init-specs ((:num 1.0) + (:x (meters 0.2)) + (:rot-x 8) + (:r 4096.0) + (:g 2048.0) + (:b 1638.4) + (:vel-y (meters 0.33333334)) + (:fade-b 1.3653333) + (:accel-y (meters -0.00066666666)) + (:friction 0.8) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (distort)) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-factory-errol-jetpack-r + :id 1382 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4587 :flags (is-3d sp7)) (sp-item 4588 :flags (sp6 sp7)) (sp-item 4589 :flags (sp7))) + ) + +(defpart 4587 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 6.0) + (:x (meters -0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-x (degrees 60)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 1) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 30.0 30.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4588 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 80.0 2.0) + (:fade-a -0.12) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4589 + :init-specs ((:num 1.0) + (:x (meters -0.2)) + (:rot-x 8) + (:r 4096.0) + (:g 2048.0) + (:b 1638.4) + (:vel-y (meters 0.33333334)) + (:fade-b 1.3653333) + (:accel-y (meters -0.00066666666)) + (:friction 0.8) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (distort)) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-factory-daxter-impact-dust + :id 1383 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4590)) + ) + +(defpart 4590 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 150.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-factory-debris-trails + :id 1384 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4591)) + ) + +(defpart 4591 + :init-specs ((:texture (ceiling-dust factoryd-sprite)) + (:birth-func 'spt-birth-func-part-factory-debris-trails) + (:num 2.0 2.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters -2) 2.0 (meters 4)) + (:rot-z (degrees 0)) + (:scale-y (meters 2) (meters 4)) + (:r 50.0 200.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.999) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 1 0 -1161820672 -1161820416 -1161820416 -1161820416 -1161820416) + ) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-factory-debris-trails ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group (the-as int arg0) arg1 arg2) + (birth-func-flip-based-on-scale + arg0 + arg1 + (the-as sprite-vec-data-3d arg2) + (the-as sparticle-launcher arg3) + (the-as sparticle-launch-state arg4) + ) + (none) + ) + +(defpartgroup group-factory-debris-impact + :id 1385 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4592) (sp-item 4593 :falloff-to (meters 20) :flags (is-3d sp7))) + ) + +(defpart 4592 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 8.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 150.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4593 + :init-specs ((:texture (glass-shard-01 factoryd-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 50.0 10.0) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 0.3)) + (:r 0.0 2.0 64.0) + (:g 64.0 2.0 64.0) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:rotvel-x (degrees -4) (degrees 8)) + (:rotvel-y (degrees -4) (degrees 8)) + (:rotvel-z (degrees -4) (degrees 8)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 -1161820160 -1161819904 -1161819648 -1161819392)) + (:func 'check-drop-group-center) + (:next-time (seconds 0.167)) + (:next-launcher 4594) + (:conerot-x (degrees 0) (degrees 45)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4594 + :init-specs ((:r 0.0 2.0 64.0) + (:g 64.0 2.0 64.0) + (:b :copy g) + (:a 128.0) + (:next-time (seconds 0.085) (seconds 0.165)) + (:next-launcher 4595) + ) + ) + +(defpart 4595 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 4594) + ) + ) diff --git a/goal_src/jak3/levels/factory/factory-boss-setup.gc b/goal_src/jak3/levels/factory/factory-boss-setup.gc index e68a99cf7d..bf77721e0b 100644 --- a/goal_src/jak3/levels/factory/factory-boss-setup.gc +++ b/goal_src/jak3/levels/factory/factory-boss-setup.gc @@ -5,5 +5,2166 @@ ;; name in dgo: factory-boss-setup ;; dgos: FACD +(declare-type factory-boss process-drawable) +(declare-type factory-boss-shockwave-bomb projectile) +(declare-type factory-boss-floorbuster-bomb projectile) + +;; +++facboss-bomb-type +(defenum facboss-bomb-type + :type uint64 + (bomb0 0) + (bomb1 1) + (bomb2 2) + ) +;; ---facboss-bomb-type + + +;; +++facboss-machine-state-flag +(defenum facboss-machine-state-flag + :type uint8 + :bitfield #t + (fms0 0) + (fms1 1) + (fms2 2) + (fms3 3) + ) +;; ---facboss-machine-state-flag + + +;; +++facboss-critter-tracker-flag +(defenum facboss-critter-tracker-flag + :type uint32 + :bitfield #t + (fct0 0) + (fct1 1) + (fct2 2) + ) +;; ---facboss-critter-tracker-flag + + +;; +++facboss-speech-info-flag +(defenum facboss-speech-info-flag + :type uint8 + :bitfield #t + (fsi0 0) + (fsi1 1) + ) +;; ---facboss-speech-info-flag + + +;; +++facboss-speech-instance-flag +(defenum facboss-speech-instance-flag + :type uint64 + :bitfield #t + (fsi0 0) + (fsi1 1) + (fsi2 2) + (fsi3 3) + (fsi4 4) + ) +;; ---facboss-speech-instance-flag + + ;; DECOMP BEGINS +(define-perm *factory-boss-dead-pool* dead-pool #f) + +(deftype factory-boss-speech-instance (structure) + ((speech string) + (probability float) + (flags facboss-speech-instance-flag) + (play-count uint32) + ) + ) + + +(deftype factory-boss-speech-info (structure) + ((speeches (array factory-boss-speech-instance)) + (play-time time-frame) + (current-random time-frame) + (minimum-interval time-frame) + (random-interval time-frame) + (last-played int8) + (flags facboss-speech-info-flag) + ) + ) + + +(deftype factory-boss-speech-group (structure) + ((play-time time-frame) + (info (array factory-boss-speech-info)) + ) + ) + + +(define *factory-boss-speech* + (new 'static 'factory-boss-speech-group + :info (new 'static 'boxed-array :type factory-boss-speech-info + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol101" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero003" :probability 1.0) + (new 'static 'factory-boss-speech-instance + :speech "ero023" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance + :speech "ero024" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance :speech "ero037" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero038" :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol105" :probability 1.0) + (new 'static 'factory-boss-speech-instance + :speech "erol107" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance :speech "ero004" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero013" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero020" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero022" :probability 1.0) + ) + :minimum-interval (seconds 10) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "ero014" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero017" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero036" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero059" :probability 1.0) + ) + :minimum-interval (seconds 9) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol102" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol104" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol112" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol113" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol118" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero005" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero075" :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol114" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol115" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol116" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol117" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol118" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol119" :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "ero070" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero061" :probability 1.0) + ) + :minimum-interval (seconds 15) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "ero078" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero079" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero096" :probability 1.0) + ) + :minimum-interval (seconds 1) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "dax684" :probability 1.0) + (new 'static 'factory-boss-speech-instance + :speech "dax685" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance + :speech "dax686" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + ) + :minimum-interval (seconds 5) + ) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun reset-factory-boss-speeches () + (set! (-> *factory-boss-speech* play-time) 0) + (dotimes (v1-1 (-> *factory-boss-speech* info length)) + (let ((a0-2 (-> *factory-boss-speech* info v1-1))) + (dotimes (a1-2 (-> a0-2 speeches length)) + (set! (-> a0-2 speeches a1-2 play-count) (the-as uint 0)) + ) + (set! (-> a0-2 play-time) 0) + (set! (-> a0-2 current-random) 0) + (set! (-> a0-2 last-played) -1) + ) + ) + (none) + ) + +;; WARN: Function factory-boss-play-speech has a return type of none, but the expression builder found a return statement. +(defun factory-boss-play-speech ((arg0 int) (arg1 factory-boss)) + (let ((gp-0 (-> *factory-boss-speech* info arg0))) + (if (zero? (-> gp-0 speeches length)) + (return 0) + ) + (if (logtest? (-> gp-0 flags) (facboss-speech-info-flag fsi0)) + (set! (-> gp-0 play-time) (-> *factory-boss-speech* play-time)) + ) + (if (not (time-elapsed? (-> gp-0 play-time) (+ (-> gp-0 minimum-interval) (-> gp-0 current-random)))) + (return 0) + ) + (let ((f30-0 0.0) + (s4-0 (-> gp-0 speeches 0 play-count)) + ) + (dotimes (v1-18 (-> gp-0 speeches length)) + (let ((a0-8 (-> gp-0 speeches v1-18))) + (cond + ((or (< s4-0 (-> a0-8 play-count)) + (and (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi1)) (nonzero? (-> gp-0 play-time))) + (and (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi2)) (zero? (-> gp-0 play-time))) + (and (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi0)) (> (-> a0-8 play-count) 0)) + (and (not (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi3))) (= (-> gp-0 last-played) v1-18)) + ) + (logclear! (-> a0-8 flags) (facboss-speech-instance-flag fsi4)) + ) + ((= (-> a0-8 play-count) s4-0) + (+! f30-0 (-> a0-8 probability)) + (logior! (-> a0-8 flags) (facboss-speech-instance-flag fsi4)) + ) + (else + (set! s4-0 (-> a0-8 play-count)) + (set! f30-0 (-> a0-8 probability)) + (logior! (-> a0-8 flags) (facboss-speech-instance-flag fsi4)) + ) + ) + ) + ) + (let ((f0-2 (* f30-0 (rand-vu)))) + (dotimes (s3-0 (-> gp-0 speeches length)) + (let ((s2-0 (-> gp-0 speeches s3-0))) + (cond + ((or (not (logtest? (-> s2-0 flags) (facboss-speech-instance-flag fsi4))) (< s4-0 (-> s2-0 play-count))) + ) + ((or (>= (-> s2-0 probability) f0-2) (logtest? (-> s2-0 flags) (facboss-speech-instance-flag fsi1))) + (let ((a1-28 (add-process *gui-control* arg1 (gui-channel sig) (gui-action play) (-> s2-0 speech) 81920.0 0))) + (when (sound-params-set! *gui-control* a1-28 #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (set! (-> s2-0 play-count) (+ s4-0 1)) + (set-time! (-> *factory-boss-speech* play-time)) + (set-time! (-> gp-0 play-time)) + (set! (-> gp-0 current-random) + (the-as time-frame (the int (* (rand-vu) (the float (-> gp-0 random-interval))))) + ) + (set! (-> gp-0 last-played) s3-0) + ) + ) + (return 0) + ) + (else + (set! f0-2 (- f0-2 (-> gp-0 speeches s3-0 probability))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype factory-boss-reticle-info (structure) + ((reticle sparticle-launch-control) + (reticle-corner-0 sparticle-launch-control) + (reticle-corner-1 sparticle-launch-control) + (reticle-corner-2 sparticle-launch-control) + (reticle-corner-3 sparticle-launch-control) + (reticle-dot sparticle-launch-control) + (reticle-arrow sparticle-launch-control) + (reticle-super sparticle-launch-control) + (reticle-super-ring sparticle-launch-control) + (lock-time time-frame) + ) + (:methods + (init! (_type_ process) none) + (factory-boss-reticle-info-method-10 (_type_ vector vector int int) none) + (factory-boss-reticle-info-method-11 (_type_) none) + ) + ) + + +(defmethod init! ((this factory-boss-reticle-info) (arg0 process)) + (set! (-> this reticle) (create-launch-control (-> *part-group-id-table* 1371) arg0)) + (set! (-> this reticle-corner-0) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-corner-1) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-corner-2) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-corner-3) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-dot) (create-launch-control (-> *part-group-id-table* 1373) arg0)) + (set! (-> this reticle-arrow) (create-launch-control (-> *part-group-id-table* 1374) arg0)) + (set! (-> this reticle-super) (create-launch-control (-> *part-group-id-table* 1375) arg0)) + (set! (-> this reticle-super-ring) (create-launch-control (-> *part-group-id-table* 1376) arg0)) + (set! (-> this lock-time) 0) + 0 + (none) + ) + +(defmethod factory-boss-reticle-info-method-10 ((this factory-boss-reticle-info) (arg0 vector) (arg1 vector) (arg2 int) (arg3 int)) + (local-vars (sv-160 vector)) + (set! sv-160 arg0) + (let ((s4-0 arg1) + (s2-0 arg2) + (s1-0 arg3) + ) + (cond + ((zero? s2-0) + (if (zero? (-> this lock-time)) + (set-time! (-> this lock-time)) + ) + ) + (else + (set! (-> this lock-time) 0) + 0 + ) + ) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((s0-0 (or (nonzero? (-> this lock-time)) (< 24 (mod s2-0 48)))) + (s3-0 #t) + ) + (let ((f28-0 0.0) + (f30-0 0.0) + ) + (matrix-identity! s5-0) + (set! (-> s5-0 trans quad) (-> sv-160 quad)) + (let ((v1-8 s1-0)) + (cond + ((zero? v1-8) + (if (zero? s2-0) + (set! f28-0 128.0) + (set! f30-0 128.0) + ) + ) + ((= v1-8 2) + (cond + ((zero? s2-0) + (set! f28-0 128.0) + ) + (else + (set! f28-0 128.0) + (set! f30-0 128.0) + ) + ) + ) + ((zero? s2-0) + (set! f28-0 128.0) + ) + (else + (set! f30-0 128.0) + ) + ) + ) + (set! (-> *part-id-table* 4568 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4568 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4569 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4569 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4566 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4566 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4567 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4567 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4570 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4570 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4571 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4571 init-specs 6 initial-valuef) f30-0) + ) + (cond + ((zero? s1-0) + (if s3-0 + (spawn-from-mat (-> this reticle) s5-0) + ) + (let ((s1-1 (new 'stack-no-clear 'matrix))) + (let* ((f0-2 (lerp-scale 1.0 0.1 (the float (mod s2-0 90)) 90.0 0.0)) + (f30-1 (* 3686.4 f0-2)) + ) + (let* ((a2-2 s1-1) + (a3-2 s5-0) + (v1-64 (-> a3-2 rvec quad)) + (a0-9 (-> a3-2 uvec quad)) + (a1-3 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> a2-2 rvec quad) v1-64) + (set! (-> a2-2 uvec quad) a0-9) + (set! (-> a2-2 fvec quad) a1-3) + (set! (-> a2-2 trans quad) a3-3) + ) + (vector+float*! (-> s1-1 trans) (-> s5-0 trans) (-> s5-0 rvec) (- f30-1)) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (- f30-1)) + (spawn-from-mat (-> this reticle-corner-0) s1-1) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* 2.0 f30-1)) + (set! (-> s1-1 rvec quad) (-> s5-0 fvec quad)) + (vector-negate! (-> s1-1 fvec) (-> s5-0 rvec)) + (spawn-from-mat (-> this reticle-corner-1) s1-1) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (* 2.0 f30-1)) + (vector-negate! (-> s1-1 rvec) (-> s5-0 rvec)) + (vector-negate! (-> s1-1 fvec) (-> s5-0 fvec)) + (spawn-from-mat (-> this reticle-corner-2) s1-1) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* -2.0 f30-1)) + ) + (vector-negate! (-> s1-1 rvec) (-> s5-0 fvec)) + (set! (-> s1-1 fvec quad) (-> s5-0 rvec quad)) + (spawn-from-mat (-> this reticle-corner-3) s1-1) + ) + ) + ((= s1-0 2) + (if s3-0 + (spawn-from-mat (-> this reticle-super) s5-0) + ) + (if s0-0 + (spawn-from-mat (-> this reticle-super-ring) s5-0) + ) + ) + (else + (spawn-from-mat (-> this reticle-super-ring) s5-0) + ) + ) + (if s3-0 + (spawn-from-mat (-> this reticle-dot) s5-0) + ) + ) + (let ((a1-21 (new 'stack-no-clear 'vector))) + (vector-! a1-21 (-> s5-0 trans) s4-0) + (set! (-> a1-21 y) 0.0) + (vector-normalize-copy! (-> s5-0 fvec) a1-21 1.8) + ) + (vector-cross! (-> s5-0 rvec) (-> s5-0 uvec) (-> s5-0 fvec)) + (vector+float*! (-> s5-0 trans) (-> s5-0 trans) (-> s5-0 fvec) -4096.0) + (spawn-from-mat (-> this reticle-arrow) s5-0) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sparticle-launch-control vs factory-boss-reticle-info. +(defmethod relocate ((this factory-boss-reticle-info) (offset int)) + (if (nonzero? (-> this reticle)) + (&+! (-> this reticle) offset) + ) + (if (nonzero? (-> this reticle-corner-0)) + (&+! (-> this reticle-corner-0) offset) + ) + (if (nonzero? (-> this reticle-corner-1)) + (&+! (-> this reticle-corner-1) offset) + ) + (if (nonzero? (-> this reticle-corner-2)) + (&+! (-> this reticle-corner-2) offset) + ) + (if (nonzero? (-> this reticle-corner-3)) + (&+! (-> this reticle-corner-3) offset) + ) + (if (nonzero? (-> this reticle-dot)) + (&+! (-> this reticle-dot) offset) + ) + (if (nonzero? (-> this reticle-arrow)) + (&+! (-> this reticle-arrow) offset) + ) + (if (nonzero? (-> this reticle-super)) + (&+! (-> this reticle-super) offset) + ) + (the-as factory-boss-reticle-info (when (nonzero? (-> this reticle-super-ring)) + (let ((v0-0 (&+ (-> this reticle-super-ring) offset))) + (set! (-> this reticle-super-ring) v0-0) + v0-0 + ) + ) + ) + ) + +(defmethod factory-boss-reticle-info-method-11 ((this factory-boss-reticle-info)) + (if (nonzero? (-> this reticle)) + (kill-particles (-> this reticle)) + ) + (if (nonzero? (-> this reticle-corner-0)) + (kill-particles (-> this reticle-corner-0)) + ) + (if (nonzero? (-> this reticle-corner-1)) + (kill-particles (-> this reticle-corner-1)) + ) + (if (nonzero? (-> this reticle-corner-2)) + (kill-particles (-> this reticle-corner-2)) + ) + (if (nonzero? (-> this reticle-corner-3)) + (kill-particles (-> this reticle-corner-3)) + ) + (if (nonzero? (-> this reticle-dot)) + (kill-particles (-> this reticle-dot)) + ) + (if (nonzero? (-> this reticle-arrow)) + (kill-particles (-> this reticle-arrow)) + ) + (if (nonzero? (-> this reticle-super)) + (kill-particles (-> this reticle-super)) + ) + (if (nonzero? (-> this reticle-super-ring)) + (kill-particles (-> this reticle-super-ring)) + ) + 0 + (none) + ) + +(deftype factory-boss-shot (projectile) + ((trail-part sparticle-launch-control) + (traj trajectory :inline) + (traj-time time-frame) + (shot-dest vector :inline) + (impact-played symbol) + (reticle-sound sound-id) + (reticle-sound-playing symbol) + ) + (:methods + (stop-reticle-sound (_type_) none) + ) + ) + + +(defmethod deal-damage! ((this factory-boss-shot) (arg0 process) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type projectile deal-damage!)) + (s5-0 (t9-0 this arg0 arg1)) + ) + (if (and s5-0 (= arg0 *target*)) + (factory-boss-play-speech 2 (the-as factory-boss this)) + ) + s5-0 + ) + ) + +(defmethod stop-reticle-sound ((this factory-boss-shot)) + (when (-> this reticle-sound-playing) + (sound-stop (-> this reticle-sound)) + (set! (-> this reticle-sound-playing) #f) + ) + 0 + (none) + ) + +(defmethod relocate ((this factory-boss-shot) (offset int)) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this factory-boss-shot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (stop-reticle-sound this) + (call-parent-method this) + (none) + ) + +(defmethod projectile-method-25 ((this factory-boss-shot)) + (if (nonzero? (-> this trail-part)) + (push-back (-> this trail-part) (-> this root trans)) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this factory-boss-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-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 + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> 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 init-proj-settings! ((this factory-boss-shot)) + (with-pp + (set! (-> this attack-mode) 'eco-dark) + (set! (-> this sound-id) (new-sound-id)) + (let ((t9-1 (method-of-type projectile init-proj-settings!))) + (t9-1 this) + ) + (set! (-> this shot-dest quad) (-> this root transv quad)) + (set-time! (-> this traj-time)) + (cond + ((type? this factory-boss-shockwave-bomb) + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4533) 8.0) + ) + ) + (setup-from-to-duration-and-height! (-> this traj) (-> this root trans) (-> this root transv) 300.0 8192.0) + ) + (else + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4530) 10.0) + ) + ) + (setup-from-to-duration-and-height! (-> this traj) (-> this root trans) (-> this root transv) 225.0 8192.0) + ) + ) + (compute-transv-at-time (-> this traj) 0.0 (-> this root transv)) + (set! (-> this pre-move-transv quad) (-> this root transv quad)) + (vector-normalize-copy! (-> this starting-dir) (-> this root transv) 1.0) + (vector+float*! (-> this base-target-pos) (-> this root trans) (-> this starting-dir) 2048000.0) + (set! (-> this target-pos quad) (-> this base-target-pos quad)) + (set! (-> this impact-played) #f) + (set! (-> this reticle-sound) (new-sound-id)) + (sound-play "reticle-lock" :id (-> this reticle-sound) :position (-> this shot-dest)) + (set! (-> this reticle-sound-playing) #t) + 0 + (none) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod play-impact-sound ((this factory-boss-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + ) + ((= v1-0 (projectile-options po0)) + ) + ((= v1-0 (projectile-options po0 po1)) + ) + ) + ) + (none) + ) + +(defstate moving (factory-boss-shot) + :virtual #t + :trans (behavior () + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (cond + ((time-elapsed? (-> self traj-time) (the int (-> self traj time))) + (go-virtual impact) + ) + ((and (not (-> self impact-played)) + (time-elapsed? (+ (-> self traj-time) (seconds -0.5)) (the int (-> self traj time))) + ) + (sound-play "erol-proj-incom" :position (-> self root trans)) + (set! (-> self impact-played) #t) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self traj-time)))) + gp-1 + ) + (vector-! (-> self pre-move-transv) gp-1 (-> self root trans)) + (let ((v1-22 (-> self pre-move-transv))) + (.lvf vf1 (&-> (-> self pre-move-transv) quad)) + (let ((f0-6 (-> self clock frames-per-second))) + (.mov at-0 f0-6) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-22 quad) vf1) + ) + (set! (-> self root transv quad) (-> self pre-move-transv quad)) + (if (< 2191360.0 (-> gp-1 y)) + (integrate-and-collide! (-> self root) (-> self root transv)) + (projectile-move-fill-line-sphere self) + ) + ) + (if (logtest? (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + no-touch + blocked + on-water + impact-surface + touch-background + stuck + touch-ceiling-sticky + glance + probe-hit + ) + (-> self root status) + ) + (go-impact! self) + ) + (cond + ((type? self factory-boss-floorbuster-bomb) + (send-event (ppointer->process (-> self parent)) 'draw-reticle (-> self shot-dest) (-> self traj) 1) + ) + ((type? self factory-boss-shockwave-bomb) + (send-event (ppointer->process (-> self parent)) 'draw-reticle (-> self shot-dest) (-> self traj) 2) + ) + (else + (send-event (ppointer->process (-> self parent)) 'draw-reticle (-> self shot-dest) (-> self traj) 0) + ) + ) + ) + ) + ) + +(defstate impact (factory-boss-shot) + :virtual #t + :enter (behavior () + (stop-reticle-sound self) + (sound-play "erol-proj-expl" :position (-> self root trans)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1360)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (ppointer->process (-> self parent))) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 10)) (not (-> self child))) + (deactivate self) + (go empty-state) + ) + ) + :code sleep-code + ) + +(deftype factory-boss-shockwave-bomb (factory-boss-shot) + () + ) + + +(deftype shockwave-bomb-explosion (explosion) + () + ) + + +(defstate impact (factory-boss-shockwave-bomb) + :virtual #t + :enter (behavior () + (local-vars (sv-272 entity-actor)) + (stop-reticle-sound self) + (sound-play "erol-proj-expls" :position (-> self root trans)) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1360)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn-legacy-version (ppointer->process (-> self parent)) shockwave-bomb-explosion gp-1) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> self root trans quad)) + (let ((gp-2 (new 'stack-no-clear 'quaternion))) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (+! (-> s5-1 y) 409.6) + (quaternion-set! gp-2 0.0 0.0 0.0 1.0) + (matrix-identity! s4-0) + (set! (-> s4-0 trans quad) (-> s5-1 quad)) + ) + (let* ((s3-0 (get-process *default-dead-pool* manipy #x20000 1)) + (s4-1 (when s3-0 + (let ((t9-9 (method-of-type manipy activate))) + (t9-9 (the-as manipy s3-0) self "manipy" (the-as pointer #x70004000)) + ) + (let ((s4-2 run-function-in-process) + (s2-0 s3-0) + (s1-0 manipy-init) + (s0-0 s5-1) + ) + (set! sv-272 (-> self entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer level) #f))) + (t1-1 #f) + (t2-1 0) + ) + ((the-as (function object object object object object object object none) s4-2) + s2-0 + s1-0 + s0-0 + sv-272 + t0-2 + t1-1 + t2-1 + ) + ) + ) + (-> s3-0 ppointer) + ) + ) + ) + (when s4-1 + (send-event (ppointer->process s4-1) 'rot-quat gp-2) + (send-event (ppointer->process s4-1) 'anim-mode 'play1) + (send-event (ppointer->process s4-1) 'anim "idle") + (set-vector! (-> (the-as (pointer manipy) s4-1) 0 root scale) 1.0 1.0 1.0 1.0) + (let ((v1-60 (lambda :behavior manipy + () + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (cond + ((>= 10.0 (ja-aframe-num 0)) + (let ((v0-1 (the-as vector (-> self draw color-emissive)))) + (set! (-> (the-as rgbaf v0-1) x) 1.0) + (set! (-> (the-as rgbaf v0-1) y) 1.0) + (set! (-> (the-as rgbaf v0-1) z) 1.0) + (set! (-> (the-as rgbaf v0-1) w) 1.0) + v0-1 + ) + ) + ((>= 20.0 (ja-aframe-num 0)) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 10.0 20.0) + ) + ) + (else + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (new 'static 'vector :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 20.0 30.0) + ) + ) + ) + ) + ) + ) + (send-event (ppointer->process s4-1) 'trans-hook v1-60) + ) + ) + ) + (let ((s4-3 (process-spawn + manipy + :init manipy-init + s5-1 + (-> 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 s4-3 + (send-event (ppointer->process s4-3) 'rot-quat gp-2) + (send-event (ppointer->process s4-3) 'anim-mode 'play1) + (send-event (ppointer->process s4-3) 'anim "idle") + (set-vector! (-> (the-as (pointer manipy) s4-3) 0 root scale) 1.0 1.0 1.0 1.0) + ) + ) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type factory-boss-shot impact) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((f30-1 (* 2048.0 (pow (the float (- (current-time) (-> self state-time))) 0.85))) + (f28-1 (* 2048.0 (pow (the float (+ (- (seconds -0.05) (-> self state-time)) (current-time))) 0.85))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self root trans quad)) + (+! (-> s5-0 y) 409.6) + (when *target* + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s5-0)) + (v1-16 gp-1) + (f0-12 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) + ) + (if (and (< f0-12 (+ 4096.0 f30-1)) (< (+ -4096.0 f28-1) f0-12) (< (-> gp-1 y) 1638.4) (< -8192.0 (-> gp-1 y))) + (deal-damage! self *target* (the-as event-message-block #f)) + ) + ) + ) + ) + ) + ) + +(deftype factory-boss-floorbuster-bomb (factory-boss-shot) + ((targetted-group int8) + ) + ) + + +(deftype floorbuster-bomb-explosion (explosion) + ((targetted-group int8) + ) + ) + + +(defstate impact (factory-boss-floorbuster-bomb) + :virtual #t + :enter (behavior () + (stop-reticle-sound self) + (sound-play "erol-proj-expl" :position (-> self root trans)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1360)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (let ((v1-22 + (ppointer->process + (explosion-spawn-legacy-version (ppointer->process (-> self parent)) floorbuster-bomb-explosion gp-1) + ) + ) + ) + (if v1-22 + (set! (-> (the-as floorbuster-bomb-explosion v1-22) targetted-group) (-> self targetted-group)) + ) + ) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 10)) (not (-> self child))) + (deactivate self) + (go empty-state) + ) + ) + :code sleep-code + ) + +(defskelgroup skel-fac-drop-plat fac-drop-plat fac-drop-plat-lod0-jg fac-drop-plat-idle-ja + ((fac-drop-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(deftype fac-drop-plat-nocollide (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (fac-drop-plat-nocollide) + :virtual #t + :enter (behavior () + (ja-post) + ) + :trans (behavior () + (if (< (vector-vector-distance (-> self draw origin) (math-camera-pos)) (-> self draw origin w)) + (logclear! (-> self draw status) (draw-control-status force-vu1)) + (logior! (-> self draw status) (draw-control-status force-vu1)) + ) + ) + :code sleep-code + ) + +(defbehavior fac-drop-plat-nocollide-init-by-other fac-drop-plat-nocollide ((arg0 entity-actor)) + (stack-size-set! (-> self main-thread) 16) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (set! (-> self level) (level-get *level* 'factoryd)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-drop-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 17)) + (set! (-> self entity) arg0) + (logclear! (-> self mask) (process-mask enemy)) + (go-virtual idle) + ) + +(deftype fac-drop-plat (process-drawable) + ((root collide-shape :override) + (x-rotation-speed float) + (y-rotation-speed float) + (boss entity-actor) + ) + (:state-methods + idle + fall-away + done-falling + ) + ) + + +(defstate idle (fac-drop-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((gp-0 -1)) + (cond + ((type? proc factory-boss-floorbuster-bomb) + (set! gp-0 (-> (the-as factory-boss-floorbuster-bomb proc) targetted-group)) + ) + ((type? proc floorbuster-bomb-explosion) + (set! gp-0 (-> (the-as floorbuster-bomb-explosion proc) targetted-group)) + ) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'fall?) + (set! (-> a1-3 param 0) (the-as uint (-> self entity))) + (set! (-> a1-3 param 1) (the-as uint gp-0)) + (let ((t9-2 send-event-function) + (v1-9 (-> self boss)) + ) + (when (t9-2 + (if v1-9 + (-> v1-9 extra process) + ) + a1-3 + ) + (sound-play "break-grate" :position (-> self root trans)) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual fall-away) + ) + ) + ) + ) + ) + (('fall!) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual fall-away) + ) + ) + ) + :enter (behavior () + (transform-post) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch float vs object. +(defbehavior fac-drop-plat-setup-rots fac-drop-plat () + (set! (-> self x-rotation-speed) (rand-vu-float-range 546.13336 3094.7556)) + (if (< 1820.4445 (-> self x-rotation-speed)) + (+! (-> self x-rotation-speed) -3640.889) + ) + (set! (-> self y-rotation-speed) (rand-vu-float-range 546.13336 3094.7556)) + (if (< 1820.4445 (-> self y-rotation-speed)) + (set! (-> self y-rotation-speed) (+ -3640.889 (-> self y-rotation-speed))) + ) + ) + +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch quaternion vs object. +(defbehavior fac-drop-plat-rot-once fac-drop-plat ((arg0 degrees)) + (local-vars (sv-48 float) (sv-64 float)) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((s3-0 quaternion-set!) + (s2-0 gp-0) + (s1-0 (sin (* arg0 (-> self x-rotation-speed)))) + (s0-0 0.0) + ) + (set! sv-48 (the-as float 0.0)) + (let ((t0-0 (cos (* arg0 (-> self x-rotation-speed))))) + (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) + ) + ) + (let ((s3-1 quaternion-set!) + (s2-1 s5-0) + (s1-1 0.0) + (s0-1 (sin (* arg0 (-> self y-rotation-speed)))) + ) + (set! sv-64 (the-as float 0.0)) + (let ((t0-1 (cos (* arg0 (-> self y-rotation-speed))))) + (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) + ) + ) + (quaternion-normalize! (quaternion*! gp-0 gp-0 s5-0)) + ) + (quaternion-normalize! (quaternion*! (-> self root quat) gp-0 (-> self root quat))) + ) + ) + +(defstate fall-away (fac-drop-plat) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (fac-drop-plat-setup-rots) + (fac-drop-plat-rot-once (the-as degrees #x3f800000)) + (fac-drop-plat-setup-rots) + (set-time! (-> self state-time)) + (set! (-> self x-rotation-speed) (rand-vu-float-range 546.13336 1820.4445)) + (set! (-> self y-rotation-speed) (rand-vu-float-range 546.13336 1820.4445)) + (logclear! (-> self mask) (process-mask actor-pause)) + (if (-> self entity) + (toggle-status (-> self entity) (entity-perm-status subtask-complete) #t) + ) + ) + :code sleep-code + :post (behavior () + (if (time-elapsed? (-> self state-time) (seconds 2.5)) + (go-virtual done-falling) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (let ((f0-2 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 150.0 300.0))) + (set! (-> self root trans y) (- (-> self root trans y) (* 2048.0 f0-2))) + (fac-drop-plat-rot-once f0-2) + ) + (vector-float*! (-> self root scale) (-> self root scale) 0.98) + ) + (transform-post) + ) + ) + +(defstate done-falling (fac-drop-plat) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + (logior! (-> self mask) (process-mask actor-pause)) + ) + :code sleep-code + ) + +(defmethod deactivate ((this fac-drop-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this fac-drop-plat) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (with-pp + (stack-size-set! (-> this main-thread) 32) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle impenetrable-obj)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak bot enemy hit-by-others-list player-list projectile)) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 transform-index) 3) + (set-vector! (-> v1-4 local-sphere) 0.4096 0.0 -0.4096 12460.032) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-7 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (set! (-> pp level) (level-get *level* 'factoryd)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-drop-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 17)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count)) (nonzero? (-> v1-16 0 length))) + (set! (-> this boss) (-> v1-16 0 data 0 actor)) + ) + (else + (format 0 "ERROR: ~S: entity missing actor-group!~%" (-> this name)) + (set! (-> this boss) #f) + ) + ) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done-falling)) + (go (method-of-object this idle)) + ) + ) + ) + +;; WARN: Return type mismatch entity-actor vs object. +(defbehavior fac-drop-plat-init-by-other fac-drop-plat ((arg0 entity-actor)) + (init-from-entity! self arg0) + (set! (-> self entity) arg0) + arg0 + ) + +(defskelgroup skel-factory-boss errol-lowres errol-lowres-lod0-jg errol-lowres-idle30-ja + ((errol-lowres-lod0-mg (meters 20)) (errol-lowres-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(deftype factory-boss-critter-tracker (structure) + ((handle handle) + (flags facboss-critter-tracker-flag) + (dest vector :inline) + ) + ) + + +(deftype factory-boss-machine-state (structure) + ((damaged-low-smoke-part sparticle-launch-control) + (damaged-high-smoke-part sparticle-launch-control) + (damaged-left-spark-part sparticle-launch-control) + (damaged-right-spark-part sparticle-launch-control) + (ring-part sparticle-launch-control) + (lightning lightning-control) + (machine-sound sound-id) + (state int8) + (flags facboss-machine-state-flag) + (left-spark-timer time-frame) + (right-spark-timer time-frame) + (ring-timer time-frame) + ) + ) + + +(deftype factory-boss-lightning-gate (structure) + ((center vector :inline) + (x-off float) + (z-off float) + (blocking-plane handle) + (lightning lightning-control 4) + ) + (:methods + (init! (_type_ int) none) + (disable (_type_) none) + (factory-boss-lightning-gate-method-11 (_type_ vector float float process) none) + ) + ) + + +(defmethod init! ((this factory-boss-lightning-gate) (arg0 int)) + (set-factoryd-light! 1.0) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (a0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> this center quad)) + (+! (-> v1-0 x) (-> this x-off)) + (+! (-> v1-0 z) (-> this z-off)) + (+! (-> v1-0 y) 9175.04) + (set! (-> a0-2 quad) (-> this center quad)) + (set! (-> a0-2 x) (- (-> a0-2 x) (-> this x-off))) + (set! (-> a0-2 z) (- (-> a0-2 z) (-> this z-off))) + (+! (-> a0-2 y) 9011.2) + (dotimes (a1-5 4) + (let ((a2-7 (-> this lightning a1-5 state mode))) + (when (or (zero? a2-7) (= a2-7 3)) + (let ((a3-2 (-> this lightning a1-5)) + (a2-11 v1-0) + ) + (set! (-> a3-2 state meet data 0 quad) (-> a2-11 quad)) + ) + (let ((a3-5 (-> this lightning a1-5)) + (a2-15 a0-2) + ) + (set! (-> a3-5 state meet data (+ (-> a3-5 state points-to-draw) -1) quad) (-> a2-15 quad)) + ) + (let ((a2-19 (-> this lightning a1-5)) + (a3-8 1) + ) + (let ((t0-5 (!= a3-8 (-> a2-19 state mode)))) + (case a3-8 + ((3) + (if t0-5 + (set! (-> a2-19 state counter) 0.0) + ) + ) + ((1) + (set! (-> a2-19 state start-color) (-> a2-19 spec start-color)) + (set! (-> a2-19 state end-color) (-> a2-19 spec end-color)) + ) + ) + ) + (set! (-> a2-19 state mode) (the-as uint a3-8)) + ) + ) + ) + (+! (-> v1-0 y) 9830.4) + (+! (-> a0-2 y) 9830.4) + ) + ) + (let ((s4-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (set! (-> s4-0 0 quad) (-> this center quad)) + (+! (-> s4-0 0 x) (-> this x-off)) + (+! (-> s4-0 0 z) (-> this z-off)) + (set! (-> s4-0 1 quad) (-> s4-0 0 quad)) + (set! (-> s4-0 1 x) (- (-> s4-0 1 x) (* 2.0 (-> this x-off)))) + (set! (-> s4-0 1 z) (- (-> s4-0 1 z) (* 2.0 (-> this z-off)))) + (when (not (handle->process (-> this blocking-plane))) + (set! (-> this blocking-plane) + (ppointer->handle + (process-spawn blocking-plane s4-0 45056.0 :name "blocking-plane" :to (the-as process-tree arg0)) + ) + ) + (send-event (handle->process (-> this blocking-plane)) 'collide-as #x4000000) + (send-event (handle->process (-> this blocking-plane)) 'attack-mode 'shock) + ) + ) + 0 + (none) + ) + +(defmethod disable ((this factory-boss-lightning-gate)) + (set-factoryd-light! 0.0) + (dotimes (s5-0 4) + (let ((v1-3 (-> this lightning s5-0 state mode))) + (cond + ((or (zero? v1-3) (= v1-3 3)) + ) + (else + (let ((v1-7 (-> this lightning s5-0)) + (a0-4 3) + ) + (let ((a1-1 (!= a0-4 (-> v1-7 state mode)))) + (case a0-4 + ((3) + (if a1-1 + (set! (-> v1-7 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-7 state start-color) (-> v1-7 spec start-color)) + (set! (-> v1-7 state end-color) (-> v1-7 spec end-color)) + ) + ) + ) + (set! (-> v1-7 state mode) (the-as uint a0-4)) + ) + ) + ) + ) + (let ((a0-6 (handle->process (-> this blocking-plane)))) + (if a0-6 + (deactivate a0-6) + ) + ) + ) + 0 + (none) + ) + +(defmethod factory-boss-lightning-gate-method-11 ((this factory-boss-lightning-gate) (arg0 vector) (arg1 float) (arg2 float) (arg3 process)) + (set-factoryd-light! 0.0) + (set! (-> this center quad) (-> arg0 quad)) + (set! (-> this x-off) arg1) + (set! (-> this z-off) arg2) + (set! (-> this blocking-plane) (the-as handle #f)) + (dotimes (s4-1 4) + (set! (-> this lightning s4-1) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration -1.0 + :sound #f + ) + arg3 + 0.0 + ) + ) + (let ((v1-6 (-> this lightning s4-1)) + (a0-4 0) + ) + (let ((a1-3 (!= a0-4 (-> v1-6 state mode)))) + (case a0-4 + ((3) + (if a1-3 + (set! (-> v1-6 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-6 state start-color) (-> v1-6 spec start-color)) + (set! (-> v1-6 state end-color) (-> v1-6 spec end-color)) + ) + ) + ) + (set! (-> v1-6 state mode) (the-as uint a0-4)) + ) + ) + 0 + (none) + ) + +(defmethod relocate ((this factory-boss-lightning-gate) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) offset) + ) + ) + (call-parent-method this offset) + ) + +(deftype factory-boss (process-drawable) + ((child (pointer process-drawable) :override) + (self factory-boss :override) + (center vector :inline) + (shot-timer time-frame) + (critter factory-boss-critter-tracker 8 :inline) + (ammo handle 10) + (catwalk-angle float) + (catwalk-vel float) + (bombs-to-drop int8) + (bomb-type facboss-bomb-type) + (root-angle float) + (machine-state factory-boss-machine-state 4 :inline) + (chosen-machine int8) + (command-index int8) + (command-timer time-frame) + (current-round int32) + (hits-taken int8) + (camera-timer time-frame) + (reticle-info factory-boss-reticle-info :inline) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (launching-group sparticle-launch-group) + (floor-targets int8 7) + (num-floor-targets int8) + (reticle-sound sound-id) + (reticle-sound-playing symbol) + (warp-blocker factory-boss-lightning-gate :inline) + (entry-blocker factory-boss-lightning-gate :inline) + ) + (:state-methods + beaten + run-to-machine + get-hit + launch-critters + drop-bombs + hidden + ) + (:methods + (factory-boss-method-26 (_type_ int vector vector symbol) symbol) + (factory-boss-method-27 (_type_ vector) symbol) + (next-catwalk-angle (_type_ int) float) + (factory-boss-method-29 (_type_ float vector) none) + (factory-boss-method-30 (_type_) none) + ) + ) + + +(defmethod factory-boss-method-30 ((this factory-boss)) + (when (-> this reticle-sound-playing) + (sound-stop (-> this reticle-sound)) + (set! (-> this reticle-sound-playing) #f) + ) + 0 + (none) + ) + +(defmethod factory-boss-method-27 ((this factory-boss) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 quad)) + (set! (-> v1-0 w) 16384.0) + (add-root-sphere-to-hash! (-> this nav) v1-0 255) + ) + ) + +(defmethod factory-boss-method-26 ((this factory-boss) (arg0 int) (arg1 vector) (arg2 vector) (arg3 symbol)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (when arg3 + (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + (f0-2 (+ -1.0 (the-as float v1-3))) + ) + (cond + ((< f0-2 0.25) + (+! arg0 -1) + ) + ((< f0-2 0.5) + (+! arg0 1) + ) + ) + ) + (if (>= arg0 4) + (+! arg0 -4) + ) + (if (< arg0 0) + (+! arg0 4) + ) + ) + (cond + ((zero? arg0) + (set-vector! s3-0 1.0 0.0 1.0 1.0) + (set-vector! s4-0 -1.0 0.0 1.0 1.0) + ) + ((= arg0 1) + (set-vector! s3-0 1.0 0.0 -1.0 1.0) + (set-vector! s4-0 1.0 0.0 1.0 1.0) + ) + ((= arg0 2) + (set-vector! s3-0 -1.0 0.0 -1.0 1.0) + (set-vector! s4-0 1.0 0.0 -1.0 1.0) + ) + (else + (set-vector! s3-0 -1.0 0.0 1.0 1.0) + (set-vector! s4-0 -1.0 0.0 -1.0 1.0) + ) + ) + (vector+float*! arg1 (-> this center) s3-0 98304.0) + (+! (-> arg1 y) 4096.0) + (if (factory-boss-method-27 this arg1) + (return #f) + ) + (vector+float*! arg2 (-> this center) s3-0 73728.0) + ) + (+! (-> arg2 y) 1679.36) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 16384.0) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 -32768.0) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 49152.0) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 -65536.0) + ) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + #f + ) + +(defmethod relocate ((this factory-boss) (offset int)) + (relocate (-> this reticle-info) offset) + (relocate (-> this warp-blocker) offset) + (relocate (-> this entry-blocker) offset) + (dotimes (v1-6 4) + (let ((a0-6 (-> this machine-state v1-6))) + (if (nonzero? (-> a0-6 damaged-low-smoke-part)) + (&+! (-> a0-6 damaged-low-smoke-part) offset) + ) + (if (nonzero? (-> a0-6 damaged-high-smoke-part)) + (&+! (-> a0-6 damaged-high-smoke-part) offset) + ) + (if (nonzero? (-> a0-6 damaged-left-spark-part)) + (&+! (-> a0-6 damaged-left-spark-part) offset) + ) + (if (nonzero? (-> a0-6 damaged-right-spark-part)) + (&+! (-> a0-6 damaged-right-spark-part) offset) + ) + (if (nonzero? (-> a0-6 ring-part)) + (&+! (-> a0-6 ring-part) offset) + ) + (if (nonzero? (-> a0-6 lightning)) + (&+! (-> a0-6 lightning) offset) + ) + ) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this factory-boss)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (factory-boss-reticle-info-method-11 (-> this reticle-info)) + (factory-boss-method-30 this) + (dotimes (s5-0 4) + (let ((s4-0 (-> this machine-state s5-0))) + (if (nonzero? (-> s4-0 damaged-low-smoke-part)) + (kill-particles (-> s4-0 damaged-low-smoke-part)) + ) + (if (nonzero? (-> s4-0 damaged-high-smoke-part)) + (kill-particles (-> s4-0 damaged-high-smoke-part)) + ) + (if (nonzero? (-> s4-0 damaged-left-spark-part)) + (kill-particles (-> s4-0 damaged-left-spark-part)) + ) + (if (nonzero? (-> s4-0 damaged-right-spark-part)) + (kill-particles (-> s4-0 damaged-right-spark-part)) + ) + (if (nonzero? (-> s4-0 ring-part)) + (kill-particles (-> s4-0 ring-part)) + ) + (when (logtest? (-> s4-0 flags) (facboss-machine-state-flag fms0)) + (sound-stop (-> s4-0 machine-sound)) + (logclear! (-> s4-0 flags) (facboss-machine-state-flag fms0)) + ) + ) + ) + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this factory-boss) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 4096.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-factory-boss" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this skel status) (joint-control-status eye-anim)) + (logior! (-> this mask) (process-mask enemy)) + (set-vector! (-> this root scale) 1.6 1.6 1.6 1.0) + (set! (-> this center quad) (-> this root trans quad)) + (+! (-> this center z) 83992.98) + (+! (-> this center y) -65536.0) + (+! (-> this center x) -83992.98) + (+! (-> this root trans y) -6492.16) + (dotimes (v1-24 8) + (set! (-> this critter v1-24 handle) (the-as handle #f)) + ) + (dotimes (v1-27 10) + (set! (-> this ammo v1-27) (the-as handle #f)) + ) + (init! (-> this reticle-info) this) + (dotimes (s4-2 4) + (let ((s3-1 (-> this machine-state s4-2))) + (set! (-> s3-1 state) 0) + (set! (-> s3-1 damaged-low-smoke-part) (create-launch-control (-> *part-group-id-table* 1362) this)) + (set! (-> s3-1 damaged-high-smoke-part) (create-launch-control (-> *part-group-id-table* 1361) this)) + (set! (-> s3-1 damaged-left-spark-part) (create-launch-control (-> *part-group-id-table* 1378) this)) + (set! (-> s3-1 damaged-right-spark-part) (create-launch-control (-> *part-group-id-table* 1378) this)) + (set! (-> s3-1 machine-sound) (new-sound-id)) + (set! (-> s3-1 flags) (facboss-machine-state-flag fms1)) + (set! (-> s3-1 left-spark-timer) 0) + (set! (-> s3-1 right-spark-timer) 0) + (set! (-> s3-1 ring-timer) 0) + (let ((v1-47 s4-2)) + (cond + ((zero? v1-47) + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1363) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + ((= v1-47 1) + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1364) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + ((= v1-47 2) + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1365) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3b :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + (else + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1366) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #xff :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + ) + ) + (let ((v1-68 (-> s3-1 lightning)) + (a0-41 0) + ) + (let ((a1-21 (!= a0-41 (-> v1-68 state mode)))) + (case a0-41 + ((3) + (if a1-21 + (set! (-> v1-68 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-68 state start-color) (-> v1-68 spec start-color)) + (set! (-> v1-68 state end-color) (-> v1-68 spec end-color)) + ) + ) + ) + (set! (-> v1-68 state mode) (the-as uint a0-41)) + ) + ) + ) + (set! (-> this chosen-machine) 0) + (let ((a0-43 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) + (if a0-43 + (change-to a0-43 this) + ) + ) + (set! (-> this catwalk-angle) 0.0) + (set! (-> this catwalk-vel) 0.0) + (set! (-> this bombs-to-drop) 0) + (set! (-> this root-angle) (+ 32768.0 (-> this catwalk-angle))) + (set! (-> this hits-taken) 0) + (set! (-> this camera-timer) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-76 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-76 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-76)) + ) + (else + (format 0 "ERROR: ~S: entity missing actor-groups!~%" (-> this name)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this num-floor-targets) 0) + (when (> (-> this actor-group-count) 0) + (let ((s5-1 (-> this actor-group (+ (-> this actor-group-count) -1)))) + (dotimes (s4-3 (-> s5-1 length)) + (process-spawn + fac-drop-plat-nocollide + (-> s5-1 data s4-3 actor) + :name "fac-drop-plat-nocollide" + :from *factory-boss-dead-pool* + :to this + ) + ) + ) + ) + (set! (-> this reticle-sound) (new-sound-id)) + (set! (-> this reticle-sound-playing) #f) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> this center quad)) + (+! (-> s5-2 z) 141312.0) + (factory-boss-lightning-gate-method-11 (-> this warp-blocker) s5-2 28672.0 0.0 this) + (set! (-> s5-2 quad) (-> this center quad)) + (+! (-> s5-2 z) -141312.0) + (factory-boss-lightning-gate-method-11 (-> this entry-blocker) s5-2 28672.0 0.0 this) + ) + (set! (-> this draw force-lod) 1) + (go (method-of-object this hidden)) + ) + +(deftype hud-factory-boss (hud) + () + ) + + +(defmethod draw ((this hud-factory-boss)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 130.0 (-> this offset)))) + 160 + ) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 0) + (let ((f30-0 (* 25.0 (the float (- 4 (-> this values 0 current)))))) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) 8 67) + (set! (-> this sprites 5 scale-x) (* 0.164 f30-0)) + (cond + ((< 50.0 f30-0) + (set! (-> this sprites 5 color x) (the int (lerp-scale 0.0 128.0 f30-0 100.0 50.0))) + (set! (-> this sprites 5 color y) (the int (lerp-scale 255.0 128.0 f30-0 100.0 50.0))) + (set! (-> this sprites 5 color z) 0) + 0 + ) + ((< 20.0 f30-0) + (set! (-> this sprites 5 color x) (the int (lerp-scale 128.0 255.0 f30-0 50.0 20.0))) + (set! (-> this sprites 5 color y) (the int (lerp-scale 128.0 0.0 f30-0 50.0 20.0))) + (set! (-> this sprites 5 color z) 0) + 0 + ) + (else + (set! (-> this sprites 5 color x) 255) + (set! (-> this sprites 5 color y) 0) + (set! (-> this sprites 5 color z) 0) + 0 + ) + ) + ) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 9 66) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -51 66) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 4 66) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-factory-boss)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-factory-boss)) + (set! (-> this level) (level-get *level* 'factoryd)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xab0))) + ) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xab0))) + ) + (set! (-> this sprites 1 scale-x) 1.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 5 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xab0))) + ) + (set! (-> this sprites 5 scale-x) 1.0) + (set! (-> this sprites 5 scale-y) 1.3) + (set! (-> this sprites 5 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 4 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xab0))) + ) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 1.0) + (set! (-> this sprites 4 flags) (hud-sprite-flags hsf0 hsf2)) + (set! (-> this sprites 3 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xab0))) + ) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 2 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xab0))) + ) + (set! (-> this sprites 2 scale-x) 14.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set! (-> this sprites 2 flags) (hud-sprite-flags hsf2)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags shadow kerning right large)) + 0 + (none) + ) + +(deftype task-manager-factory-boss (task-manager) + ((button-up symbol) + ) + (:methods + (task-manager-factory-boss-method-32 (_type_) none) + ) + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-factory-boss)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (if (>= (-> *game-info* counter) 3.0) + (set-setting! 'extra-bank '((factory7 factor10)) 0.0 0) + (remove-setting! 'extra-bank) + ) + (if (>= (-> *game-info* counter) 3.0) + (script-eval '(want-anim "factory-boss-res")) + ) + (if (= (-> *game-info* counter) 4.0) + (send-event this 'complete) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-factory-boss)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-factory-boss)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-factory-boss :init hud-init-by-other :name "hud-factory-boss" :to this)) + ) + (set! (-> *game-info* counter) 0.0) + (set! (-> this button-up) #f) + (set-setting! 'string-min-height 'abs (meters 1) 0) + (set-setting! 'string-max-height 'abs (meters 1.5) 0) + (set-setting! 'fov 'abs (degrees 80.0) 0) + (set-setting! 'music 'factboss 0.0 0) + (none) + ) + +(defun factoryd-login ((arg0 level)) + (set! *factory-boss-dead-pool* (new 'loading-level 'dead-pool 222 1560 "*factory-boss-dead-pool*")) + (set! (-> *factory-boss-dead-pool* clock) (-> *display* entity-clock)) + (set! *nav-network* (new 'loading-level 'nav-network)) + (alloc-nav-network-for-level! *nav-network* 64 10) + (none) + ) + +(defun factoryd-logout ((arg0 level)) + (set! *factory-boss-dead-pool* #f) + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +(defskelgroup skel-fac-warp-effect fac-warp-effect fac-warp-effect-lod0-jg fac-warp-effect-idle-ja + ((fac-warp-effect-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(deftype fac-warp-effect (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defstate idle (fac-warp-effect) + :virtual #t + :code sleep-code + :post (behavior () + (ja :num! (loop!)) + (ja-post) + ) + ) + +(defmethod init-from-entity! ((this fac-warp-effect) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-warp-effect" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/factory/factory-boss-states.gc b/goal_src/jak3/levels/factory/factory-boss-states.gc index 85098398a8..745bbd4c4c 100644 --- a/goal_src/jak3/levels/factory/factory-boss-states.gc +++ b/goal_src/jak3/levels/factory/factory-boss-states.gc @@ -5,5 +5,1830 @@ ;; name in dgo: factory-boss-states ;; dgos: FACD +;; +++facboss-cmd +(defenum facboss-cmd + :type uint64 + (cmd1 1) + (cmd2 2) + (cmd3 3) + (cmd4 4) + (cmd5 5) + (cmd6 6) + (cmd7 7) + (cmd8 8) + (cmd9 9) + (cmd10 10) + (cmd11 11) + (cmd12 12) + (cmd13 13) + (cmd14 14) + (cmd15 15) + (cmd16 16) + (cmd17 17) + (cmd18 18) + (cmd19 19) + (cmd20 20) + (cmd21 21) + ) +;; ---facboss-cmd + + ;; DECOMP BEGINS +;; WARN: Return type mismatch float vs degrees. +(defbehavior factory-boss-angle-sub factory-boss ((arg0 degrees) (arg1 degrees)) + (let* ((v1-1 (+ 65536.0 arg0)) + (v1-4 (- v1-1 (* (the float (the int (/ v1-1 65536.0))) 65536.0))) + (a0-2 (+ 65536.0 arg1)) + (a0-5 (- a0-2 (* (the float (the int (/ a0-2 65536.0))) 65536.0))) + (v0-0 (- v1-4 a0-5)) + ) + (cond + ((>= -32768.0 v0-0) + (set! v0-0 (+ 65536.0 v0-0)) + ) + ((< 32768.0 v0-0) + (set! v0-0 (+ -65536.0 v0-0)) + ) + ) + (the-as degrees v0-0) + ) + ) + +(defbehavior factory-boss-target-pos factory-boss ((arg0 vector) (arg1 int) (arg2 int)) + (set! (-> arg0 quad) (-> (target-pos 0) quad)) + (set! (-> arg0 y) (-> self center y)) + (when (= arg1 1) + (let ((a0-3 (- (the-as int (- (current-time) (-> self shot-timer))))) + (v1-7 (vector-reset! (new 'stack-no-clear 'vector))) + ) + (let ((a1-3 (-> self actor-group (-> self floor-targets arg2)))) + (dotimes (a2-4 (-> a1-3 length)) + (vector+! v1-7 v1-7 (-> a1-3 data a2-4 actor extra trans)) + ) + (vector-float*! v1-7 v1-7 (/ 1.0 (the float (-> a1-3 length)))) + ) + (set! (-> v1-7 y) (-> self center y)) + (vector-! arg0 arg0 v1-7) + (vector+float*! arg0 v1-7 arg0 (fmax 0.0 (fmin 1.0 (* 0.008888889 (the float a0-3))))) + ) + ) + arg0 + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod factory-boss-method-29 ((this factory-boss) (arg0 float) (arg1 vector)) + (set! (-> arg1 x) (+ (-> this center x) (* 118784.0 (sin arg0)))) + (set! (-> arg1 y) (-> this root trans y)) + (set! (-> arg1 z) (+ (-> this center z) (* 118784.0 (cos arg0)))) + (none) + ) + +;; WARN: Return type mismatch quaternion vs none. +(defbehavior factory-boss-move factory-boss () + (+! (-> self catwalk-angle) (* (-> self catwalk-vel) (-> self clock time-adjust-ratio))) + (cond + ((>= (-> self catwalk-angle) 65536.0) + (+! (-> self catwalk-angle) -65536.0) + (+! (-> self root-angle) -65536.0) + ) + ((< (-> self catwalk-angle) 0.0) + (+! (-> self catwalk-angle) 65536.0) + (+! (-> self root-angle) 65536.0) + ) + ) + (factory-boss-method-29 self (-> self catwalk-angle) (-> self root trans)) + (cond + ((< (-> self catwalk-vel) 0.0) + (seek! + (-> self root-angle) + (+ 48969.957 (-> self catwalk-angle)) + (* 1820.4445 (-> self clock time-adjust-ratio)) + ) + ) + ((< 0.0 (-> self catwalk-vel)) + (seek! + (-> self root-angle) + (+ 16566.045 (-> self catwalk-angle)) + (* 1820.4445 (-> self clock time-adjust-ratio)) + ) + ) + (else + (seek! + (-> self root-angle) + (+ 32768.0 (-> self catwalk-angle)) + (* 1820.4445 (-> self clock time-adjust-ratio)) + ) + ) + ) + (quaternion-set! + (-> self root quat) + 0.0 + (sin (* 0.5 (-> self root-angle))) + 0.0 + (cos (* 0.5 (-> self root-angle))) + ) + (none) + ) + +;; WARN: Function factory-boss-pick-machine has a return type of none, but the expression builder found a return statement. +(defbehavior factory-boss-pick-machine factory-boss () + (let ((gp-0 10000) + (a0-0 0) + ) + (dotimes (v1-0 4) + (cond + ((< (-> self machine-state v1-0 state) gp-0) + (set! gp-0 (-> self machine-state v1-0 state)) + (set! a0-0 1) + ) + ((= (-> self machine-state v1-0 state) gp-0) + (+! a0-0 1) + ) + ) + ) + (let ((v1-3 (rand-vu-int-count a0-0))) + (dotimes (a0-3 4) + (when (>= gp-0 (-> self machine-state a0-3 state)) + (when (<= v1-3 0) + (set! (-> self chosen-machine) a0-3) + (return 0) + ) + (+! v1-3 -1) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defbehavior factory-boss-pick-camera factory-boss () + (let ((v1-0 (-> self chosen-machine))) + (cond + ((zero? v1-0) + (set-setting! 'entity-name "camera-385" 0.0 0) + ) + ((= v1-0 1) + (set-setting! 'entity-name "camera-384" 0.0 0) + ) + ((= v1-0 2) + (set-setting! 'entity-name "camera-387" 0.0 0) + ) + ((= v1-0 3) + (set-setting! 'entity-name "camera-386" 0.0 0) + ) + ) + ) + (none) + ) + +(defbehavior factory-boss-pick-pers-camera factory-boss () + (let ((v1-0 (-> self chosen-machine))) + (cond + ((zero? v1-0) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-385") + 0.0 + 0 + ) + ) + ((= v1-0 1) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-384") + 0.0 + 0 + ) + ) + ((= v1-0 2) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-387") + 0.0 + 0 + ) + ) + ((= v1-0 3) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-386") + 0.0 + 0 + ) + ) + ) + ) + (none) + ) + +(defbehavior factory-boss-machine-angle factory-boss () + (+ 8192.0 (* 16384.0 (the float (-> self chosen-machine)))) + ) + +(defbehavior factory-boss-approaching? factory-boss ((arg0 degrees)) + (let ((f0-1 (factory-boss-angle-sub arg0 (-> self catwalk-angle)))) + (or (and (< (-> self catwalk-vel) 0.0) (>= 0.0 f0-1)) (and (< 0.0 (-> self catwalk-vel)) (>= f0-1 0.0))) + ) + ) + +(defbehavior factory-boss-move-to-dest-angle factory-boss ((arg0 float) (arg1 float)) + (if (= (-> self catwalk-angle) arg0) + (return #t) + ) + (cond + ((!= (-> self catwalk-vel) 0.0) + ) + ((< (factory-boss-angle-sub arg0 (-> self catwalk-angle)) 0.0) + (set! (-> self catwalk-vel) (- arg1)) + ) + (else + (set! (-> self catwalk-vel) arg1) + ) + ) + (let ((s5-1 (factory-boss-approaching? arg0))) + (factory-boss-move) + (when (and s5-1 (not (factory-boss-approaching? arg0))) + (set! (-> self catwalk-vel) 0.0) + (set! (-> self catwalk-angle) arg0) + (return #t) + ) + ) + #f + ) + +(defmethod next-catwalk-angle ((this factory-boss) (arg0 int)) + (+ (-> this catwalk-angle) (* 0.2 (the float arg0) (-> this catwalk-vel))) + ) + +;; WARN: Return type mismatch int vs time-frame. +(defbehavior factory-boss-time-until-angle factory-boss ((arg0 degrees)) + (the-as time-frame (cond + ((= (-> self catwalk-angle) arg0) + 0 + ) + ((= (-> self catwalk-vel) 0.0) + #x7530 + ) + (else + (let ((f0-3 (factory-boss-angle-sub arg0 (-> self catwalk-angle)))) + (the int (* 5.0 (/ f0-3 (-> self catwalk-vel)))) + ) + ) + ) + ) + ) + +(defbehavior factory-boss-get-particle-spawn-points factory-boss ((arg0 int) (arg1 vector) (arg2 vector) (arg3 matrix)) + (factory-boss-method-26 self arg0 arg1 arg2 #f) + (vector-! (-> arg3 fvec) (-> self center) arg1) + (set! (-> arg3 fvec y) 0.0) + (vector-normalize! (-> arg3 fvec) 1.0) + (set! (-> arg3 fvec w) 0.0) + (set-vector! (-> arg3 rvec) (-> arg3 fvec z) 0.0 (- (-> arg3 fvec x)) 0.0) + (set-vector! (-> arg3 uvec) 0.0 1.0 0.0 0.0) + (vector+float*! arg2 arg1 (-> arg3 fvec) 0.0) + (+! (-> arg2 y) 106496.0) + 0 + (none) + ) + +(defbehavior factory-boss-drop-bomb factory-boss ((arg0 int)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! s3-0 (joint-node errol-lowres-lod0-jg Lhand)) + (factory-boss-target-pos s4-0 arg0 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) (-> s3-0 quad)) + (set! (-> gp-0 vel quad) (-> s4-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 handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-11 *game-info*) + (a0-11 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-11) + (set! (-> gp-0 attack-id) a0-11) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (factory-boss-play-speech 1 self) + (cond + ((= arg0 1) + (+! (-> self bombs-to-drop) -1) + (let ((v1-16 (ppointer->process (spawn-projectile factory-boss-floorbuster-bomb gp-0 self *default-dead-pool*)))) + (when v1-16 + (set! (-> (the-as factory-boss-floorbuster-bomb v1-16) targetted-group) (-> self floor-targets 0)) + (+! (-> self num-floor-targets) -1) + (dotimes (v1-20 (-> self num-floor-targets)) + (set! (-> self floor-targets v1-20) (-> self floor-targets (+ v1-20 1))) + ) + (the-as (pointer process) #f) + ) + ) + ) + ((= arg0 2) + (+! (-> self bombs-to-drop) -1) + (spawn-projectile factory-boss-shockwave-bomb gp-0 self *default-dead-pool*) + ) + (else + (+! (-> self bombs-to-drop) -1) + (spawn-projectile factory-boss-shot gp-0 self *default-dead-pool*) + ) + ) + ) + ) + +(defbehavior factory-boss-check-bomb-timer factory-boss ((arg0 int)) + (let ((s5-0 (>= (- (current-time) (+ (-> self shot-timer) (seconds -0.75))) 0))) + (let ((v1-5 (ja-group))) + (cond + ((and v1-5 (or (= v1-5 errol-lowres-run-cw-ja) + (= v1-5 errol-lowres-run-ccw-ja) + (= v1-5 errol-lowres-idle-to-run-cw-ja) + (= v1-5 errol-lowres-idle-to-run-ccw-ja) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-run-to-idle-ja :num! min) + (set! s5-0 #f) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 errol-lowres-run-to-idle-ja)) + ) + (set! s5-0 #f) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle30-ja :num! min) + (set! (-> self shot-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 4.0))))) + ) + ) + ((let ((v1-39 (ja-group))) + (and v1-39 (= v1-39 errol-lowres-idle-throw-ja)) + ) + (let ((f30-1 (ja-aframe-num 0))) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 59.0) + (if (or (zero? (-> self bombs-to-drop)) (!= arg0 1)) + (set! s5-0 #f) + ) + (if (or (< f30-1 59.0) (and (> (-> self bombs-to-drop) 0) (= arg0 1))) + (factory-boss-drop-bomb arg0) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.1)) + (if (or (zero? (-> self bombs-to-drop)) (nonzero? arg0)) + (ja :group! errol-lowres-idle30-ja :num! min) + (ja :group! errol-lowres-idle-throw-ja :num! min) + ) + (cond + ((= arg0 2) + (set! (-> self shot-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.5 3.5))))) + ) + (else + (set! (-> self shot-timer) 0) + 0 + ) + ) + (return #t) + ) + ) + ((and (>= (- (current-time) (+ (-> self shot-timer) (seconds -1))) 0) (nonzero? (-> self bombs-to-drop))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-throw-ja :num! min) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + (cond + (s5-0 + (let ((s5-4 0)) + (while (let ((v1-107 arg0)) + (< s5-4 (if (= v1-107 1) + (-> self bombs-to-drop) + 1 + ) + ) + ) + (let ((s4-3 (factory-boss-target-pos (new 'stack-no-clear 'vector) arg0 s5-4))) + (factory-boss-reticle-info-method-10 + (-> self reticle-info) + s4-3 + (-> self root trans) + (max 1 (- (the-as int (- (current-time) (-> self shot-timer))))) + arg0 + ) + (when (zero? s5-4) + (sound-play "reticle-track" :id (-> self reticle-sound) :position s4-3) + (set! (-> self reticle-sound-playing) #t) + ) + ) + (+! s5-4 1) + ) + ) + ) + (else + (factory-boss-method-30 self) + ) + ) + ) + #f + ) + +(defbehavior factory-boss-end-cutscene factory-boss () + (if (not (movie?)) + (process-release? *target*) + ) + (remove-setting! 'entity-name) + (set! (-> self camera-timer) 0) + (set! (-> self draw force-lod) 1) + (none) + ) + +(defbehavior factory-boss-spawn-ring factory-boss ((arg0 matrix) (arg1 vector) (arg2 factory-boss-machine-state)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector+float*! v1-0 arg1 (-> arg0 uvec) 14336.0) + (vector+float*! v1-0 v1-0 (-> arg0 fvec) 7168.0) + (set! (-> arg0 trans quad) (-> v1-0 quad)) + ) + (spawn-from-mat (-> arg2 ring-part) arg0) + (none) + ) + +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch symbol vs none. +(defbehavior factory-boss-always factory-boss () + (local-vars + (sv-256 (function float float float float float float)) + (sv-272 float) + (sv-288 float) + (sv-304 (function float float float float float float)) + (sv-320 float) + (sv-336 float) + (sv-352 float) + (sv-368 float) + (sv-384 float) + (sv-400 float) + ) + (factory-boss-play-speech 0 self) + (if (and (nonzero? (-> self camera-timer)) (time-elapsed? (-> self camera-timer) (seconds 3))) + (factory-boss-end-cutscene) + ) + (cond + ((and (-> self next-state) (let ((v1-9 (-> self next-state name))) + (or (= v1-9 'run-to-machine) + (= v1-9 'get-hit) + (= v1-9 'launch-critters) + (= v1-9 'drop-bombs) + (= v1-9 'beaten) + ) + ) + ) + (init! (-> self warp-blocker) (the-as int self)) + (init! (-> self entry-blocker) (the-as int self)) + ) + (else + (disable (-> self warp-blocker)) + (disable (-> self entry-blocker)) + ) + ) + (dotimes (gp-0 4) + (let ((s5-0 (-> self machine-state gp-0)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'matrix)) + ) + (factory-boss-get-particle-spawn-points gp-0 s4-0 s0-0 s2-0) + (let ((f1-0 2.5)) + (when (zero? (-> s5-0 state)) + (let ((f0-1 (* 0.0033333334 (the float (current-time))))) + (set! f1-0 (the float (the int (* 5.9999 (- f0-1 (the float (the int f0-1))))))) + ) + ) + (let ((f0-6 (+ 14745.6 (* 2048.0 f1-0)))) + (let ((f1-5 (+ 6553.6 (* 2048.0 f1-0)))) + (vector+float*! s1-0 s0-0 (-> s2-0 rvec) f0-6) + (vector+float*! s1-0 s1-0 (-> s2-0 uvec) f1-5) + ) + (vector+float*! s1-0 s1-0 (-> s2-0 fvec) -4096.0) + (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (vector+float*! s3-0 s1-0 (-> s2-0 rvec) (* -2.0 f0-6)) + ) + ) + (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (if (logtest? (-> s5-0 flags) (facboss-machine-state-flag fms1)) + (factory-boss-spawn-ring s2-0 s4-0 s5-0) + ) + (cond + ((zero? (-> s5-0 state)) + (let ((v1-45 (-> s5-0 lightning state mode))) + (when (or (zero? v1-45) (= v1-45 3)) + (let ((v1-47 (-> s5-0 lightning)) + (a0-23 1) + ) + (let ((a1-14 (!= a0-23 (-> v1-47 state mode)))) + (case a0-23 + ((3) + (if a1-14 + (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-23)) + ) + ) + ) + (set! (-> s5-0 lightning state meet data 0 quad) (-> s1-0 quad)) + (let ((v1-51 (-> s5-0 lightning))) + (set! (-> v1-51 state meet data (+ (-> v1-51 state points-to-draw) -1) quad) (-> s3-0 quad)) + ) + ) + (else + (let ((v1-55 (-> s5-0 lightning state mode))) + (cond + ((or (zero? v1-55) (= v1-55 3)) + ) + (else + (let ((v1-57 (-> s5-0 lightning)) + (a0-32 3) + ) + (let ((a1-24 (!= a0-32 (-> v1-57 state mode)))) + (case a0-32 + ((3) + (if a1-24 + (set! (-> v1-57 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-57 state start-color) (-> v1-57 spec start-color)) + (set! (-> v1-57 state end-color) (-> v1-57 spec end-color)) + ) + ) + ) + (set! (-> v1-57 state mode) (the-as uint a0-32)) + ) + ) + ) + ) + (set! (-> s2-0 trans quad) (-> s4-0 quad)) + (spawn-from-mat (-> s5-0 damaged-low-smoke-part) s2-0) + (set! (-> s2-0 trans quad) (-> s0-0 quad)) + (spawn-from-mat (-> s5-0 damaged-high-smoke-part) s2-0) + (cond + ((< (- (current-time) (-> s5-0 ring-timer)) 0) + ) + ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms1)) + (let ((s0-1 (current-time)) + (f30-0 300.0) + ) + (set! sv-256 lerp-scale) + (set! sv-272 (the-as float 0.05)) + (set! sv-288 (the-as float 0.15)) + (let* ((v1-73 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-74 (the-as number (logior #x3f800000 v1-73))) + (a2-6 (+ -1.0 (the-as float v1-74))) + (a3-5 0.0) + (t0-0 1.0) + ) + (set! (-> s5-0 ring-timer) (+ s0-1 (the int (* f30-0 (sv-256 sv-272 sv-288 a2-6 a3-5 t0-0))))) + ) + ) + (logclear! (-> s5-0 flags) (facboss-machine-state-flag fms1)) + ) + (else + (let ((s0-2 (current-time)) + (f30-1 300.0) + ) + (set! sv-304 lerp-scale) + (set! sv-320 (the-as float 0.01)) + (set! sv-336 (the-as float 0.2)) + (let* ((v1-84 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-85 (the-as number (logior #x3f800000 v1-84))) + (a2-7 (+ -1.0 (the-as float v1-85))) + (a3-6 0.0) + (t0-1 1.0) + ) + (set! (-> s5-0 ring-timer) (+ s0-2 (the int (* f30-1 (sv-304 sv-320 sv-336 a2-7 a3-6 t0-1))))) + ) + ) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms1)) + ) + ) + (cond + ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms2)) + (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (spawn-from-mat (-> s5-0 damaged-left-spark-part) s2-0) + (when (>= (- (current-time) (-> s5-0 left-spark-timer)) 0) + (let ((s1-1 (current-time)) + (f30-2 300.0) + (s0-3 lerp-scale) + ) + (set! sv-352 (the-as float 0.3)) + (set! sv-368 (the-as float 0.7)) + (let* ((v1-103 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-104 (the-as number (logior #x3f800000 v1-103))) + (a2-8 (+ -1.0 (the-as float v1-104))) + (a3-7 0.0) + (t0-2 1.0) + ) + (set! (-> s5-0 left-spark-timer) (+ s1-1 (the int (* f30-2 (s0-3 sv-352 sv-368 a2-8 a3-7 t0-2))))) + ) + ) + (logclear! (-> s5-0 flags) (facboss-machine-state-flag fms2)) + ) + ) + ((>= (- (current-time) (-> s5-0 left-spark-timer)) 0) + (let ((s1-2 (current-time)) + (f30-3 300.0) + (s0-4 lerp-scale) + ) + (set! sv-384 (the-as float 0.2)) + (set! sv-400 (the-as float 0.4)) + (let* ((v1-117 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-118 (the-as number (logior #x3f800000 v1-117))) + (a2-9 (+ -1.0 (the-as float v1-118))) + (a3-8 0.0) + (t0-3 1.0) + ) + (set! (-> s5-0 left-spark-timer) (+ s1-2 (the int (* f30-3 (s0-4 sv-384 sv-400 a2-9 a3-8 t0-3))))) + ) + ) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms2)) + ) + ) + (cond + ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms3)) + (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (spawn-from-mat (-> s5-0 damaged-right-spark-part) s2-0) + (when (>= (- (current-time) (-> s5-0 right-spark-timer)) 0) + (let* ((s3-1 (current-time)) + (f30-4 300.0) + (s2-1 lerp-scale) + (s1-3 0.3) + (s0-5 0.7) + (v1-134 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-135 (the-as number (logior #x3f800000 v1-134))) + ) + (set! (-> s5-0 right-spark-timer) + (+ s3-1 (the int (* f30-4 (s2-1 s1-3 s0-5 (+ -1.0 (the-as float v1-135)) 0.0 1.0)))) + ) + ) + (logclear! (-> s5-0 flags) (facboss-machine-state-flag fms3)) + ) + ) + ((>= (- (current-time) (-> s5-0 right-spark-timer)) 0) + (let* ((s3-2 (current-time)) + (f30-5 300.0) + (s2-2 lerp-scale) + (s1-4 0.2) + (s0-6 0.4) + (v1-146 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-147 (the-as number (logior #x3f800000 v1-146))) + ) + (set! (-> s5-0 right-spark-timer) + (+ s3-2 (the int (* f30-5 (s2-2 s1-4 s0-6 (+ -1.0 (the-as float v1-147)) 0.0 1.0)))) + ) + ) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms3)) + ) + ) + (sound-play "steam-vent" :id (-> s5-0 machine-sound) :position s4-0) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms0)) + ) + ) + ) + ) + (dotimes (gp-1 8) + (let* ((s5-1 (-> self critter gp-1)) + (s4-1 (handle->process (-> s5-1 handle))) + ) + (when s4-1 + (when (not (logtest? (-> s5-1 flags) (facboss-critter-tracker-flag fct1))) + (send-event s4-1 'change-nav-mesh (-> self hits-taken)) + (if (send-event s4-1 'jump 2 (-> s5-1 dest)) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct1)) + ) + ) + (when (not (logtest? (-> s5-1 flags) (facboss-critter-tracker-flag fct2))) + (if (send-event s4-1 'enable-envmap #f) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct2)) + ) + ) + (when (and (not (logtest? (-> s5-1 flags) (facboss-critter-tracker-flag fct0))) + (and (-> s4-1 next-state) + (let ((v1-193 (-> s4-1 next-state name))) + (or (= v1-193 'die) (= v1-193 'die-falling) (= v1-193 'lift-off) (= v1-193 'explode)) + ) + ) + (< (vector-vector-xz-distance (-> (the-as process-drawable s4-1) root trans) (-> self center)) 122880.0) + ) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct0)) + (dotimes (s3-3 10) + (when (not (handle->process (-> self ammo s3-3))) + (let ((s2-3 (new 'static 'fact-info))) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> (the-as process-drawable s4-1) root trans quad)) + (set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0) + (set! (-> s2-3 options) (actor-option fade-out fall no-distance-check-fadeout)) + (set! (-> s2-3 fade-time) (seconds 10)) + (set! (-> s2-3 pickup-spawn-amount) 1.0) + (let* ((v1-210 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-211 (the-as number (logior #x3f800000 v1-210))) + ) + (cond + ((< (+ -1.0 (the-as float v1-211)) 0.9) + (set! (-> s2-3 pickup-type) (pickup-type ammo-random)) + (set! (-> s2-3 pickup-amount) 10.0) + ) + (else + (set! (-> s2-3 pickup-amount) (-> *FACT-bank* health-small-inc)) + (set! (-> s2-3 pickup-type) (pickup-type health)) + ) + ) + ) + (set! (-> s2-3 process) s4-1) + (set! (-> self ammo s3-3) (ppointer->handle (drop-pickup s2-3 #t *entity-pool* (the-as fact-info #f) 0 #t))) + ) + 0 + (goto cfg-122) + ) + ) + ) + (label cfg-122) + (when (< (-> (the-as process-drawable s4-1) root trans y) (+ -81920.0 (-> self center y))) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct0)) + (send-event s4-1 'die-fast) + ) + ) + ) + ) + (none) + ) + +(defbehavior factory-boss-always-handler factory-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('complete) + (go-virtual beaten) + ) + (('in-cutscene?) + (and *target* (nonzero? (-> self camera-timer))) + ) + (('round?) + (and (and (-> self next-state) (= (-> self next-state name) 'launch-critters)) + (>= (-> self current-round) (the-as int (+ (-> arg3 param 0) -1))) + ) + ) + ) + ) + +;; WARN: disable def twice: 10. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior factory-boss-handler factory-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-1 object)) + (case arg2 + (('child-jumped) + (let* ((gp-0 arg0) + (v1-1 (if (type? gp-0 nav-enemy) + gp-0 + ) + ) + ) + (when v1-1 + (set! v0-1 (logclear (-> (the-as nav-enemy v1-1) enemy-flags) (enemy-flag directed))) + (set! (-> (the-as nav-enemy v1-1) enemy-flags) (the-as enemy-flag v0-1)) + v0-1 + ) + ) + ) + (('fall?) + (let ((v1-2 (-> arg3 param 0)) + (a0-3 (-> arg3 param 1)) + ) + (set! v0-1 #f) + (when (and (>= (the-as int a0-3) 0) (< (the-as int a0-3) (+ (-> self actor-group-count) -1))) + (let ((gp-1 (-> self actor-group a0-3))) + (dotimes (a0-6 (-> gp-1 length)) + (when (= (-> gp-1 data a0-6 actor) v1-2) + (dotimes (s5-0 (-> gp-1 length)) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer self)) + (set! (-> a1-12 num-params) 0) + (set! (-> a1-12 message) 'fall!) + (let ((t9-1 send-event-function) + (v1-7 (-> gp-1 data s5-0 actor)) + ) + (t9-1 + (if v1-7 + (-> v1-7 extra process) + ) + a1-12 + ) + ) + ) + ) + (set! v0-1 #t) + 0 + (goto cfg-25) + ) + ) + ) + ) + ) + (label cfg-25) + v0-1 + ) + (('draw-reticle) + (factory-boss-reticle-info-method-10 + (-> self reticle-info) + (the-as vector (-> arg3 param 0)) + (the-as vector (-> arg3 param 1)) + 0 + (the-as int (-> arg3 param 2)) + ) + ) + (else + (factory-boss-always-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +(deftype factory-boss-command (structure) + ((action facboss-cmd) + (suck float) + (random float) + (round int8) + ) + ) + + +(define *factory-boss-swarm-0* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd8) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +(define *factory-boss-swarm-1* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.3 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.6 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +(define *factory-boss-swarm-2* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd9) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.25 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.75 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +(define *factory-boss-swarm-3* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd8) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.25 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.75 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +(define *factory-boss-swarm-4* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd8) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd5) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd5) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd9) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd9) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.25 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.75 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +(defbehavior factory-boss-launch-critter-handler factory-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('gonna-getcha) + (format *stdebug* "gonna-getcha~%") + (cond + ((= (-> *game-info* counter) 3.0) + (send-event self 'gotcha) + ) + ((zero? (-> self camera-timer)) + (set-time! (-> self camera-timer)) + (process-grab? *target* #f) + (set! (-> self draw force-lod) 0) + (let ((v1-10 (-> self chosen-machine))) + (cond + ((zero? v1-10) + (set-setting! 'entity-name "camera-414" 0.0 0) + ) + ((= v1-10 1) + (set-setting! 'entity-name "camera-415" 0.0 0) + ) + ((= v1-10 2) + (set-setting! 'entity-name "camera-417" 0.0 0) + ) + ((= v1-10 3) + (set-setting! 'entity-name "camera-416" 0.0 0) + ) + ) + ) + ) + ) + ) + (('gotcha) + (let ((v1-18 (-> self machine-state (-> self chosen-machine)))) + (+! (-> v1-18 state) 1) + (when (>= (-> v1-18 state) 2) + (let ((a1-8 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (factory-boss-get-particle-spawn-points (-> self chosen-machine) a1-8 s5-0 gp-0) + (set! (-> gp-0 trans quad) (-> s5-0 quad)) + (if (logtest? (-> *part-group-id-table* 1367 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1367) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1367) :mat-joint gp-0) + ) + ) + ) + ) + (let ((gp-1 (the-as (pointer process-tree) (-> self child)))) + (while gp-1 + (send-event (ppointer->process gp-1) 'lift-off) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (+! (-> self hits-taken) 1) + (set! (-> *game-info* counter) (the float (-> self hits-taken))) + (if (= (-> *game-info* counter) 4.0) + (go-virtual beaten) + (go-virtual get-hit) + ) + #t + ) + (else + (factory-boss-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch time-frame vs none. +(defbehavior factory-boss-advance-launch-script factory-boss () + (+! (-> self command-index) 1) + (set-time! (-> self command-timer)) + (none) + ) + +(defbehavior factory-boss-check-launch-script factory-boss () + (local-vars (v1-20 facboss-cmd)) + (let ((v1-0 *factory-boss-swarm-4*)) + (let ((a0-0 (-> self hits-taken))) + (cond + ((zero? a0-0) + (set! v1-0 *factory-boss-swarm-0*) + ) + ((= a0-0 1) + (set! v1-0 *factory-boss-swarm-1*) + ) + ((= a0-0 2) + (set! v1-0 *factory-boss-swarm-2*) + ) + ) + ) + (when (>= (-> self command-index) (-> v1-0 length)) + (set! (-> self command-index) 0) + (+! (-> self current-round) 1) + ) + (let ((gp-0 (-> v1-0 (-> self command-index)))) + (cond + ((or (and (>= (-> gp-0 suck) 0.0) (< (-> gp-0 suck) (you-suck-scale *game-info* #f 0))) + (and (< (-> gp-0 suck) 0.0) (>= (- (-> gp-0 suck)) (you-suck-scale *game-info* #f 0))) + ) + (factory-boss-advance-launch-script) + 7 + ) + ((or (and (> (-> gp-0 round) 0) (>= (-> self current-round) (-> gp-0 round))) + (and (<= (-> gp-0 round) 0) (< (-> self current-round) (- (-> gp-0 round)))) + ) + (factory-boss-advance-launch-script) + 7 + ) + (else + (let* ((f30-2 (-> gp-0 random)) + (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-18 (the-as number (logior #x3f800000 v1-17))) + ) + (cond + ((< f30-2 (+ -1.0 (the-as float v1-18))) + (factory-boss-advance-launch-script) + 7 + ) + ((begin (set! v1-20 (-> gp-0 action)) (or (= v1-20 (facboss-cmd cmd7)) + (= v1-20 (facboss-cmd cmd8)) + (= v1-20 (facboss-cmd cmd9)) + (= v1-20 (facboss-cmd cmd10)) + (= v1-20 (facboss-cmd cmd11)) + (= v1-20 (facboss-cmd cmd12)) + (= v1-20 (facboss-cmd cmd13)) + (= v1-20 (facboss-cmd cmd14)) + (= v1-20 (facboss-cmd cmd15)) + (= v1-20 (facboss-cmd cmd16)) + (= v1-20 (facboss-cmd cmd17)) + ) + ) + (let ((v1-21 0)) + (dotimes (a0-32 8) + (if (handle->process (-> self critter a0-32 handle)) + (+! v1-21 1) + ) + ) + (when (>= (the-as int (+ (-> gp-0 action) -7)) v1-21) + (case (-> gp-0 action) + (((facboss-cmd cmd7)) + (factory-boss-play-speech 5 self) + ) + ) + (factory-boss-advance-launch-script) + ) + ) + 7 + ) + ((or (= v1-20 (facboss-cmd cmd18)) + (= v1-20 (facboss-cmd cmd19)) + (= v1-20 (facboss-cmd cmd20)) + (= v1-20 (facboss-cmd cmd21)) + ) + (let* ((v1-29 (+ (-> gp-0 action) -18)) + (a0-44 (shl 1 (the-as int v1-29))) + ) + (if (time-elapsed? (-> self command-timer) (the int (* 300.0 (the float a0-44)))) + (factory-boss-advance-launch-script) + ) + ) + 7 + ) + (else + (the-as int (-> gp-0 action)) + ) + ) + ) + ) + ) + ) + ) + ) + +(defbehavior factory-boss-launch-critter factory-boss ((arg0 int)) + (case arg0 + ((7) + ) + (else + (dotimes (s2-0 8) + (let ((s5-0 (-> self critter s2-0))) + (when (not (handle->process (-> s5-0 handle))) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'enemy-init-by-other-params)) + ) + (when (factory-boss-method-26 + self + (-> self chosen-machine) + gp-0 + (-> s5-0 dest) + (the-as symbol (-> self launching-group)) + ) + (set! (-> s5-0 flags) (facboss-critter-tracker-flag)) + (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (quaternion-copy! (-> s4-0 quat) (-> self root quat)) + (set! (-> s4-0 entity) (-> self entity)) + (set! (-> s4-0 directed?) #t) + (set! (-> s4-0 no-initial-move-to-ground?) #t) + (set! (-> s4-0 art-level) #f) + (let ((v1-16 arg0)) + (cond + ((= v1-16 1) + (let ((s3-1 (get-process *default-dead-pool* roboguard #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-1 + (let ((t9-3 (method-of-type process activate))) + (t9-3 s3-1 self "roboguard" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-1 enemy-init-by-other self s4-0) + (-> s3-1 ppointer) + ) + ) + ) + ) + ) + ((zero? v1-16) + (let ((s3-2 (get-process *default-dead-pool* spydroid-orig #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-2 + (let ((t9-6 (method-of-type process activate))) + (t9-6 s3-2 self "spydroid-orig" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-2 enemy-init-by-other self s4-0) + (-> s3-2 ppointer) + ) + ) + ) + ) + ) + ((= v1-16 2) + (let ((s3-3 (get-process *default-dead-pool* missile-bot #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-3 + (let ((t9-9 (method-of-type process activate))) + (t9-9 s3-3 self "missile-bot" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-3 enemy-init-by-other self s4-0) + (-> s3-3 ppointer) + ) + ) + ) + ) + (let ((s4-1 (handle->process (-> s5-0 handle)))) + (when s4-1 + (factory-boss-pick-pers-camera) + (send-event s4-1 'change-nav-mesh (-> self hits-taken)) + (if (send-event s4-1 'jump 2 (-> s5-0 dest)) + (logior! (-> s5-0 flags) (facboss-critter-tracker-flag fct1)) + ) + ) + ) + ) + ((= v1-16 3) + (let ((s3-4 (get-process *default-dead-pool* kg-grunt #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-4 + (let ((t9-15 (method-of-type process activate))) + (t9-15 s3-4 self "kg-grunt" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-4 enemy-init-by-other self s4-0) + (-> s3-4 ppointer) + ) + ) + ) + ) + ) + ((= v1-16 4) + (set! (-> s4-0 directed?) #f) + (let ((s3-5 (get-process *default-dead-pool* robo-hover #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-5 + (let ((t9-18 (method-of-type process activate))) + (t9-18 s3-5 self "robo-hover" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-5 enemy-init-by-other self s4-0) + (-> s3-5 ppointer) + ) + ) + ) + ) + (logior! (-> s5-0 flags) (facboss-critter-tracker-flag fct1)) + ) + ((= v1-16 5) + (set! (-> s4-0 directed?) #f) + (let ((s3-6 (get-process *default-dead-pool* neo-wasp #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-6 + (let ((t9-21 (method-of-type process activate))) + (t9-21 s3-6 self "neo-wasp" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-6 enemy-init-by-other self s4-0) + (-> s3-6 ppointer) + ) + ) + ) + ) + (logior! (-> s5-0 flags) (facboss-critter-tracker-flag fct1)) + ) + ((= v1-16 6) + (let ((s3-7 (get-process *default-dead-pool* dp-bipedal #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-7 + (let ((t9-24 (method-of-type process activate))) + (t9-24 s3-7 self "dp-bipedal" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-7 enemy-init-by-other self s4-0) + (-> s3-7 ppointer) + ) + ) + ) + ) + ) + (else + (format 0 "~A can't launch unknown critter type ~D~%" (-> self name) arg0) + (return #t) + ) + ) + ) + (cond + ((handle->process (-> s5-0 handle)) + (let ((s4-2 (new 'stack-no-clear 'matrix))) + (vector-! (-> s4-2 uvec) (-> s5-0 dest) gp-0) + (set! (-> s4-2 uvec y) 0.0) + (vector-normalize! (-> s4-2 uvec) 1.0) + (set! (-> s4-2 uvec w) 0.0) + (set-vector! (-> s4-2 fvec) 0.0 1.0 0.0 0.0) + (vector-cross! (-> s4-2 rvec) (-> s4-2 uvec) (-> s4-2 fvec)) + (set! (-> s4-2 rvec w) 0.0) + (set! (-> s4-2 trans quad) (-> gp-0 quad)) + (+! (-> s4-2 trans y) 8192.0) + (set! (-> s4-2 trans w) 1.0) + (if (logtest? (-> *part-group-id-table* 1377 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1377) + :duration (seconds 1) + :mat-joint s4-2 + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1377) + :duration (seconds 1) + :mat-joint s4-2 + ) + ) + ) + (return #t) + ) + (else + (return #f) + ) + ) + (the-as none 0) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +(defstate beaten (factory-boss) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (dotimes (gp-0 8) + (let* ((s5-0 (handle->process (-> self critter gp-0 handle))) + (a0-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a0-5 + (send-event a0-5 'die-fast) + ) + ) + ) + (let ((gp-1 (the-as (pointer process-tree) (-> self child)))) + (while gp-1 + (let ((a0-6 (-> (the-as (pointer process) gp-1) 0 entity)) + (s5-1 gp-1) + ) + (set! gp-1 (-> gp-1 0 brother)) + (if (and a0-6 (nonzero? (res-lump-value a0-6 'drop-from-movie uint128 :time -1000000000.0))) + (deactivate (-> s5-1 0)) + ) + ) + ) + ) + (disable (-> self warp-blocker)) + (disable (-> self entry-blocker)) + (factory-boss-end-cutscene) + (ja-post) + ) + :code sleep-code + ) + +(defstate run-to-machine (factory-boss) + :virtual #t + :event factory-boss-handler + :enter (behavior () + (factory-boss-pick-machine) + ) + :trans (behavior () + (factory-boss-always) + (if (factory-boss-move-to-dest-angle (factory-boss-machine-angle) 145.63556) + (go-virtual drop-bombs) + ) + (let ((v1-6 (ja-group))) + (cond + ((and v1-6 (or (= v1-6 errol-lowres-run-cw-ja) (= v1-6 errol-lowres-run-ccw-ja))) + (ja :num! (loop!)) + ) + ((let ((v1-14 (ja-group))) + (and v1-14 (= v1-14 errol-lowres-idle-to-run-ccw-ja)) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! errol-lowres-run-ccw-ja :num! min) + ) + ) + ((let ((v1-31 (ja-group))) + (and v1-31 (= v1-31 errol-lowres-idle-to-run-cw-ja)) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! errol-lowres-run-cw-ja :num! min) + ) + ) + ((< 0.0 (-> self catwalk-vel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-to-run-ccw-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-to-run-cw-ja :num! min) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate get-hit (factory-boss) + :virtual #t + :event factory-boss-handler + :enter (behavior () + (factory-boss-play-speech 6 self) + ) + :exit (behavior () + (factory-boss-end-cutscene) + ) + :trans (behavior () + (factory-boss-always) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 errol-lowres-idle-knocked-ja)) + (ja :num! (seek!)) + (if (ja-done? 0) + (go-virtual run-to-machine) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! errol-lowres-idle-knocked-ja :num! min) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; WARN: Return type mismatch object vs none. +(defbehavior factory-boss-launch-critter-pick-anim factory-boss ((arg0 int)) + (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-2 (the-as number (logior #x3f800000 v1-1))) + (f0-2 (+ -1.0 (the-as float v1-2))) + ) + (cond + ((!= arg0 7) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-hit-console-2-ja :num! min) + (let ((v1-10 (-> self hits-taken))) + (if (or (zero? v1-10) (= v1-10 1) (= v1-10 2) (= v1-10 3)) + (factory-boss-play-speech 3 self) + (factory-boss-play-speech 4 self) + ) + ) + ) + ((and (< f0-2 0.4) (let ((v1-17 (ja-group))) + (not (and v1-17 (= v1-17 errol-lowres-idle30-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle30-ja :num! min) + ) + ((and (or (< f0-2 0.8) (let ((v1-29 (ja-group))) + (and v1-29 (or (= v1-29 errol-lowres-idle-yell-ja) (= v1-29 errol-lowres-idle-yell-1-ja))) + ) + ) + (let ((v1-35 (ja-group))) + (not (and v1-35 (= v1-35 errol-lowres-idle60-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle60-ja :num! min) + ) + ((< f0-2 0.9) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-yell-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-yell-1-ja :num! min) + ) + ) + ) + (none) + ) + +(defstate launch-critters (factory-boss) + :virtual #t + :event factory-boss-launch-critter-handler + :enter (behavior () + (set! (-> self command-index) 0) + (set! (-> self command-timer) 0) + (set! (-> self current-round) 0) + (set! (-> self launching-group) #f) + (let ((a0-1 (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor (-> self hits-taken)))) + (if a0-1 + (change-to a0-1 self) + ) + ) + ) + :exit (behavior () + (if (zero? (-> self camera-timer)) + (factory-boss-end-cutscene) + ) + ) + :trans (behavior () + (let ((gp-0 (factory-boss-check-launch-script)) + (v1-2 (ja-group)) + ) + (cond + ((and v1-2 (or (= v1-2 errol-lowres-idle-hit-console-ja) (= v1-2 errol-lowres-idle-hit-console-2-ja))) + (let ((f30-0 (ja-aframe-num 0)) + (f28-0 60.0) + ) + (let ((v1-8 (ja-group))) + (if (and v1-8 (= v1-8 errol-lowres-idle-hit-console-2-ja)) + (set! f28-0 17.0) + ) + ) + (ja :num! (seek!)) + (when (and (or (-> self launching-group) (and (>= (ja-aframe-num 0) f28-0) (< f30-0 f28-0))) + (factory-boss-launch-critter gp-0) + ) + (set! (-> self launching-group) (the-as sparticle-launch-group #t)) + (factory-boss-advance-launch-script) + ) + ) + (if (ja-done? 0) + (factory-boss-launch-critter-pick-anim gp-0) + ) + ) + ((or (!= gp-0 7) (let ((v1-35 (ja-group))) + (not (and v1-35 (or (= v1-35 errol-lowres-idle30-ja) (= v1-35 errol-lowres-idle60-ja)))) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self launching-group) #f) + (factory-boss-launch-critter-pick-anim gp-0) + ) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + (factory-boss-always) + ) + :code sleep-code + :post ja-post + ) + +(defbehavior factory-boss-pick-floor-targets factory-boss ((arg0 int) (arg1 int)) + (let ((v1-1 (min 7 arg1))) + (set! (-> self num-floor-targets) 0) + (dotimes (a1-1 (+ (-> self actor-group-count) -1)) + (let ((a3-1 (-> self actor-group a1-1))) + (when (and (nonzero? v1-1) + (>= arg0 a1-1) + (not (logtest? (-> a3-1 data 0 actor extra perm status) (entity-perm-status subtask-complete))) + ) + (set! (-> self floor-targets (-> self num-floor-targets)) a1-1) + (+! (-> self num-floor-targets) 1) + (+! v1-1 -1) + ) + ) + ) + ) + (set! (-> self bombs-to-drop) (-> self num-floor-targets)) + (set! (-> self bomb-type) (facboss-bomb-type bomb1)) + 0 + (none) + ) + +(defstate drop-bombs (factory-boss) + :virtual #t + :event factory-boss-handler + :enter (behavior () + (let ((v1-0 (-> self hits-taken))) + (cond + ((zero? v1-0) + (set! (-> self shot-timer) (+ (current-time) (seconds 3))) + (set! (-> self bombs-to-drop) 4) + (set! (-> self bomb-type) (facboss-bomb-type bomb0)) + 0 + ) + ((= v1-0 1) + (set! (-> self shot-timer) 0) + (set! (-> self bombs-to-drop) 3) + (set! (-> self bomb-type) (facboss-bomb-type bomb2)) + ) + (else + (set! (-> self shot-timer) 0) + (set! (-> self bombs-to-drop) 4) + (set! (-> self bomb-type) (facboss-bomb-type bomb2)) + ) + ) + ) + (factory-boss-pick-camera) + ) + :exit (behavior () + (factory-boss-end-cutscene) + (factory-boss-method-30 self) + ) + :trans (behavior () + (when (and (<= (-> self bombs-to-drop) 0) (let ((v1-4 (ja-group))) + (not (and v1-4 (= v1-4 errol-lowres-idle-throw-ja))) + ) + ) + (let ((a1-0 0) + (a0-5 0) + (gp-0 0) + ) + (let ((v1-8 (-> self hits-taken))) + (cond + ((zero? v1-8) + ) + ((= v1-8 1) + (set! a1-0 7) + (set! a0-5 6) + (set! gp-0 4) + ) + ((= v1-8 2) + (set! a1-0 7) + (set! a0-5 13) + (set! gp-0 4) + ) + (else + (set! a1-0 7) + (set! a0-5 100) + (set! gp-0 4) + ) + ) + ) + (case (-> self bomb-type) + (((facboss-bomb-type bomb2) (facboss-bomb-type bomb1)) + (factory-boss-pick-floor-targets a0-5 a1-0) + (cond + ((zero? (-> self bombs-to-drop)) + (set! (-> self bombs-to-drop) gp-0) + (set! (-> self bomb-type) (facboss-bomb-type bomb0)) + 0 + ) + (else + (set! (-> self shot-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) + ) + ) + ) + (else + (go-virtual launch-critters) + ) + ) + ) + ) + (if (and (= (-> self bomb-type) (facboss-bomb-type bomb1)) + (< (-> self num-floor-targets) (-> self bombs-to-drop)) + ) + (set! (-> self bombs-to-drop) (-> self num-floor-targets)) + ) + (factory-boss-always) + (factory-boss-move) + (factory-boss-check-bomb-timer (the-as int (-> self bomb-type))) + ) + :code sleep-code + :post ja-post + ) + +(defstate hidden (factory-boss) + :virtual #t + :event factory-boss-always-handler + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self chosen-machine) 0) + (set! (-> self catwalk-angle) (factory-boss-machine-angle)) + (set! (-> self root-angle) (+ 32768.0 (-> self catwalk-angle))) + (set! (-> self catwalk-vel) 0.0) + (reset-factory-boss-speeches) + (ja-post) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :trans (behavior () + (cond + ((task-node-closed? (game-task-node factory-boss-resolution)) + (go-virtual beaten) + ) + ((task-node-closed? (game-task-node factory-boss-introduction)) + (go-virtual drop-bombs) + ) + ) + ) + :code sleep-code + ) diff --git a/goal_src/jak3/levels/factory/factory-h.gc b/goal_src/jak3/levels/factory/factory-h.gc index e7cf7907b7..6f1f7123ff 100644 --- a/goal_src/jak3/levels/factory/factory-h.gc +++ b/goal_src/jak3/levels/factory/factory-h.gc @@ -5,5 +5,186 @@ ;; name in dgo: factory-h ;; dgos: LFACTORY +;; +++factory-inout-flag +(defenum factory-inout-flag + :type uint8 + :bitfield #t + (fi0 0) + (fi1 1) + (fi2 2) + ) +;; ---factory-inout-flag + + ;; DECOMP BEGINS +(deftype fac-edge-list (basic) + ((edge int16 4) + ) + ) + + +(deftype factory-inout (structure) + ((lpath int16) + (lpos float) + (flags factory-inout-flag) + ) + :allow-misaligned + ) + + +(deftype factory-pathlist (structure) + ((path path-control 200) + (inout factory-inout 200 :inline) + (loops int16 200) + (npath int8) + (nloop int8) + (curidx int8) + ) + :allow-misaligned + ) + + +(deftype factory-manager (process) + ((self factory-manager :override) + (nfighters-spawned uint8) + (nfighters-total uint8) + (ntanks-spawned uint8) + (player-born time-frame) + (player-died time-frame) + (fighter-spawned time-frame) + (fighter-killed time-frame) + (tank-spawned time-frame) + (tank-killed time-frame) + (fpath factory-pathlist :inline) + (tpath factory-pathlist :inline) + (cur-wave uint8) + ) + (:state-methods + idle + ) + (:methods + (factory-manager-method-15 (_type_) none) + (init-paths-for-list! (_type_ factory-pathlist string) symbol) + ) + ) + + +(deftype factory-fighter (rigid-body-object) + ((parent (pointer factory-manager) :override) + (first-time? symbol) + (path-pos float) + (forw vector :inline) + (upvc vector :inline) + (ppos vector :inline) + (pvel vector :inline) + (pacc vector :inline) + (blendpath float) + (newpath int8) + (path-idx int8) + (last-hit-time time-frame) + (disappear symbol) + (last-fire time-frame) + (turret-gun int8) + (light-trail handle) + (rot-vel float) + (rot-acc float) + (engine-sound sound-id) + (engine-sound-playing? symbol) + (last-snd-cmd time-frame) + (red-tip-change-time time-frame) + (red-tip-on symbol) + ) + (:state-methods + flying + explode + dive + die + ) + (:methods + (fire-shot (_type_) projectile) + (factory-fighter-method-61 (_type_) none) + (factory-fighter-method-62 (_type_ symbol) none) + ) + ) + + +(deftype fac-target (process-focusable) + ((sync sync-paused :inline) + (minimap connection-minimap) + (light-jm joint-mod) + ) + (:state-methods + idle + die-fast + retract + retracted + explode + ) + (:methods + (fac-target-method-33 (_type_) none) + (fac-target-method-34 (_type_) none) + ) + ) + + +(deftype fac-gun-tower (process-focusable) + ((yaw float) + (yawvel float) + (pitch float) + (pitchvel float) + (dyaw float) + (dpitch float) + (last-fire time-frame) + (last-hit-time time-frame) + (gunrot int8) + (muzzle int8) + (gun-idx int8) + (attack-id int32) + (gun-tilt-jm joint-mod) + (hit-points float) + (invincable symbol) + (rotate-sound sound-id) + (rotate-sound-playing symbol) + (blade-sound sound-id) + (blade-sound-playing symbol) + (snd-cmd-time time-frame) + (minimap connection-minimap) + ) + (:state-methods + open + idle + die + die-fast + ) + (:methods + (fac-gun-tower-method-32 (_type_) none) + (fac-gun-tower-method-33 (_type_) none) + (fac-gun-tower-method-34 (_type_) none) + (fire-shot (_type_) projectile) + (fac-gun-tower-method-36 (_type_) none) + (send-attack (_type_ process-focusable) none) + ) + ) + + +(deftype fac-gun-tower-break (process-drawable) + () + (:state-methods + idle + idle-stick + ) + ) + + +(deftype fac-gun-tower-base-broken (process-drawable) + () + (:state-methods + idle + ) + ) + + +(deftype hud-factory-damage (hud) + () + ) diff --git a/goal_src/jak3/levels/factory/factory-hud.gc b/goal_src/jak3/levels/factory/factory-hud.gc index 8324bba190..10da456ef8 100644 --- a/goal_src/jak3/levels/factory/factory-hud.gc +++ b/goal_src/jak3/levels/factory/factory-hud.gc @@ -7,3 +7,47 @@ ;; DECOMP BEGINS +(defmethod draw ((this hud-factory-damage)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + 256 + (+ (the int (* 50.0 (-> this offset))) 376) + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -71 -5) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-4 (fmax 0.0 (fmin 1.0 (the-as float (-> this values 0 current)))))) + (set! (-> this sprites 1 color x) (the int (* 255.0 (- 1.0 f0-4)))) + (set! (-> this sprites 1 color y) (the int (* 255.0 f0-4))) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* 35.5 f0-4)) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-factory-damage)) + (set! (-> this values 0 target) (the-as int (-> *game-info* health-bar-vehicle))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-factory-damage)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-vehicle-health-bar-01 factoryb-minimap))) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 3.0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/factory-manager.gc b/goal_src/jak3/levels/factory/factory-manager.gc index a92d61b702..c8f283eaee 100644 --- a/goal_src/jak3/levels/factory/factory-manager.gc +++ b/goal_src/jak3/levels/factory/factory-manager.gc @@ -5,5 +5,1904 @@ ;; name in dgo: factory-manager ;; dgos: LFACTORY +(define-extern *factory-fighter-trail* light-trail-composition) +(define-extern factory-fighter-spawn (function process factory-fighter)) + ;; DECOMP BEGINS +(deftype task-manager-factory-sky-battle (task-manager) + ((factory-sky-battle-entity entity-actor) + (check-timer time-frame) + (ended-timer time-frame) + (mission-complete-time time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (cur-group int8) + (hud-delay handle) + (sound-id sound-id) + (hud-damage handle) + (hint-given symbol) + ) + (:methods + (task-manager-factory-sky-battle-method-32 (_type_) none) + ) + ) + + +(define *fac-task-manager* (the-as task-manager-factory-sky-battle #f)) + +(define *fac-fighter-fired* (the-as time-frame 0)) + +(define *fac-wave* 0) + +(define *fac-shotsleft* 0) + +(deftype light-trail-tracker-vehicle (light-trail-tracker) + () + ) + + +(defmethod light-trail-tracker-method-17 ((this light-trail-tracker-vehicle) (arg0 process-focusable)) + #f + ) + +(if (or (zero? *factory-fighter-trail*) (!= loading-level global)) + (set! *factory-fighter-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *factory-fighter-trail* color-mode) (the-as uint 0)) + +(set! (-> *factory-fighter-trail* color-repeat-dist) 40960.0) + +(set! (-> *factory-fighter-trail* alpha-1-mode) (the-as uint 0)) + +(set! (-> *factory-fighter-trail* alpha-2-mode) (the-as uint 1)) + +(set! (-> *factory-fighter-trail* base-alpha) 1.0) + +(set! (-> *factory-fighter-trail* alpha-repeat-dist) 6144.0) + +(set! (-> *factory-fighter-trail* width-mode) (the-as uint 2)) + +(set! (-> *factory-fighter-trail* base-width) 2048.0) + +(set! (-> *factory-fighter-trail* width-repeat-dist) 20480.0) + +(set! (-> *factory-fighter-trail* uv-mode) (the-as uint 0)) + +(set! (-> *factory-fighter-trail* uv-repeat-dist) 16384000.0) + +(set! (-> *factory-fighter-trail* lie-mode) (the-as uint 0)) + +(set! (-> *factory-fighter-trail* max-age) (seconds 0.5)) + +(if #f + (set! (-> *factory-fighter-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *factory-fighter-trail* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *factory-fighter-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +(set! (-> *factory-fighter-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-red*)) + +(set! (-> *factory-fighter-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *factory-fighter-trail* alpha-curve-2) *curve-linear-up-red*) + +(set! (-> *factory-fighter-trail* zbuffer?) #f) + +(set! (-> *factory-fighter-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *factory-fighter-trail* use-tape-mode?) #f) + +(set! (-> *factory-fighter-trail* blend-mode) (the-as uint 1)) + +(set! (-> *factory-fighter-trail* frame-stagger) (the-as uint 5)) + +(defun fac-count-curves ((arg0 entity-actor)) + (let ((s4-0 (new 'stack 'curve)) + (v1-1 (entity-actor-lookup arg0 'path-actor 0)) + (gp-0 0) + ) + (if v1-1 + (set! arg0 v1-1) + ) + (dotimes (s3-0 666) + (if (get-curve-data! arg0 s4-0 'path 'path-k (the float s3-0)) + (+! gp-0 1) + ) + ) + gp-0 + ) + ) + +(define *fac-tmp-str* (new 'global 'string 128 (the-as string #f))) + +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +(defmethod init-paths-for-list! ((this factory-manager) (arg0 factory-pathlist) (arg1 string)) + (local-vars + (sv-144 entity) + (sv-160 int) + (sv-176 int) + (sv-192 int) + (sv-208 (function _varargs_ object)) + (sv-224 int) + (sv-240 string) + (sv-256 int) + (sv-272 (function _varargs_ object)) + (sv-288 int) + (sv-304 string) + (sv-320 int) + (sv-336 vector) + (sv-352 vector) + (sv-368 vector) + (sv-384 int) + (sv-400 (function _varargs_ object)) + (sv-416 int) + (sv-432 string) + (sv-448 float) + ) + (set! (-> arg0 npath) 0) + (set! (-> arg0 nloop) 0) + (let ((s3-0 (new 'stack 'curve))) + 0 + (let ((s2-0 1)) + 0 + 0 + (let ((s1-0 #f)) + (while (not s1-0) + (let ((s0-0 0)) + (clear *fac-tmp-str*) + (format *fac-tmp-str* "~S-~d" arg1 s2-0) + (if #f + (format 0 "String: ~A~%" *fac-tmp-str*) + ) + (set! sv-144 (entity-by-name *fac-tmp-str*)) + (+! s2-0 1) + (if (not sv-144) + (set! s1-0 #t) + ) + (set! sv-160 0) + (when sv-144 + (set! (-> this entity) (the-as entity-actor sv-144)) + (set! sv-160 (fac-count-curves (the-as entity-actor sv-144))) + (set! sv-176 0) + (while (< sv-176 sv-160) + (set! sv-192 (+ sv-176 (-> arg0 npath))) + (while (not (get-curve-data! sv-144 s3-0 'path 'path-k (the float s0-0))) + (+! s0-0 1) + ) + (set! (-> arg0 path sv-192) (new 'process 'curve-control this 'path (the float s0-0))) + (+! s0-0 1) + (logior! (-> arg0 path sv-192 flags) (path-control-flag display draw-line draw-point draw-text)) + (when #f + (set! sv-208 format) + (set! sv-224 0) + (set! sv-240 "Path ~d length ~M~%") + (set! sv-256 sv-192) + (let ((a3-3 (total-distance (-> arg0 path sv-192)))) + (sv-208 sv-224 sv-240 sv-256 a3-3) + ) + ) + (set! sv-336 (new 'stack-no-clear 'vector)) + (set! sv-352 (new 'stack-no-clear 'vector)) + (get-point-at-percent-along-path! (-> arg0 path sv-192) sv-336 0.0 'interp) + (get-point-at-percent-along-path! (-> arg0 path sv-192) sv-352 1.0 'interp) + (when #f + (set! sv-272 format) + (set! sv-288 0) + (set! sv-304 "Begin to end of path ~d is ~M~%") + (set! sv-320 sv-192) + (let ((a3-6 (vector-vector-distance sv-336 sv-352))) + (sv-272 sv-288 sv-304 sv-320 a3-6) + ) + ) + (when (>= 4.096 (vector-vector-distance-squared sv-336 sv-352)) + (if #f + (format 0 "Path idx ~d is a loop~%" sv-192) + ) + (logior! (-> arg0 inout sv-192 flags) (factory-inout-flag fi0)) + (set! (-> arg0 loops (-> arg0 nloop)) sv-192) + (+! (-> arg0 nloop) 1) + ) + (set! sv-176 (+ sv-176 1)) + ) + ) + ) + (+! (-> arg0 npath) sv-160) + ) + ) + ) + ) + (when #f + (if (<= (-> arg0 npath) 0) + (format 0 "No path found~%") + ) + ) + (dotimes (s5-1 (-> arg0 npath)) + (when (not (logtest? (-> arg0 inout s5-1 flags) (factory-inout-flag fi0))) + (let ((f28-0 40960000.0) + (s3-1 -1) + (s4-1 -1) + (f30-1 -1.0) + ) + 0.0 + 0.0 + (let ((s2-1 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + (s0-1 (new 'stack-no-clear 'vector)) + ) + (set! sv-368 (new 'stack-no-clear 'vector)) + (set! sv-384 0) + (while (< sv-384 (-> arg0 npath)) + (when (logtest? (-> arg0 inout sv-384 flags) (factory-inout-flag fi0)) + (get-point-at-percent-along-path! (-> arg0 path s5-1) s2-1 0.0 'interp) + (get-point-at-percent-along-path! (-> arg0 path s5-1) s1-1 1.0 'interp) + (if #f + (format 0 "Path idx ~d is an entrance~%" s5-1) + ) + (let ((f26-0 (path-control-method-25 (-> arg0 path sv-384) s2-1)) + (f24-0 (path-control-method-25 (-> arg0 path sv-384) s1-1)) + ) + (if #f + (format 0 "u1: ~f u2: ~f~%" f26-0 f24-0) + ) + (get-point-at-percent-along-path! (-> arg0 path sv-384) s0-1 f26-0 'interp) + (get-point-at-percent-along-path! (-> arg0 path sv-384) sv-368 f24-0 'interp) + (when #f + (set! sv-400 format) + (set! sv-416 0) + (set! sv-432 "Dist1: ~M Dist2: ~M~%") + (set! sv-448 (vector-vector-distance s2-1 s0-1)) + (let ((a3-12 (vector-vector-distance s1-1 sv-368))) + (sv-400 sv-416 sv-432 sv-448 a3-12) + ) + ) + (when (< (vector-vector-distance s2-1 s0-1) f28-0) + (set! s4-1 1) + (set! f28-0 (vector-vector-distance s2-1 s0-1)) + (set! s3-1 sv-384) + (set! f30-1 f26-0) + ) + (when (< (vector-vector-distance s1-1 sv-368) f28-0) + (set! s4-1 0) + (set! f28-0 (vector-vector-distance s1-1 sv-368)) + (set! s3-1 sv-384) + (set! f30-1 f24-0) + ) + ) + ) + (set! sv-384 (+ sv-384 1)) + ) + ) + (if #f + (format 0 "Best dist: ~M best loop: ~d Best pos: ~f EExit: ~d~%" f28-0 s3-1 f30-1 s4-1) + ) + (cond + ((>= 40960.0 f28-0) + (set! (-> arg0 inout s5-1 lpath) s3-1) + (set! (-> arg0 inout s5-1 lpos) f30-1) + (if (zero? s4-1) + (logior! (-> arg0 inout s5-1 flags) (factory-inout-flag fi1)) + ) + (if (= s4-1 1) + (logior! (-> arg0 inout s5-1 flags) (factory-inout-flag fi2)) + ) + ) + (else + (if #f + (format 0 "ERROR: Path could not be connected!~%") + ) + (set! (-> arg0 inout s5-1 lpath) 0) + (set! (-> arg0 inout s5-1 lpos) 0.0) + ) + ) + ) + ) + ) + #f + ) + +(defstate idle (factory-manager) + :virtual #t + :code (behavior () + (until #f + (while (or (<= (-> self fpath npath) 0) (<= (-> self tpath npath) 0)) + (suspend) + ) + (when (and (zero? (-> self player-born)) (and *target* (focus-test? *target* pilot))) + (set-time! (-> self player-born)) + (set! (-> self player-died) 0) + 0 + ) + (if (and (not *target*) (zero? (-> self player-died))) + (set-time! (-> self player-died)) + ) + (when (!= *fac-wave* (-> self cur-wave)) + (set! (-> self cur-wave) (the-as uint *fac-wave*)) + (if (= *fac-wave* 1) + (set! (-> self nfighters-total) (-> self nfighters-spawned)) + ) + ) + (when (and *target* + (< (-> self nfighters-spawned) (the-as uint 50)) + (< (-> self nfighters-total) (the-as uint 50)) + (focus-test? *target* pilot) + (> (-> self tpath npath) 0) + (time-elapsed? (-> self fighter-spawned) (seconds 0.2)) + (time-elapsed? (-> self fighter-killed) (seconds 0.2)) + ) + (set-time! (-> self fighter-spawned)) + (factory-fighter-spawn self) + (+! (-> self nfighters-spawned) 1) + (+! (-> self nfighters-total) 1) + ) + (when (and *target* + (< (-> self ntanks-spawned) (the-as uint 4)) + (> (-> self fpath npath) 0) + (focus-test? *target* pilot) + (time-elapsed? (-> self tank-spawned) (seconds 2)) + ) + (set-time! (-> self tank-spawned)) + (fac-robotank-spawn self) + (+! (-> self ntanks-spawned) 1) + ) + (suspend) + ) + #f + ) + ) + +;; WARN: Return type mismatch symbol vs none. +;; WARN: Function (method 15 factory-manager) has a return type of none, but the expression builder found a return statement. +(defmethod factory-manager-method-15 ((this factory-manager)) + (dotimes (v1-0 (-> this fpath npath)) + (if (or (zero? (-> this fpath path v1-0)) + (logtest? (-> this fpath path v1-0 flags) (path-control-flag not-found)) + ) + (return #f) + ) + ) + #t + (none) + ) + +(deftype factory-fighter-path (process-drawable) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this factory-fighter-path) (arg0 entity-actor)) + (cleanup-for-death this) + ) + +(deftype factory-tanks-path (process-drawable) + () + ) + + +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this factory-tanks-path) (arg0 entity-actor)) + (cleanup-for-death this) + ) + +(defbehavior factory-manager-init-by-other factory-manager ((arg0 level)) + (set! (-> self level) arg0) + (set! (-> self player-died) 0) + (set! (-> self player-born) 0) + (set! (-> self nfighters-spawned) (the-as uint 0)) + (set! (-> self nfighters-total) (the-as uint 0)) + (set! (-> self cur-wave) (the-as uint 0)) + (init-paths-for-list! self (-> self fpath) "factory-fighter-path") + (init-paths-for-list! self (-> self tpath) "factory-tanks-path") + (go-virtual idle) + ) + +(defmethod relocate ((this factory-manager) (offset int)) + (dotimes (v1-0 (-> this fpath npath)) + (if (nonzero? (-> this fpath path v1-0)) + (&+! (-> this fpath path v1-0) offset) + ) + ) + (dotimes (v1-3 (-> this tpath npath)) + (if (nonzero? (-> this tpath path v1-3)) + (&+! (-> this tpath path v1-3) offset) + ) + ) + (call-parent-method this offset) + ) + +(defun factory-manager-start ((arg0 level)) + (kill-by-type factory-manager *active-pool*) + (process-spawn factory-manager arg0 :name "factory-manager" :to *entity-pool*) + 0 + (none) + ) + +(define *fac-fighter-rigid-body-constants* + (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.5 + :inv-mass 0.6666667 + :linear-damping 0.97 + :angular-damping 0.94 + :bounce-factor 0.75 + :friction-factor 0.99 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2.5) (meters 5) (meters 2.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 20) + :idle-distance (meters 200) + :attack-force-scale 2.0 + ) + :name '*fac-fighter-rigid-body-constants* + ) + ) + +(defskelgroup skel-factory-fighter kg-fighter kg-fighter-lod0-jg kg-fighter-idle-ja + ((kg-fighter-lod0-mg (meters 20)) (kg-fighter-lod1-mg (meters 40)) (kg-fighter-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defskelgroup skel-fac-fighter-explode kg-fighter kg-fighter-explode-lod0-jg kg-fighter-explode-idle-ja + ((kg-fighter-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(define *fac-fighter-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defun fighter-best-birth-path ((arg0 factory-manager)) + (local-vars (v0-2 int)) + (let ((f30-0 409600000.0)) + 0 + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (set! (-> s5-0 quad) (-> *target* control trans quad)) + (dotimes (s4-0 (-> arg0 fpath npath)) + (when (logtest? (-> arg0 fpath inout s4-0 flags) (factory-inout-flag fi1)) + (get-point-at-percent-along-path! (-> arg0 fpath path s4-0) s5-0 0.0 'interp) + (let ((f0-2 (vector-vector-distance s5-0 (-> *target* control trans)))) + (vector-! s5-0 s5-0 (-> *target* control trans)) + (let ((f1-1 (vector-dot s5-0 (-> *target* node-list data 0 bone transform fvec)))) + (if (and (>= f30-0 f0-2) (>= f1-1 0.0)) + (set! f30-0 f0-2) + ) + ) + ) + ) + ) + ) + ) + (until (logtest? (-> arg0 fpath inout v0-2 flags) (factory-inout-flag fi1)) + (set! v0-2 (rand-vu-int-range 0 (+ (-> arg0 fpath npath) -1))) + ) + v0-2 + ) + +(defun fighter-birth-path ((arg0 factory-manager)) + (local-vars (v0-0 int)) + 0 + (until (logtest? (-> arg0 fpath inout v0-0 flags) (factory-inout-flag fi1)) + (set! v0-0 (rand-vu-int-range 0 (+ (-> arg0 fpath npath) -1))) + ) + v0-0 + ) + +(defbehavior factory-fighter-standard-event-handler factory-fighter ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched 'attack) + (when (!= (-> arg0 type) guard-shot) + (when (-> self engine-sound-playing?) + (sound-stop (-> self engine-sound)) + (set! (-> self engine-sound-playing?) #f) + ) + (if (< (rand-vu) 0.2) + (go-virtual dive) + (go-virtual explode) + ) + ) + ) + ) + ) + +(defstate idle (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual flying) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod deactivate ((this factory-fighter)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (remove-from-process *part-engine* this) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound) (new 'static 'sound-id)) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +(defmethod fire-shot ((this factory-fighter)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (let ((v1-4 s5-0)) + (let ((a0-3 (-> this root trans))) + (let ((a1-1 (-> this forw))) + (let ((a2-1 17203.2)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-1 quad)) + ) + (.lvf vf4 (&-> a0-3 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-4 quad) vf6) + ) + (let ((a1-2 s5-0)) + (let ((v1-5 s5-0)) + (let ((a0-4 (-> this upvc))) + (let ((a2-3 2252.8)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-2 quad) vf6) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'get-vehicle) + (let ((a0-7 (the-as vehicle (send-event-function *target* a1-3)))) + (when a0-7 + (vector-float*! s3-0 (-> a0-7 rbody lin-velocity) 0.4) + (vector+! s4-0 s4-0 s3-0) + (sound-play "fighter-fire") + ) + ) + ) + (when #t + (rand-vu-sphere-point-uniform! s3-0 (* 61440.0 (rand-vu))) + (vector+! s4-0 s4-0 s3-0) + ) + ) + (spawn-ffight-projectile this s5-0 s4-0 819200.0 #f) + ) + ) + ) + ) + ) + +(defmethod factory-fighter-method-62 ((this factory-fighter) (arg0 symbol)) + (when (>= (- (current-time) (-> this red-tip-change-time)) 0) + (set! (-> this red-tip-on) (not (-> this red-tip-on))) + (set! (-> this red-tip-change-time) (+ (current-time) (seconds 0.5))) + (set! arg0 #t) + ) + (when (and arg0 (logtest? (-> this draw status) (draw-control-status on-screen))) + (remove-from-process *part-engine* this) + (if (-> this red-tip-on) + (add-connection *part-engine* this 5 this 2794 (new 'static 'vector :y 2252.8 :z 4505.6 :w 819200.0)) + (add-connection *part-engine* this 5 this 2794 (new 'static 'vector :y 2252.8 :z 4505.6 :w 819200.0)) + ) + ) + 0 + (none) + ) + +(defmethod factory-fighter-method-61 ((this factory-fighter)) + (local-vars (v1-64 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((f30-0 (seconds-per-frame))) + 1.0 + (-> this path-pos) + (let* ((s5-0 (ppointer->process (-> this parent))) + (f0-2 f30-0) + (f28-0 (/ 1.0 f0-2)) + ) + (set! (-> this path-pos) + (path-control-method-26 (-> s5-0 fpath path (-> this path-idx)) (-> this path-pos) (* 143360.0 f30-0)) + ) + (when (>= (-> this path-pos) 1.0) + (set! (-> this newpath) 2) + (cond + ((logtest? (-> s5-0 fpath inout (-> this path-idx) flags) (factory-inout-flag fi0)) + (set! (-> this path-pos) 0.0) + (vector-reset! (-> this forw)) + (vector-reset! (-> this upvc)) + ) + ((>= (-> s5-0 fpath inout (-> this path-idx) lpath) 0) + (set! (-> this path-pos) (-> s5-0 fpath inout (-> this path-idx) lpos)) + (set! (-> this path-idx) (-> s5-0 fpath inout (-> this path-idx) lpath)) + (vector-reset! (-> this forw)) + (vector-reset! (-> this upvc)) + ) + (else + (set! (-> this disappear) #t) + ) + ) + ) + (set! (-> this ppos quad) (-> this root trans quad)) + (get-point-at-percent-along-path! + (-> s5-0 fpath path (-> this path-idx)) + (-> this root trans) + (-> this path-pos) + 'interp + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-! s2-0 (-> this root trans) (-> this ppos)) + (vector-float*! s2-0 s2-0 f28-0) + (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-normalize! s4-0 1.0) + (vector-! s3-0 s2-0 (-> this pvel)) + (set! (-> this pvel quad) (-> s2-0 quad)) + (vector-float*! s3-0 s3-0 (* 0.000016276043 f28-0)) + (cond + ((< 0.0 (-> this blendpath)) + (let ((v1-52 (new 'stack-no-clear 'vector))) + (vector-float*! s3-0 s3-0 (- 1.0 (-> this blendpath))) + (vector-float*! v1-52 (-> this pacc) (-> this blendpath)) + (vector+! s3-0 s3-0 v1-52) + ) + (set! (-> this blendpath) (fmax 0.0 (- (-> this blendpath) (* 4.0 f30-0)))) + ) + ((zero? (-> this newpath)) + (set! (-> this pacc quad) (-> s3-0 quad)) + ) + (else + (set! (-> s3-0 quad) (-> this pacc quad)) + (+! (-> this newpath) -1) + (if (zero? (-> this newpath)) + (set! (-> this blendpath) 1.0) + ) + ) + ) + (let ((f0-22 0.0)) + (.lvf vf1 (&-> s2-0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-64 vf1) + (if (>= f0-22 v1-64) + (vector-reset! s3-0) + ) + ) + (vector+! s5-1 *up-vector* s3-0) + (vector-normalize! s5-1 1.0) + (forward-up->quaternion (-> this root quat) s4-0 s5-1) + (set! (-> this forw quad) (-> s4-0 quad)) + (set! (-> this upvc quad) (-> s5-1 quad)) + ) + ) + ) + (transform-post) + (none) + ) + ) + +(defstate flying (factory-fighter) + :virtual #t + :event factory-fighter-standard-event-handler + :enter (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop!) :frame-num 0.0) + ) + :trans (behavior () + (factory-fighter-method-62 self #f) + (new 'stack-no-clear 'vector) + 0.0 + (let ((s5-0 (new 'stack-no-clear 'matrix)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (if (-> self disappear) + (go-virtual die) + ) + (quaternion->matrix s5-0 (-> self root quat)) + (set-vector! s4-0 0.0 4096.0 -8192.0 1.0) + (vector-rotate*! s4-0 s4-0 s5-0) + (vector+! gp-0 gp-0 s4-0) + ) + (send-event (handle->process (-> self light-trail)) 'notice 'add-crumb-pos gp-0) + ) + (when (time-elapsed? (-> self last-snd-cmd) (seconds 0.1)) + (set! (-> self engine-sound-playing?) #t) + (sound-play-by-name + (static-sound-name "fighter-engine") + (-> self engine-sound) + 1024 + (the int (* 1524.0 (doppler-pitch-shift (-> self root trans) (-> self pvel)))) + 0 + (sound-group) + #t + ) + (set-time! (-> self last-snd-cmd)) + ) + ) + :code (behavior () + (local-vars (v1-12 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (until #f + (when (and *target* (time-elapsed? (-> self last-fire) (seconds 2)) (time-elapsed? *fac-fighter-fired* (seconds 1))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + (let ((v1-9 s5-0)) + (let ((a0-4 (-> self root trans))) + (let ((a1-0 (-> self forw))) + (let ((a2-1 17203.2)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-0 quad)) + ) + (.lvf vf4 (&-> a0-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-9 quad) vf6) + ) + (let ((a1-1 s5-0)) + (let ((v1-10 s5-0)) + (let ((a0-5 (-> self upvc))) + (let ((a2-3 2252.8)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-1 quad) vf6) + ) + (.lvf vf1 (&-> gp-0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-12 vf1) + v1-12 + (vector-! gp-0 (get-trans *target* 3) s5-0) + ) + (vector-normalize! gp-0 1.0) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< 0.8 (vector-dot (-> self forw) gp-0)) + (< (vector-vector-distance (-> *target* control trans) (-> self root trans)) 491520.0) + (< 163840.0 (vector-vector-distance (-> *target* control trans) (-> self root trans))) + ) + (fire-shot self) + (set-time! (-> self last-fire)) + (set! *fac-fighter-fired* (current-time)) + ) + ) + ) + (-> self skel root-channel 0) + (suspend) + ) + #f + ) + ) + :post (behavior () + (factory-fighter-method-61 self) + ) + ) + +(defstate dive (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (cond + ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + ) + (set! (-> self rot-vel) (rand-vu-float-range -910.2222 910.2222)) + (set! (-> self rot-acc) (rand-vu-float-range -3640.889 3640.889)) + (sound-play "fighter-explode") + (let ((gp-3 (new 'stack-no-clear 'vector))) + (rand-vu-sphere-point-uniform! gp-3 20480.0) + (vector+! (-> self pvel) (-> self pvel) gp-3) + ) + ) + :trans (behavior () + (when (not (time-elapsed? (-> self state-time) (seconds 1))) + ) + (if (time-elapsed? (-> self state-time) (seconds 3)) + (go-virtual explode) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((a0-0 (new 'stack-no-clear 'vector)) + (f0-0 (seconds-per-frame)) + ) + (set-vector! (-> self pacc) 0.0 -81920.0 0.0 1.0) + (vector-float*! a0-0 (-> self pacc) f0-0) + (vector+! (-> self pvel) (-> self pvel) a0-0) + (vector-float*! v1-0 (-> self pvel) f0-0) + ) + (vector+! (-> self root trans) (-> self root trans) v1-0) + ) + (quaternion-rotate-local-z! (-> self root quat) (-> self root quat) (-> self rot-vel)) + (+! (-> self rot-vel) (* (-> self rot-acc) (seconds-per-frame))) + (set! (-> self rot-vel) (fmax -5461.3335 (fmin 5461.3335 (-> self rot-vel)))) + (transform-post) + ) + ) + +(defstate explode (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (remove-from-process *part-engine* self) + (set! (-> self root root-prim local-sphere w) 491520.0) + (cond + ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + ) + (sound-play "fighter-explode") + ) + :trans (behavior () + '() + ) + :code (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 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((a0-1 (-> gp-0 fountain-rand-transv-lo))) + (let ((a1-2 (-> self root trans))) + (let ((a2-1 *up-vector*)) + (let ((a3-1 2048.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> a1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-1 quad) vf6) + ) + (let ((a2-2 v1-1)) + (let ((a0-2 (-> self pvel))) + (let ((a1-3 *up-vector*)) + (let ((a3-3 40960.0)) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-2 quad) vf6) + ) + (let ((a2-3 (-> gp-0 fountain-rand-transv-lo))) + (let ((a0-3 v1-1)) + (let ((a1-4 *identity-vector*)) + (let ((a3-5 -204800.0)) + (.mov vf7 a3-5) + ) + (.lvf vf5 (&-> a1-4 quad)) + ) + (.lvf vf4 (&-> a0-3 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-3 quad) vf6) + ) + (let ((a1-5 (-> gp-0 fountain-rand-transv-hi))) + (let ((a0-4 *identity-vector*)) + (let ((a2-5 204800.0)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-5 quad) vf6) + ) + ) + (set! (-> gp-0 gravity) -122880.0) + (set! (-> gp-0 rot-speed) 16.0) + (set! (-> gp-0 friction) 1.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-fighter-explode" (the-as (pointer level) #f)) + 7 + gp-0 + *fac-fighter-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((v1-10 (ppointer->process (-> self parent)))) + (+! (-> v1-10 nfighters-spawned) -1) + ) + (while (-> self child) + (suspend) + ) + ) + ) + :post (behavior () + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((a0-0 (new 'stack-no-clear 'vector)) + (f0-0 (seconds-per-frame)) + ) + (set-vector! (-> self pacc) 0.0 -327680.0 0.0 1.0) + (vector-float*! a0-0 (-> self pacc) f0-0) + (vector+! (-> self pvel) (-> self pvel) a0-0) + (vector-float*! v1-0 (-> self pvel) f0-0) + ) + (vector+! (-> self root trans) (-> self root trans) v1-0) + ) + (transform-post) + ) + ) + +(defstate die (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (while (not (time-elapsed? (-> self state-time) (seconds 2))) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-28 (ppointer->process (-> self parent)))) + (+! (-> v1-28 nfighters-spawned) -1) + ) + ) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod init-collision! ((this factory-fighter)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 10240.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) (the-as collide-shape-moving s5-0)) + ) + (set! (-> this root event-self) 'touched) + (none) + ) + +(defmethod get-trans ((this factory-fighter) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +(defbehavior factory-fighter-init-by-other factory-fighter () + (init-collision! self) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self level) (level-get *level* 'factoryb)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-factory-fighter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! self *fac-fighter-rigid-body-constants*) + (set! (-> self path-idx) (fighter-birth-path (ppointer->process (-> self parent)))) + (vector-reset! (-> self pacc)) + (set! (-> self blendpath) 0.0) + (set! (-> self newpath) 2) + (set! (-> self path-pos) 0.0) + (set! (-> self rot-vel) 0.0) + (set! (-> self rot-acc) 0.0) + (set! (-> self disappear) #f) + (set-time! (-> self last-fire)) + (set! (-> self turret-gun) 5) + (set! (-> self engine-sound) (new-sound-id)) + (set! (-> self engine-sound-playing?) #f) + (set-time! (-> self last-snd-cmd)) + (set! (-> self red-tip-on) #f) + (set-time! (-> self red-tip-change-time)) + (factory-fighter-method-62 self #t) + (set! (-> self draw light-index) (the-as uint 10)) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> gp-1 tracked-obj) (process->handle self)) + (set! (-> gp-1 appearance) *factory-fighter-trail*) + (set! (-> gp-1 max-num-crumbs) (the int (* 0.25 (the float (-> gp-1 appearance max-age))))) + (set! (-> gp-1 track-immediately?) #t) + (let* ((v1-38 + (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-1 (get-process *default-dead-pool* light-trail-tracker-vehicle (+ v1-38 8192) 1)) + ) + (set! (-> self light-trail) + (ppointer->handle (when s5-1 + (let ((t9-13 (method-of-type process activate))) + (t9-13 s5-1 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 light-trail-tracker-init-by-other gp-1) + (-> s5-1 ppointer) + ) + ) + ) + ) + ) + (go-virtual idle) + ) + +;; WARN: Return type mismatch process vs factory-fighter. +(defun factory-fighter-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn factory-fighter :name "factory-fighter" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as factory-fighter gp-0) + ) + ) + +(defskelgroup skel-fac-target fac-target fac-target-lod0-jg fac-target-idle-ja + ((fac-target-lod0-mg (meters 20)) (fac-target-lod1-mg (meters 40)) (fac-target-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(defskelgroup skel-fac-target-explode fac-target fac-target-explode-lod0-jg fac-target-explode-idle-ja + ((fac-target-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +(define *fac-target-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defmethod init-from-entity! ((this fac-target) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 5) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 16384.0 16384.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-10 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this root event-self) 'touched) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-target" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this light-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 5)) + (set! (-> this draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw lod-set lod 1 dist) 819200.0) + (set! (-> this draw lod-set lod 2 dist) 1024000.0) + (let ((a1-11 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-25 0)) + (if #t + (set! v1-25 (logior v1-25 1)) + ) + (set! (-> a1-11 sync-type) 'sync-paused) + (set! (-> a1-11 sync-flags) (the-as sync-flags v1-25)) + ) + (set! (-> a1-11 entity) (-> this entity)) + (set! (-> a1-11 period) (the-as uint 1500)) + (set! (-> a1-11 percent) 0.0) + (set! (-> a1-11 pause-in) 0.0) + (set! (-> a1-11 pause-out) 0.0) + (initialize! (-> this sync) a1-11) + ) + (fac-target-method-33 this) + (cond + ((task-node-closed? (game-task-node factory-sky-battle-wave2)) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (let ((v1-34 (-> this root root-prim))) + (set! (-> v1-34 prim-core collide-as) (collide-spec)) + (set! (-> v1-34 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> this draw status) (draw-control-status no-draw)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) + ) + (else + (go (method-of-object this retracted)) + ) + ) + ) + +(defstate die-fast (fac-target) + :virtual #t + :code nothing + ) + +(defun hack-wave () + (logtest? (current-time) 64) + ) + +(defmethod fac-target-method-33 ((this fac-target)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + 0 + (none) + ) + +(defmethod fac-target-method-34 ((this fac-target)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 2 0) + 0 + (none) + ) + +(defbehavior fac-target-standard-event-handler fac-target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die-fast) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual die-fast) + ) + (('touched) + (let ((gp-0 arg0)) + (when (if (type? gp-0 vehicle) + gp-0 + ) + (sound-play "light-explode" :position (-> self root trans)) + (go-virtual retract) + ) + ) + ) + (('attack) + (let ((v1-8 (the-as attack-info (-> arg3 param 1)))) + (when (or (and (logtest? (-> v1-8 mask) (attack-mask attacker)) + (= (-> (handle->process (-> v1-8 attacker)) type) target) + ) + (let ((gp-2 arg0)) + (if (type? gp-2 warf-projectile) + gp-2 + ) + ) + ) + (sound-play "light-explode" :position (-> self root trans)) + (go-virtual retract) + ) + ) + ) + ) + ) + +(defstate idle (fac-target) + :virtual #t + :event fac-target-standard-event-handler + :enter (behavior () + (add-connection *part-engine* self 5 self 2795 (new 'static 'vector :z 24576.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :x 8192.0 :z 16384.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :x -8192.0 :z 16384.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :y 8192.0 :z 16384.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :y -8192.0 :z 16384.0 :w 1638400.0)) + (ja :group! fac-target-desend-ja :num! max) + (sync-now! (-> self sync) 0.0) + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 148) (the-as int #f) (the-as vector #t) 0)) + ) + :trans (behavior () + (ja :num! (seek! 0.0 0.5)) + ) + :code (behavior () + (until #f + (quaternion-axis-angle! + (-> self light-jm quat) + 0.0 + 0.0 + 1.0 + (the float (sar (shl (* 100 (current-time)) 48) 48)) + ) + (suspend) + ) + #f + ) + :post transform-post + ) + +(defstate retract (fac-target) + :virtual #t + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (fac-target-method-33 self) + (set-time! (-> self state-time)) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self node-list data 3 bone transform))) + (vector-float*! s5-0 (-> s4-0 fvec) (* 4096.0 (rand-vu-float-range 20.0 30.0))) + (let ((v1-20 (-> gp-0 fountain-rand-transv-lo))) + (let ((a0-7 (-> self root trans))) + (let ((a1-3 (-> s4-0 fvec))) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-7 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-20 quad) vf6) + ) + ) + (let ((a1-4 (-> gp-0 fountain-rand-transv-lo))) + (let ((v1-21 s5-0)) + (let ((a0-8 *identity-vector*)) + (let ((a2-5 -204800.0)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-8 quad)) + ) + (.lvf vf4 (&-> v1-21 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-4 quad) vf6) + ) + (let ((a0-9 (-> gp-0 fountain-rand-transv-hi))) + (let ((v1-22 *identity-vector*)) + (let ((a1-6 204800.0)) + (.mov vf7 a1-6) + ) + (.lvf vf5 (&-> v1-22 quad)) + ) + (.lvf vf4 (&-> s5-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-9 quad) vf6) + ) + ) + (set! (-> gp-0 gravity) -122880.0) + (set! (-> gp-0 rot-speed) 16.0) + (cond + ((logtest? (-> *part-group-id-table* 733 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 733)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 733)) + ) + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-target-explode" (the-as (pointer level) #f)) + 9 + gp-0 + *fac-target-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + ) + ) + :trans (behavior () + (ja :num! (seek! 0.0 0.5)) + ) + :code sleep-code + :post transform-post + ) + +(defstate retracted (fac-target) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die-fast) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (cleanup-for-death self) + (let* ((a0-5 self) + (t9-1 (method-of-object a0-5 fac-target-method-34)) + ) + (t9-1 a0-5) + ) + (go-virtual die-fast) + ) + (('trigger) + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (logior! (-> self draw status) (draw-control-status on-screen)) + (let* ((a0-12 self) + (t9-3 (method-of-object a0-12 fac-target-method-34)) + ) + (t9-3 a0-12) + ) + (go-virtual idle) + ) + ) + ) + ) + :enter (behavior () + (when (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (ja :group! fac-target-desend-ja :num! max) + (fac-target-method-33 self) + (transform-post) + ) + :trans (behavior () + (ja :num-func num-func-identity :frame-num max) + ) + :code sleep-code + ) + +(defstate explode (fac-target) + :virtual #t + :trans (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + ) + :code sleep-code + :post ja-post + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this fac-target)) + (let ((v0-0 0)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (set! v0-0 (logior v0-0 40)) + ) + (the-as search-info-flag v0-0) + ) + ) + +(defmethod get-trans ((this fac-target) (arg0 int)) + "Get the `trans` for this process." + (let ((v1-0 (-> this root))) + (cond + ((= arg0 3) + (let ((a2-1 (-> this node-list data 5 bone transform)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! gp-0 0.0 0.0 20480.0 1.0) + (vector-matrix*! gp-0 gp-0 a2-1) + (set! (-> gp-0 w) 20480.0) + gp-0 + ) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + +;; WARN: Return type mismatch process-focusable vs fac-target. +(defmethod relocate ((this fac-target) (offset int)) + (if (nonzero? (-> this light-jm)) + (&+! (-> this light-jm) offset) + ) + (the-as fac-target ((method-of-type process-focusable relocate) this offset)) + ) + +(defmethod task-manager-method-26 ((this task-manager-factory-sky-battle)) + (with-pp + (when (time-elapsed? (-> this check-timer) (seconds 0.1)) + (if (not (-> this factory-sky-battle-entity)) + (task-manager-factory-sky-battle-method-32 this) + ) + (when (not (-> this hint-given)) + (set! (-> this hint-given) #t) + (talker-spawn-func (-> *talker-speech* 101) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (< (-> this cur-group) (-> this actor-group-count)) + (let ((s5-1 (-> this actor-group (-> this cur-group)))) + (dotimes (s4-1 (-> s5-1 length)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-3 send-event-function) + (v1-21 (-> s5-1 data s4-1 actor)) + ) + (t9-3 + (if v1-21 + (-> v1-21 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + (when (and (zero? (-> this cur-group)) + (> (-> this actor-group-count) 0) + (task-node-closed? (game-task-node factory-sky-battle-wave1)) + ) + (let ((s5-2 (-> this actor-group 0))) + (dotimes (s4-2 (-> s5-2 length)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'die-fast) + (let ((t9-5 send-event-function) + (v1-36 (-> s5-2 data s4-2 actor)) + ) + (t9-5 + (if v1-36 + (-> v1-36 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + (set! (-> this cur-group) 1) + ) + (when (and (= (-> this cur-group) 1) + (> (-> this actor-group-count) 0) + (task-node-closed? (game-task-node factory-sky-battle-wave2)) + ) + (let ((s5-3 (-> this actor-group 1))) + (dotimes (s4-3 (-> s5-3 length)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'die-fast) + (let ((t9-7 send-event-function) + (v1-53 (-> s5-3 data s4-3 actor)) + ) + (t9-7 + (if v1-53 + (-> v1-53 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + (set! (-> this cur-group) 2) + ) + (set! *fac-wave* (-> this cur-group)) + (let ((s5-4 0)) + (when (> (-> this actor-group-count) 0) + (dotimes (v1-63 (-> this actor-group (-> this cur-group) length)) + (if (not (logtest? (-> this actor-group (-> this cur-group) data v1-63 actor extra perm status) + (entity-perm-status subtask-complete) + ) + ) + (+! s5-4 1) + ) + ) + ) + (if (and (> (-> this actor-group-count) 0) + (= (-> this cur-group) 2) + (zero? s5-4) + (zero? (-> this mission-complete-time)) + ) + (set-time! (-> this mission-complete-time)) + ) + (if (and (nonzero? (-> this mission-complete-time)) + (time-elapsed? (-> this mission-complete-time) (seconds 4)) + (not (task-node-closed? (game-task-node factory-sky-battle-resolution))) + *target* + (not (logtest? (-> *target* focus-status) (focus-status dead))) + ) + (send-event this 'complete) + ) + (when (and (> (-> this actor-group-count) 0) (= (-> this cur-group) 1) (zero? s5-4)) + (task-node-close! (game-task-node factory-sky-battle-wave2) 'event) + (set! (-> this cur-group) 2) + ) + (when (and (> (-> this actor-group-count) 0) (zero? (-> this cur-group)) (zero? s5-4)) + (task-node-close! (game-task-node factory-sky-battle-wave1) 'event) + (set! (-> this cur-group) 1) + ) + (when (!= (-> *game-info* counter) (the float s5-4)) + (if (zero? (-> this hud-delay)) + (set! (-> this hud-delay) (the-as handle (current-time))) + ) + (when (or (time-elapsed? (the-as int (-> this hud-delay)) (seconds 0.5)) (= (-> *game-info* counter) 0.0)) + (cond + ((< 0.0 (-> *game-info* counter)) + (sound-play "hud-chime") + (+! (-> *game-info* counter) -1.0) + ) + (else + (if (= (-> this cur-group) 1) + (sound-play "hud-chime2") + ) + (if (= (-> this cur-group) 2) + (sound-play "hud-chime3") + ) + (set! (-> *game-info* counter) (the float s5-4)) + ) + ) + (set! (-> this hud-delay) (new 'static 'handle)) + 0 + ) + ) + ) + (set-time! (-> this check-timer)) + ) + 0 + (none) + ) + ) + +(defmethod task-manager-factory-sky-battle-method-32 ((this task-manager-factory-sky-battle)) + (local-vars (sv-16 res-tag)) + (let ((a0-2 (entity-by-name "factory-sky-battle-manager-1"))) + (when a0-2 + (set! (-> this factory-sky-battle-entity) (the-as entity-actor a0-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data a0-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + ) + (else + (format 0 "ERROR: task-manager-nest-cocoons: nst-cocoon-manager entity missing cocoon actor-group!~%") + ) + ) + ) + (set! (-> this cur-group) 0) + (set! (-> *game-info* counter) 0.0) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-fac-manager :init hud-init-by-other :name "hud-fac-manager" :to this)) + ) + (set! (-> this hud-damage) + (ppointer->handle + (process-spawn hud-factory-damage :init hud-init-by-other :name "hud-factory-damage" :to this) + ) + ) + ) + ) + (none) + ) + +(defstate resolution (task-manager-factory-sky-battle) + :virtual #t + :enter (behavior () + (send-event (handle->process (-> self hud-damage)) 'hide-and-die) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-factory-sky-battle)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (set-action! + *gui-control* + (gui-action stop) + (-> this sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this task-manager-factory-sky-battle)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'allow-look-around #f 0.0 0) + (set! (-> *game-info* counter) 0.0) + (set! *fac-task-manager* (the-as task-manager-factory-sky-battle (process->ppointer this))) + (set! (-> this factory-sky-battle-entity) #f) + (set! (-> this hud-damage) (the-as handle #f)) + (set! (-> this cur-group) 0) + (set! (-> this actor-group-count) 0) + (set! (-> this check-timer) (+ (current-time) (seconds 1))) + (set! (-> this hint-given) #f) + (kill-by-type fac-gun-tower-break *active-pool*) + (none) + ) + +(defmethod draw ((this hud-fac-manager)) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (cond + ((= *fac-wave* 2) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-fac-tower-01 factoryb-minimap))) + (set! (-> this sprites 0 angle) 16384.0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 455 225) + (set-hud-piece-position! (the-as hud-sprite (-> this strings 0 pos)) 488 257) + ) + (else + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-fac-target-01 factoryb-minimap))) + (set! (-> this sprites 0 angle) 0.0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 488 225) + (set-hud-piece-position! (the-as hud-sprite (-> this strings 0 pos)) 488 257) + ) + ) + (dotimes (s5-1 8) + (set-hud-piece-position! (-> this sprites (+ s5-1 1)) (+ (* 11 (logand s5-1 3)) 430) (+ (if (< 3 s5-1) + 30 + 0 + ) + 145 + ) + ) + (set! (-> this sprites (+ s5-1 1) scale-x) (if (< s5-1 *fac-shotsleft*) + 0.8 + 0.0 + ) + ) + (set! (-> this sprites (+ s5-1 1) scale-y) (if (< s5-1 *fac-shotsleft*) + 0.8 + 0.0 + ) + ) + (set! (-> this sprites (+ s5-1 1) angle) 16384.0) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-fac-manager)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-fac-manager)) + (set! (-> this level) (level-get *level* 'factoryb)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-fac-target-01 factoryb-minimap))) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 0.66) + (set! (-> this sprites 0 scale-y) 0.66) + (dotimes (s5-0 8) + (set! (-> this sprites (+ s5-0 1) tid) (the-as texture-id (get-texture hud-torpedo factoryb-minimap))) + (set! (-> this sprites (+ s5-0 1) flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites (+ s5-0 1) angle) 16384.0) + (set! (-> this sprites (+ s5-0 1) scale-x) 1.0) + (set! (-> this sprites (+ s5-0 1) scale-y) 1.0) + ) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + 0 + (none) + ) + +(defun factory-shotsleft ((arg0 int)) + (set! *fac-shotsleft* arg0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/factory-mood.gc b/goal_src/jak3/levels/factory/factory-mood.gc index aae02eed78..72a17ffa84 100644 --- a/goal_src/jak3/levels/factory/factory-mood.gc +++ b/goal_src/jak3/levels/factory/factory-mood.gc @@ -7,3 +7,91 @@ ;; DECOMP BEGINS +(deftype factory-states (structure) + ((light light-state :inline) + (blink0 float) + (blink1 float) + ) + ) + + +(defbehavior update-mood-factory time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> (the-as factory-states gp-1) blink0)) + (set! (-> arg0 times 7 w) (-> (the-as factory-states gp-1) blink1)) + (when (not (paused?)) + (let ((v1-10 (-> *display* part-clock frame-counter))) + (cond + ((< (* 0.2 (the float (mod v1-10 600))) 60.0) + (seek! (-> (the-as factory-states gp-1) blink0) 0.0 (* 0.5 (seconds-per-frame))) + (if (= (-> (the-as factory-states gp-1) blink1) 0.2) + (set! (-> (the-as factory-states gp-1) blink1) 1.0) + ) + (seek! (-> (the-as factory-states gp-1) blink1) 0.2 (* 2.0 (seconds-per-frame))) + ) + (else + (seek! (-> (the-as factory-states gp-1) blink0) 1.0 (* 0.5 (seconds-per-frame))) + (set! (-> (the-as factory-states gp-1) blink1) 0.2) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype factoryd-states (structure) + ((electricity electricity-state :inline) + ) + ) + + +(defbehavior update-mood-factoryd time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (let* ((a0-5 (-> *display* part-clock frame-counter)) + (v1-6 (mod a0-5 300)) + (s5-0 (mod a0-5 900)) + ) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-6)))))) + (set! (-> arg0 times 3 w) (if (< 450 s5-0) + 1.0 + 0.5 + ) + ) + ) + (update-mood-electricity arg0 4 0 0.8 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-factoryd-light! ((arg0 float)) + (let ((v1-1 (level-get *level* 'factoryd))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as factoryd-states v1-2) electricity scale) arg0) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/factory/factory-part.gc b/goal_src/jak3/levels/factory/factory-part.gc index ec64efc5ed..7a9f6e9dc3 100644 --- a/goal_src/jak3/levels/factory/factory-part.gc +++ b/goal_src/jak3/levels/factory/factory-part.gc @@ -5,5 +5,770 @@ ;; name in dgo: factory-part ;; dgos: FACC, FACTORYA +(define-extern *range-color-fact-big-torch-flame* curve-color-fast) +(define-extern *range-alpha-fact-big-torch-flame* curve2d-fast) +(define-extern *range-scale-fact-big-torch-flame-x* curve2d-fast) +(define-extern *range-scale-fact-big-torch-flame-y* curve2d-fast) +(define-extern *r-curve-fact-big-torch-flame* curve2d-fast) +(define-extern *g-curve-fact-big-torch-flame* curve2d-fast) +(define-extern *b-curve-fact-big-torch-flame* curve2d-fast) +(define-extern *curve-alpha-fact-big-torch-flame* curve2d-fast) +(define-extern *curve-fact-big-torch-flame-x* curve2d-fast) +(define-extern *curve-fact-big-torch-flame-y* curve2d-fast) + ;; DECOMP BEGINS +(defpartgroup group-kgtower-pulsating-red-light-1 + :id 784 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +(defpartgroup group-kgtower-pulsating-red-light-2 + :id 785 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2930 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +(defpartgroup group-kgtower-pulsating-red-light-3 + :id 786 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +(defpartgroup group-kgtower-pulsating-red-light-4 + :id 787 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +(defpartgroup group-kgtower-pulsating-red-light-5 + :id 788 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +(defpartgroup group-kgtower-pulsating-red-light-6 + :id 789 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000)) + ) + +(defpart 2929 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 225015.75)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 2931) + ) + ) + +(defpart 2931 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 2932) + ) + ) + +(defpart 2932 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 2933) + ) + ) + +(defpart 2933 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-kgtower-steady-red-light + :id 790 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2934 :flags (sp6))) + ) + +(defpart 2934 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-ctylights-steady-yellow-glow + :id 791 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2935 :flags (sp6))) + ) + +(defpart 2935 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-ctylights-steady-green-glow + :id 792 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2936 :flags (sp6))) + ) + +(defpart 2936 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 255.0) + (:b 20.0 20.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-kgtower-flashing-blue-light-1 + :id 793 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +(defpartgroup group-kgtower-flashing-blue-light-2 + :id 794 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +(defpartgroup group-kgtower-flashing-blue-light-3 + :id 795 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +(defpartgroup group-kgtower-flashing-blue-light-4 + :id 796 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +(defpartgroup group-kgtower-flashing-blue-light-5 + :id 797 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +(defpartgroup group-kgtower-flashing-blue-light-6 + :id 798 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000)) + ) + +(defpart 2937 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 0.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 225015.75)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 2938) + ) + ) + +(defpart 2938 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 2939) + ) + ) + +(defpart 2939 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 2940) + ) + ) + +(defpart 2940 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +(defpartgroup group-steady-blue-light + :id 799 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2941 :flags (sp6))) + ) + +(defpart 2941 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-kgtower-smokestack + :id 800 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2942) (sp-item 2943 :flags (sp6))) + ) + +(defpart 2943 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 2942 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:accel-z (meters 0.001) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 2944) + ) + ) + +(defpart 2944 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 2945)) + ) + +(defpart 2945 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 2946) + ) + ) + +(defpart 2946 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 2947) + ) + ) + +(defpart 2947 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +(defpartgroup group-kgtower-smoke :id 801 :bounds (static-bspherem 0 0 0 10) :parts ((sp-item 2948))) + +(defpart 2948 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 2949) + ) + ) + +(defpart 2949 + :init-specs ((:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 2950) + ) + ) + +(defpart 2950 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpartgroup group-citylights-oldslums + :id 802 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2951 :flags (sp6))) + ) + +(defpart 2951 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 20.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-citylights-newslums + :id 803 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2952 :flags (sp6))) + ) + +(defpart 2952 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 100.0 28.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +(defpartgroup group-mhtower-orange-glow + :id 804 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2953 :flags (sp6))) + ) + +(defpart 2953 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 16.0 4.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-mhtower-green-glowing-smoke + :id 805 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2954)) + ) + +(defpart 2954 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:y (meters 0)) + (:scale-x (meters 8) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.0033333334) (meters 0.023333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.026666667 0.026666667) + (:accel-y (meters 0) (meters -0.0001)) + (:accel-z (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 1)) + (:next-launcher 2955) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2955 + :init-specs ((:fade-a -0.006666667 -0.006666667)) + ) + +(defpartgroup group-fact-big-torch + :id 806 + :flags (sp0 sp4 sp11 sp12) + :bounds (static-bspherem 0 1 0 3) + :parts ((sp-item 2956 :fade-after (meters 500) :falloff-to (meters 600) :flags (sp7)) + (sp-item 2957 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 2958 :falloff-to (meters 60) :flags (sp7)) + ) + ) + +(defpart 2956 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'spt-birth-func-fact-torch) + (:num 4.0 1.0) + (:y (meters 0)) + (:scale-x (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.06666667) (meters -0.006666667)) + (:friction 0.99) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-fact-torch) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-z (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +(defun sparticle-torch-spline-align ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s5-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s5-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s5-0 w) 1.0) + (let ((f30-0 (-> arg2 flag-rot-sy z))) + 0.0 + (vector-normalize! s5-0 1.0) + 0.0 + (let ((a0-2 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-8 (vector-dot a0-2 s5-0))) + (vector-float*! v1-1 a0-2 f0-8) + ) + (vector-! s5-0 s5-0 v1-1) + ) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-0 s5-0 a2-2) + ) + (let* ((f0-16 (the float (sar (shl (the int (atan (-> s5-0 y) (* -1.0 (-> s5-0 x)))) 48) 48))) + (f0-20 (the float (sar (shl (the int (+ 16384.0 f0-16)) 48) 48))) + (t9-6 deg-seek) + (a0-7 f30-0) + (a1-11 f0-20) + (a2-3 (* 65536.0 (seconds-per-frame))) + (f0-23 (t9-6 a0-7 a1-11 a2-3)) + ) + (rot-to-particle f0-23 arg2 (the-as matrix a2-3)) + ) + ) + ) + 0 + (none) + ) + +(defun spt-func-fact-torch ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (live-func-curve arg0 arg1 (the-as vector arg2)) + (spt-func-relative-pos arg0 arg1 (the-as sprite-vec-data-3d arg2)) + (sparticle-torch-spline-align arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (none) + ) + +(defun spt-birth-func-fact-torch ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-curve (the-as int arg0) arg1 arg2) + (birth-func-flip-based-on-scale + arg0 + arg1 + (the-as sprite-vec-data-3d arg2) + (the-as sparticle-launcher arg3) + (the-as sparticle-launch-state arg4) + ) + (none) + ) + +(if #t + (set! *range-color-fact-big-torch-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :z 255.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 10.0 :y 1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-alpha-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 40.0 :y 100.0 :z 101.0 :w 102.0) + :one-over-x-deltas (new 'static 'vector :x 60.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-fact-big-torch-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -0.5001 :w -1.0) + :ys (new 'static 'vector :x -8.0 :y -5.0 :z 5.0 :w 8.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y -20.004002 :z 6.0012007 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-scale-fact-big-torch-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.5001 :w -1.0) + :ys (new 'static 'vector :x -6.0 :y -10.0 :z 6.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x -8.0 :y 159973.45 :z 8.0016 :w 1.0) + ) + ) + ) + +(if #t + (set! *r-curve-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :w 1.0) + ) + ) + ) + +(if #t + (set! *g-curve-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -1.9999994 :z -1.5000001 :w 1.0) + ) + ) + ) + +(if #t + (set! *b-curve-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.31 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0) + :one-over-x-deltas (new 'static 'vector :y -100.0001 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-alpha-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fact-big-torch-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 0.3 :y 0.6 :z 0.5 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y -1.0 :z -0.75000006 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fact-big-torch-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 0.5 :w 0.6) + :one-over-x-deltas (new 'static 'vector :x 0.4 :y 0.5 :z 0.3333334 :w 1.0) + ) + ) + ) + +(define *part-fact-big-torch-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.05) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf1 pcf2) + ) + ) + +(set! (-> *part-id-table* 2956 init-specs 15 initial-valuef) + (the-as float *part-fact-big-torch-flame-curve-settings*) + ) + +(set! (-> *part-fact-big-torch-flame-curve-settings* color-start) *range-color-fact-big-torch-flame*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* alpha-start) *range-alpha-fact-big-torch-flame*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-x-start) *range-scale-fact-big-torch-flame-x*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-y-start) *range-scale-fact-big-torch-flame-y*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* r-scalar) *r-curve-fact-big-torch-flame*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* g-scalar) *g-curve-fact-big-torch-flame*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* b-scalar) *b-curve-fact-big-torch-flame*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* a-scalar) *curve-alpha-fact-big-torch-flame*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-x-scalar) *curve-fact-big-torch-flame-x*) + +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-y-scalar) *curve-fact-big-torch-flame-y*) + +(defpart 2957 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.4) + (:y (meters 2)) + (:scale-x (meters 30) (meters 2)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 0.0) + (:a 24.0 8.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2958 + :init-specs ((:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:rot-x 8) + (:r 12288.0) + (:g 1638.4) + (:b 1638.4) + (:vel-y (meters 0.06666667)) + (:fade-b -1.3653333) + (:accel-y (meters 0.00066666666) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (distort launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 2959) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2959 + :init-specs ((:fade-b 1.3653333)) + ) diff --git a/goal_src/jak3/levels/factory/factory-scenes.gc b/goal_src/jak3/levels/factory/factory-scenes.gc index d954ba83b2..90d302b4c7 100644 --- a/goal_src/jak3/levels/factory/factory-scenes.gc +++ b/goal_src/jak3/levels/factory/factory-scenes.gc @@ -5,5 +5,1540 @@ ;; name in dgo: factory-scenes ;; dgos: FACTORYA +(define-extern *range-fac-dust-color* curve-color-fast) +(define-extern *range-fac-dust-alpha* curve2d-fast) +(define-extern *range-fac-dust-scale-x* curve2d-fast) +(define-extern *range-fac-dust-scale-y* curve2d-fast) +(define-extern *curve-fac-dust-alpha* curve2d-fast) +(define-extern *curve-fac-dust-scale-x* curve2d-fast) +(define-extern *curve-fac-dust-scale-y* curve2d-fast) + ;; DECOMP BEGINS +(define *war-factory-vehicle-mask* (the-as uint 0)) + +(define *war-factory-effects-mask* (the-as uint 0)) + +(load-scene (new 'static 'scene + :name "factory-sky-battle-intro-b" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-150" + :art-group "scenecamera" + :anim "factory-sky-battle-intro-b" + :parts 8 + :command-list '((0 + (fadein (frame-time-30 10)) + (kill "lfac-hanger-door-1") + (part-tracker + "group-fma-hellcat-heathaze-ground" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 297) + ) + (apply ,(lambda :behavior scene-player + () + (set-lfacrm1-door! 0.0) + (let ((v1-1 (level-get *level* 'lfaccity))) + (if v1-1 + (logclear! (-> v1-1 info level-flags) (level-flags use-camera-other)) + ) + ) + (none) + ) + ) + ) + (262 (part-tracker + "group-hellcat-thrusters-fire" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 262 285) + ) + ) + (266 (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 266 285) + ) + ) + (270 (part-tracker + "group-hellcat-thrusters-fire" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 270 285) + ) + ) + (286 + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 286 704) + ) + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 286 704) + ) + (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 286 400) + ) + ) + (297 (part-tracker + "group-fma-hellcat-heathaze" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 298 701) + ) + ) + (510 (apply ,(lambda :behavior scene-player () (none)))) + (690 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (701 (want-display 'factoryb 'display)) + (702 + (part-tracker + "group-hellcat-thrusters-follow" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 702 1000) + ) + (part-tracker + "group-hellcat-thrusters-follow" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 702 1000) + ) + ) + (720 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (870 (fadeout (frame-time-30 30))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'lfaccity))) + (if v1-1 + (logior! (-> v1-1 info level-flags) (level-flags use-camera-other)) + ) + ) + (none) + ) + ) + (task-close! "factory-sky-battle-hanger") + ) + ) + :cut-list '(111 210 297 701) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-movie" + :level 'factorya + :art-group "skel-hellcat-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x1fe + ) + (new 'static 'scene-actor + :name "particleman" + :level 'factorya + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "lfac-hanger-door" + :level 'factorya + :art-group "skel-lfac-hanger-door" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factorya-intro-b" + :end-point "factoryb-start" + :borrow '((factorya 1 lfacrm1 copy)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +(load-scene + (new 'static 'scene + :name "factory-sky-battle-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf8) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-151" + :art-group "scenecamera" + :anim "factory-sky-battle-res" + :parts 6 + :command-list '((0 + (fadein (frame-time-30 10)) + (send-event "h-warf" 'eval ,(lambda :behavior scene-player + ((arg0 process-drawable)) + (when (nonzero? *war-factory-vehicle-mask*) + (set! (-> arg0 draw seg-mask) *war-factory-vehicle-mask*) + (set! (-> arg0 draw effect-mask) *war-factory-effects-mask*) + ) + (none) + ) + ) + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 250) + ) + (part-tracker + "group-hellcat-thruster-trail-fac" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 250) + ) + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 0 250) + ) + (part-tracker + "group-hellcat-thruster-trail-fac" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 0 250) + ) + (want-display 'lfacrm2 'display) + ) + (141 (part-tracker + "group-fma-hellcat-heathaze" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 141 270) + ) + ) + (210 (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 210 260) + ) + ) + (230 (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 230 270) + ) + ) + (595 (fadeout (frame-time-30 20))) + (10000 (task-close! "factory-sky-battle-resolution")) + ) + :cut-list '(141) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'factoryb + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factoryb + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factoryb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-warf" + :level 'factorya + :art-group "skel-h-warf" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x1fe + ) + ) + :load-point "factorya-movie" + :end-point "factoryc-start-lfacrm2" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xd9 + :on-running #f + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "factory-assault-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "camera-start-151" + :art-group "scenecamera" + :anim "arena-training-1-intro" + :parts 16 + :command-list '((10000 (task-close! "factory-boss-introduction"))) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factoryc-start" + :end-point "factoryd-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe5 + :on-running #f + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "factory-boss-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-204" + :art-group "scenecamera" + :anim "factory-boss-intro" + :parts 16 + :command-list '((0 + (fadein (frame-time-30 10)) + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryd) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + ) + (1801 (fadeout (frame-time-30 10))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-boss-introduction") + ) + ) + :cut-list '(0 353 415 851 989 1065 1254 1748) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "errol" + :level 'factorya + :art-group "skel-errol" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factoryd-start" + :end-point "factoryd-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe6 + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "factory-indax-1-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-181" + :art-group "scenecamera" + :anim "factory-indax-1-intro" + :parts 4 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (410 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-1-introduction") + ) + ) + :cut-list '(200) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-1" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xdb + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "factory-indax-2-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-180" + :art-group "scenecamera" + :anim "factory-indax-2-intro" + :parts 3 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (340 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-2-introduction") + ) + ) + :cut-list '(163) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-2" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xdd + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "factory-indax-3-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-179" + :art-group "scenecamera" + :anim "factory-indax-3-intro" + :parts 3 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (320 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-3-introduction") + ) + ) + :cut-list '(145 241) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-3" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xdf + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +(load-scene (new 'static 'scene + :name "factory-indax-4-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-178" + :art-group "scenecamera" + :anim "factory-indax-4-intro" + :parts 3 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (340 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function level none) #f) (the-as level (-> gp-0 mood-context))) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-4-introduction") + ) + ) + :cut-list '(191) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-4" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe1 + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +(defpartgroup group-fma-hellcat-heathaze-ground + :id 756 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2833 :flags (sp7)) (sp-item 2834 :flags (sp7))) + ) + +(defpart 2833 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b -5.4613333) + (:accel-x (meters -0.00066666666) (meters 0.0013333333)) + (:accel-y (meters 0.001)) + (:accel-z (meters -0.00066666666) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:next-time (seconds 0.167)) + (:next-launcher 2835) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2835 + :init-specs ((:fade-b 5.4613333)) + ) + +(defpart 2834 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b 5.4613333) + (:accel-x (meters -0.00066666666) (meters 0.0013333333)) + (:accel-y (meters 0.001)) + (:accel-z (meters -0.00066666666) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:next-time (seconds 0.167)) + (:next-launcher 2836) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2836 + :init-specs ((:fade-b -5.4613333)) + ) + +(defpartgroup group-fma-hellcat-heathaze + :id 757 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2837 :flags (sp7)) (sp-item 2838 :flags (sp7))) + ) + +(defpart 2837 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b -2.7306666) + (:timer (seconds 0.667)) + (:flags (distort)) + (:next-time (seconds 0.335)) + (:next-launcher 2839) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2839 + :init-specs ((:fade-b 2.7306666)) + ) + +(defpart 2838 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b 2.7306666) + (:timer (seconds 0.667)) + (:flags (distort)) + (:next-time (seconds 0.335)) + (:next-launcher 2840) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2840 + :init-specs ((:fade-b -2.7306666)) + ) + +(defpartgroup group-hellcat-thrusters-fire + :id 758 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2841 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 2842 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 2841 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 2.0) + (:z (meters -1.5)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 255.0) + (:g 150.0) + (:b 0.0) + (:a 30.0 30.0) + (:scalevel-x (meters -0.02)) + (:fade-a -0.6) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2842 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 0.0) + (:a 10.0 2.0) + (:omega (degrees 4511.25)) + (:fade-a -0.12) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thrusters-fac + :id 759 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2843 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 2844 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 2843 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -1.5)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 30.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2844 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 3.0) + (:scale-x (meters 5) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 12.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4.096) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thrusters-follow + :id 760 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2845 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 2846 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +(defpart 2845 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -1.5)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 30.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2846 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 3.0) + (:scale-x (meters 5) (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-thruster-trail-fac + :id 761 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2847 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 2848 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +(defpart 2847 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 4.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 10.0 5.0) + (:vel-z (meters 0) (meters -0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.05 -0.05) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2848 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 4.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 10.0 5.0) + (:vel-z (meters -0.33333334) (meters -0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.05 -0.05) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-hellcat-dust-landing-fac + :id 762 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2849 :flags (sp7))) + ) + +(defpart 2849 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-fac-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 120.0 :y 120.0 :z 120.0 :w 128.0) + (new 'static 'vector :x 80.0 :y 80.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 80.0 :y 80.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 80.0 :y 80.0 :z 80.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fac-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fac-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-fac-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fac-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :z -2.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fac-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-fac-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +(define *part-hellcat-dust-landing-fac-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2849 init-specs 15 initial-valuef) + (the-as float *part-hellcat-dust-landing-fac-curve-settings*) + ) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* color-start) *range-fac-dust-color*) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* alpha-start) *range-fac-dust-alpha*) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-x-start) *range-fac-dust-scale-x*) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-y-start) *range-fac-dust-scale-y*) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* r-scalar) #f) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* g-scalar) #f) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* b-scalar) #f) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* a-scalar) *curve-fac-dust-alpha*) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-x-scalar) *curve-fac-dust-scale-x*) + +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-y-scalar) *curve-fac-dust-scale-y*) diff --git a/goal_src/jak3/levels/factory/factorya-init.gc b/goal_src/jak3/levels/factory/factorya-init.gc index beb2560e6a..4e44508b06 100644 --- a/goal_src/jak3/levels/factory/factorya-init.gc +++ b/goal_src/jak3/levels/factory/factorya-init.gc @@ -7,3 +7,26 @@ ;; DECOMP BEGINS +(defun factorya-login ((arg0 level)) + 0 + (none) + ) + +(defun factorya-activate ((arg0 level)) + (let ((gp-0 *traffic-info*) + (v1-1 (level-get *level* 'factorya)) + ) + (set! (-> gp-0 vehicle-level) v1-1) + (set! (-> gp-0 vehicle-levels 8) (-> v1-1 name)) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +(defun factorya-deactivate ((arg0 level)) + (set! (-> *traffic-info* vehicle-level) #f) + (vehicle-manager-kill) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/factoryb-init.gc b/goal_src/jak3/levels/factory/factoryb-init.gc index 8c8b4791c8..9caca3e757 100644 --- a/goal_src/jak3/levels/factory/factoryb-init.gc +++ b/goal_src/jak3/levels/factory/factoryb-init.gc @@ -5,5 +5,20 @@ ;; name in dgo: factoryb-init ;; dgos: FACB +(define-extern factory-manager-start (function level none)) + ;; DECOMP BEGINS +(defun factoryb-activate ((arg0 level)) + (cond + ((= (status-of-level-and-borrows *level* 'lfactory #f) 'active) + (format 0 "factoryb-activate~%") + (factory-manager-start arg0) + ) + (else + (format 0 "WARNING: factoryb is starting up without lfactory, there will be no manager.") + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/factoryc-manager.gc b/goal_src/jak3/levels/factory/factoryc-manager.gc index cfa568fe88..27eb77cf6a 100644 --- a/goal_src/jak3/levels/factory/factoryc-manager.gc +++ b/goal_src/jak3/levels/factory/factoryc-manager.gc @@ -7,3 +7,148 @@ ;; DECOMP BEGINS +(defun factoryd-activate ((arg0 level)) + (if (and (nonzero? *nav-network*) *nav-network*) + (init-by-other! *nav-network* arg0 *factoryd-adjacency*) + ) + 0 + (none) + ) + +(deftype task-manager-factory-assault (task-manager) + ((explode-car-time time-frame) + (daxter-done symbol) + (region-hack symbol) + ) + ) + + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-factory-assault)) + (when (< -1 (-> this explode-car-time)) + (let* ((s4-0 (handle->process (-> *vehicle-info* handle-by-vehicle-type 21))) + (s5-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when s5-0 + (cond + ((and (or (focus-test? s5-0 dead) (< 245760.0 (- (-> (target-pos 0) y) (-> s5-0 root trans y)))) + (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + ) + (if (and *target* (focus-test? *target* indax)) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 100.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'death)) + ) + ) + ) + (send-event this 'fail) + ) + ((= (-> this player-vehicle) #f) + (set! (-> this player-vehicle) (process->handle (send-event *target* 'get-vehicle))) + ) + ) + ) + ) + ) + (when (not (-> this daxter-done)) + (cond + ((task-node-closed? (game-task-node factory-assault-indax-4)) + (set! (-> this daxter-done) #t) + (remove-setting! 'pilot) + ) + (else + (set-setting! 'pilot #f 0.0 0) + ) + ) + ) + (if (and *target* (focus-test? *target* pilot-riding)) + (task-close! "factory-assault-get-vehicle") + ) + (when (and (> (-> this explode-car-time) 0) (< (-> this explode-car-time) (current-time))) + (let* ((s4-1 (handle->process (-> *vehicle-info* handle-by-vehicle-type 21))) + (s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when s5-1 + (cond + ((-> this region-hack) + (set! (-> this explode-car-time) 0) + (send-event + s5-1 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 250.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 0.0)) + ) + ) + ) + (else + (set! (-> this explode-car-time) -1) + (send-event *target* 'invulnerable 360) + (let ((v1-63 (new 'static 'vector :z 4096.0 :w 1.0))) + (send-event s5-1 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 250.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.1) + (attacker-velocity v1-63) + ) + ) + ) + ) + (task-close! "factory-assault-broke-ultimate-fence") + ) + ) + ) + ) + ) + (none) + ) + +;; WARN: disable def twice: 18. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod taskman-event-handler ((this task-manager-factory-assault) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('vehicle-breached) + (set! v0-0 (+ (current-time) (seconds 1))) + (set! (-> this explode-car-time) (the-as time-frame v0-0)) + v0-0 + ) + (('faccar-terminate) + (when (and *target* (focus-test? *target* pilot-riding)) + (set! (-> this explode-car-time) (+ (current-time) (seconds 2))) + (set! v0-0 #t) + (set! (-> this region-hack) (the-as symbol v0-0)) + v0-0 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod task-manager-method-27 ((this task-manager-factory-assault)) + (send-event (handle->process (-> this player-vehicle)) 'go-die) + (set! (-> this player-vehicle) (the-as handle #f)) + ((method-of-type task-manager task-manager-method-27) this) + (none) + ) + +(defmethod set-time-limit ((this task-manager-factory-assault)) + (set! (-> this explode-car-time) 0) + (set! (-> this daxter-done) #f) + (set! (-> this region-hack) #f) + (set-setting! 'unique-vehicle-mission-critical #f 0.0 0) + ((method-of-type task-manager set-time-limit) this) + (none) + ) diff --git a/goal_src/jak3/levels/factory/factoryc-mood.gc b/goal_src/jak3/levels/factory/factoryc-mood.gc index 43b35978cd..8b0bc07035 100644 --- a/goal_src/jak3/levels/factory/factoryc-mood.gc +++ b/goal_src/jak3/levels/factory/factoryc-mood.gc @@ -7,3 +7,51 @@ ;; DECOMP BEGINS +(deftype factoryc-states (structure) + ((electricity electricity-state 2 :inline) + (flame flames-state :inline :offset 32) + ) + ) + + +(defbehavior update-mood-factoryc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior-ambient arg0 #t 0.0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 1 w) 1.0) + (let* ((a0-5 (-> *display* part-clock frame-counter)) + (v1-7 (mod a0-5 300)) + (s5-0 (mod a0-5 900)) + ) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-7)))))) + (set! (-> arg0 times 3 w) (if (< 450 s5-0) + 1.0 + 0.5 + ) + ) + ) + (update-mood-electricity arg0 4 0 0.8 1.0) + (update-mood-electricity arg0 6 16 0.8 1.0) + (update-mood-flames arg0 5 1 32 0.85 0.00068359374 2.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-factoryc-light! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'factoryc))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as factoryc-states (+ (the-as uint v1-2) (* arg1 16))) electricity 0 scale) arg0) + ) + ) + ) + (none) + ) diff --git a/goal_src/jak3/levels/factory/factoryc-obs.gc b/goal_src/jak3/levels/factory/factoryc-obs.gc index 8be6380554..17a2cf18a5 100644 --- a/goal_src/jak3/levels/factory/factoryc-obs.gc +++ b/goal_src/jak3/levels/factory/factoryc-obs.gc @@ -7,3 +7,1213 @@ ;; DECOMP BEGINS +(defpartgroup group-fac-fire-torch + :id 807 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2960 :flags (sp7))) + ) + +(defpart 2960 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.03)) + (:timer (seconds 0.667)) + (:flags ()) + (:conerot-x (degrees -30) (degrees 60)) + (:rotate-x (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun factoryc-activate ((arg0 level)) + (if (and (nonzero? *nav-network*) *nav-network*) + (init-by-other! *nav-network* arg0 *factoryc-adjacency*) + ) + 0 + (none) + ) + +(defun factoryc-login ((arg0 level)) + (set! *nav-network* (new 'loading-level 'nav-network)) + (alloc-nav-network-for-level! *nav-network* 64 10) + 0 + (none) + ) + +(defun factoryc-logout ((arg0 level)) + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +(defskelgroup skel-generic-spot-ring gun gun-dark-2-ring-lod0-jg gun-dark-2-ring-idle-ja + ((gun-dark-2-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0.5 84) + :longest-edge (meters 80) + :shadow gun-dark-2-ring-shadow-mg + ) + +(deftype generic-spot-shadow-effect (process-drawable) + ((focal-length float) + (near-clip float) + (far-clip float) + (color rgba) + (pre-flicker-pos vector :inline) + (jmod-outer joint-mod-add-local :inline) + (jmod-inner joint-mod-add-local :inline) + ) + (:state-methods + idle + inactive + ) + (:methods + (set-jmod-inner-scale! (_type_ vector) none) + (set-jmod-outer-scale! (_type_ vector) none) + ) + ) + + +;; WARN: Return type mismatch vector vs none. +(defmethod set-jmod-inner-scale! ((this generic-spot-shadow-effect) (arg0 vector)) + (set! (-> this jmod-inner transform scale quad) (-> arg0 quad)) + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod set-jmod-outer-scale! ((this generic-spot-shadow-effect) (arg0 vector)) + (set! (-> this jmod-outer transform scale quad) (-> arg0 quad)) + (none) + ) + +(defbehavior generic-spot-shadow-effect-init-by-other generic-spot-shadow-effect ((arg0 vector) (arg1 quaternion)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (set! (-> self pre-flicker-pos quad) (-> self root trans quad)) + (set! (-> self level) (-> *level* level-default)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-spot-ring" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init (-> self jmod-inner) self (the-as uint 4) (joint-mod-base-flags attached scale)) + (init (-> self jmod-outer) self (the-as uint 3) (joint-mod-base-flags attached scale)) + (set! (-> self focal-length) 409600.0) + (set! (-> self near-clip) 0.0) + (set! (-> self far-clip) 122880.0) + (set! (-> self color) (new 'static 'rgba :r #xf0 :g #xf0 :a #x80)) + (cond + ((-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + 0.0 + 0.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf02 shdf03 shdf04 disable-draw) + 245760.0 + ) + ) + (set! (-> self draw shadow-ctrl settings shadow-type) 1) + (set! (-> self draw shadow-ctrl settings flags) (shadow-flags disable-fade shdf03 shdf04 shdf07)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (else + (go process-drawable-art-error "Shadow error (no self draw shadow)") + ) + ) + (go-virtual idle) + ) + +(defbehavior generic-spot-shadow-effect-handler generic-spot-shadow-effect ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('on) + (go-virtual idle) + ) + (('off) + (go-virtual inactive) + ) + ) + ) + +(defstate idle (generic-spot-shadow-effect) + :virtual #t + :event generic-spot-shadow-effect-handler + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (let ((v1-3 (-> self draw shadow-ctrl))) + (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + :trans (behavior () + (shadow-control-method-14 + (-> self draw shadow-ctrl) + (-> self root trans) + (vector-negate! (new 'stack-no-clear 'vector) (-> self node-list data 3 bone transform uvec)) + (-> self focal-length) + (-> self near-clip) + (-> self far-clip) + ) + (persist-with-delay + *setting-control* + 'spotlight-color + (seconds 0.1) + 'spotlight-color + #f + 0.0 + (the-as int (-> self color)) + ) + ) + :code sleep-code + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (+ -1024.0 (* 4096.0 (* 0.5 (rand-vu))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (+ -1024.0 (* 4096.0 (* 0.5 (rand-vu))))) + (set! (-> gp-0 w) 1.0) + (vector+! (-> self root trans) (-> self pre-flicker-pos) gp-0) + ) + (ja-post) + ) + ) + +(defstate inactive (generic-spot-shadow-effect) + :virtual #t + :event generic-spot-shadow-effect-handler + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (let ((v1-3 (-> self draw shadow-ctrl))) + (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + :trans (behavior () + '() + ) + :code sleep-code + ) + +(deftype fac-zapper (process) + ((on-duration time-frame) + (off-duration time-frame) + (phase-offset time-frame) + (beam-is-on symbol) + (bzzt-sound sound-id) + (path path-control) + (lightning lightning-control) + (hilite handle) + ) + (:state-methods + idle + ) + ) + + +(set! (-> *lightning-spec-id-table* 33) (new 'static 'lightning-spec + :name "fac-zapper-zap" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 60.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.62 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.25 + :merge-count 2 + :radius 2252.8 + :duration 99.9 + :sound #f + ) + ) + +(set! (-> *lightning-spec-id-table* 34) (new 'static 'lightning-spec + :name "fac-elec-gate-zap" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 12288.0 + :merge-factor 0.125 + :merge-count 2 + :radius 3072.0 + :duration 99.9 + :sound #f + ) + ) + +(defstate idle (fac-zapper) + :virtual #t + :trans (behavior () + (if (-> self beam-is-on) + (sound-play + "laser-loop" + :id (-> self bzzt-sound) + :position (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.5 'interp) + ) + (sound-stop (-> self bzzt-sound)) + ) + ) + :code (behavior () + (let ((gp-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (s5-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp)) + ) + (let ((a0-2 (-> self lightning)) + (v1-2 gp-0) + ) + (set! (-> a0-2 state meet data 0 quad) (-> v1-2 quad)) + ) + (let ((a0-5 (-> self lightning)) + (v1-4 s5-0) + ) + (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-4 quad)) + ) + (until #f + (let ((v1-9 (mod (+ (current-time) (-> self phase-offset)) (+ (-> self on-duration) (-> self off-duration))))) + (cond + ((and (< v1-9 (-> self on-duration)) + (< (- (the-as time-frame v1-9) (- (current-time) (-> self clock old-frame-counter))) 0) + ) + (let ((v1-10 (-> self lightning)) + (a0-18 1) + ) + (let ((a1-11 (!= a0-18 (-> v1-10 state mode)))) + (case a0-18 + ((3) + (if a1-11 + (set! (-> v1-10 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-10 state start-color) (-> v1-10 spec start-color)) + (set! (-> v1-10 state end-color) (-> v1-10 spec end-color)) + ) + ) + ) + (set! (-> v1-10 state mode) (the-as uint a0-18)) + ) + (set! (-> self beam-is-on) #t) + (send-event (handle->process (-> self hilite)) 'on) + (set-factoryc-light! 1.0 0) + ) + ((and (>= v1-9 (-> self on-duration)) + (< (- (the-as time-frame v1-9) (- (current-time) (-> self clock old-frame-counter))) (-> self on-duration)) + ) + (let ((v1-22 (-> self lightning)) + (a0-29 3) + ) + (let ((a1-26 (!= a0-29 (-> v1-22 state mode)))) + (case a0-29 + ((3) + (if a1-26 + (set! (-> v1-22 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-22 state start-color) (-> v1-22 spec start-color)) + (set! (-> v1-22 state end-color) (-> v1-22 spec end-color)) + ) + ) + ) + (set! (-> v1-22 state mode) (the-as uint a0-29)) + ) + (set! (-> self beam-is-on) #f) + (send-event (handle->process (-> self hilite)) 'off) + (set-factoryc-light! 0.0 0) + ) + ) + ) + (when (and *target* (-> self beam-is-on)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (when (< (vector-segment-distance-point! (target-pos 0) gp-0 s5-0 s3-0) 4915.2) + (sound-play "laser-zap-dax") + (send-event + *target* + '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 'shock)) + ) + ) + ) + ) + ) + (suspend) + ) + ) + #f + (sleep-code) + ) + ) + +(defmethod init-from-entity! ((this fac-zapper) (arg0 entity-actor)) + ;; og:preserve-this added + (stack-size-set! (-> this main-thread) 512) + (set! (-> this entity) arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (set! (-> this lightning) (new 'process 'lightning-control (-> *lightning-spec-id-table* 33) this 0.0)) + (let ((v1-4 (-> this lightning)) + (a0-3 0) + ) + (let ((a1-4 (!= a0-3 (-> v1-4 state mode)))) + (case a0-3 + ((3) + (if a1-4 + (set! (-> v1-4 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-4 state start-color) (-> v1-4 spec start-color)) + (set! (-> v1-4 state end-color) (-> v1-4 spec end-color)) + ) + ) + ) + (set! (-> v1-4 state mode) (the-as uint a0-3)) + ) + (set! (-> this on-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'on-duration :default 1.15)))) + ) + (set! (-> this off-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'off-duration :default 1.85)))) + ) + (set! (-> this phase-offset) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'zapper-phase)))) + ) + (set! (-> this beam-is-on) #f) + (set-factoryc-light! 0.0 0) + (set! (-> this bzzt-sound) (new-sound-id)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'quaternion)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (get-point-in-path! (-> this path) s3-0 0.5 'interp) + (+! (-> s3-0 y) 4096.0) + (vector-! s5-0 (-> this path curve cverts 0) (-> this path curve cverts 1)) + (let ((f30-3 (vector-length s5-0))) + (vector-float/! s5-0 s5-0 f30-3) + (quaternion-look-at! s2-0 s5-0 *up-vector*) + (quaternion*! s2-0 s2-0 (new 'static 'quaternion :x 1.0)) + (let ((s4-0 (process-spawn generic-spot-shadow-effect s3-0 s2-0 :name "generic-spot-shadow-effect" :to this))) + (when s4-0 + (set! (-> this hilite) (ppointer->handle s4-0)) + (set! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0 far-clip) 2867.2) + (set! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0 near-clip) 0.4096) + (set! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0 color) + (new 'static 'rgba :r #xff :g #x60 :b #x60 :a #x80) + ) + (set-jmod-inner-scale! + (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0) + (new 'static 'vector :x 0.0001 :y 0.0001 :z 0.0001 :w 1.0) + ) + (set-vector! s5-0 1.2 1.2 (* 0.0001319679 f30-3) 1.0) + (set-jmod-outer-scale! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0) s5-0) + ) + ) + ) + ) + (go (method-of-object this idle)) + ) + +(defmethod deactivate ((this fac-zapper)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this bzzt-sound)) + (call-parent-method this) + (none) + ) + +(defmethod relocate ((this fac-zapper) (offset int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) offset) + ) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) offset) + ) + (call-parent-method this offset) + ) + +(deftype fac-fire-torch (process-drawable) + ((on-duration time-frame) + (off-duration time-frame) + (phase-offset time-frame) + (fire-is-on symbol) + (sync sync-eased :inline) + (path-pos float) + (looping-sound sound-id) + (particle-hack matrix :inline) + ) + (:state-methods + idle + ) + ) + + +(defskelgroup skel-fac-fire-torch fac-fire-torch fac-fire-torch-lod0-jg fac-fire-torch-idle-ja + ((fac-fire-torch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.75) + ) + +(defstate idle (fac-fire-torch) + :virtual #t + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + (sound-play "fire-loop" :id (-> self looping-sound) :position (-> self root trans)) + ) + :code (behavior () + (set! (-> self fire-is-on) #t) + (sleep-code) + ) + :post (behavior () + (when (-> self fire-is-on) + (let ((f30-0 (total-distance (-> self path))) + (gp-0 (current-time)) + ) + (- (get-scaled-val! (-> self sync) f30-0 (the-as int (+ gp-0 1))) + (get-scaled-val! (-> self sync) f30-0 (the-as int gp-0)) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'matrix))) + (let* ((v1-9 gp-1) + (a3-0 (-> self node-list data 4 bone transform)) + (a0-5 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-2 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-9 rvec quad) a0-5) + (set! (-> v1-9 uvec quad) a1-2) + (set! (-> v1-9 fvec quad) a2-2) + (set! (-> v1-9 trans quad) a3-1) + ) + (vector-negate-in-place! (-> gp-1 uvec)) + (vector-negate-in-place! (-> gp-1 fvec)) + (let ((a2-3 (-> self particle-hack)) + (v1-10 (-> gp-1 rvec quad)) + (a0-8 (-> gp-1 uvec quad)) + (a1-3 (-> gp-1 fvec quad)) + (a3-2 (-> gp-1 trans quad)) + ) + (set! (-> a2-3 rvec quad) v1-10) + (set! (-> a2-3 uvec quad) a0-8) + (set! (-> a2-3 fvec quad) a1-3) + (set! (-> a2-3 trans quad) a3-2) + ) + ) + (add-debug-rot-matrix #t (bucket-id debug-no-zbuf1) (-> self particle-hack) (-> self root trans)) + (spawn-from-mat (-> self part) (-> self particle-hack)) + (when (and *target* (< -32768.0 (- (-> (target-pos 0) y) (-> self root trans y)))) + (when (< (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 5939.2 + ) + (sound-play "get-burned") + (send-event + *target* + '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 'burn)) + ) + ) + ) + ) + ) + (ja-post) + ) + ) + +(defmethod init-from-entity! ((this fac-fire-torch) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-fire-torch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this on-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'on-duration :default 1.15)))) + ) + (set! (-> this off-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'off-duration :default 1.85)))) + ) + (set! (-> this phase-offset) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'zapper-phase)))) + ) + (set! (-> this fire-is-on) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 806) this)) + (let* ((s4-1 (-> this part)) + (s3-1 (method-of-object s4-1 set-local-space-info)) + (s2-0 (the-as + particle-local-space-info + (add-connection *part-local-space-engine* this local-space-proc-joint 4 0 0) + ) + ) + ) + (let ((v1-20 (process->handle this))) + (if (= v1-20 #f) + (set! v1-20 (process->handle this)) + ) + (set! (-> s2-0 hand) (the-as handle v1-20)) + ) + (matrix-identity! (-> s2-0 mat-new)) + (matrix-identity! (-> s2-0 mat-prev)) + (set! (-> s2-0 flags) (part-local-space-flags)) + (s3-1 s4-1 s2-0) + ) + (let ((a1-11 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-24 0)) + (if #t + (set! v1-24 (logior v1-24 1)) + ) + (set! (-> a1-11 sync-type) 'sync-eased) + (set! (-> a1-11 sync-flags) (the-as sync-flags v1-24)) + ) + (set! (-> a1-11 period) (the-as uint 1200)) + (set! (-> a1-11 entity) arg0) + (set! (-> a1-11 percent) 0.0) + (set! (-> a1-11 ease-in) 0.15) + (set! (-> a1-11 ease-out) 0.15) + (set! (-> a1-11 pause-in) 0.0) + (set! (-> a1-11 pause-out) 0.0) + (initialize! (-> this sync) a1-11) + ) + (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 looping-sound) (new-sound-id)) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path-pos) 0.0) + ) + ((> (-> this sync period) 0) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + ) + (else + (set! (-> this path-pos) 0.0) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + ) + ) + (go (method-of-object this idle)) + ) + +(define *fac-robopod-pool-count* 0) + +(deftype fac-robopod (process-focusable) + ((my-baby handle 3) + (num-babies uint32) + (subtask-countdown int32) + (suppressed symbol) + ) + (:state-methods + idle + generate + die + already-dead + ) + ) + + +(defskelgroup skel-fac-robopod fac-robopod fac-robopod-lod0-jg fac-robopod-idle-ja + ((fac-robopod-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-fac-robopod-explode fac-robopod fac-robopod-explode-lod0-jg fac-robopod-explode-idle-ja + ((fac-robopod-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +(define *fac-robopod-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +(defun fac-robopod-add-hoverbot ((arg0 fac-robopod)) + (cond + ((and (< (-> arg0 num-babies) (the-as uint 3)) + (< *fac-robopod-pool-count* 3) + (not (-> *setting-control* user-current nuke-active?)) + ) + (let ((v1-5 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'enemy-init-by-other-params)) + ) + (vector+! v1-5 (-> arg0 root trans) (new 'static 'vector :w 1.0)) + (set! (-> s5-0 trans quad) (-> v1-5 quad)) + (quaternion-copy! (-> s5-0 quat) (-> arg0 root quat)) + (set! (-> s5-0 entity) (-> arg0 entity)) + (set! (-> s5-0 directed?) #f) + (set! (-> s5-0 no-initial-move-to-ground?) #t) + (set! (-> s5-0 art-level) 'lfacrm2) + (let* ((s4-0 (get-process *default-dead-pool* robo-hover #x4000 1)) + (v0-4 (ppointer->handle (when s4-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s4-0 arg0 "robo-hover" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 enemy-init-by-other arg0 s5-0) + (-> s4-0 ppointer) + ) + ) + ) + ) + (when (!= v0-4 #f) + (set! (-> arg0 my-baby (-> arg0 num-babies)) (the-as handle v0-4)) + (+! (-> arg0 num-babies) 1) + (set! *fac-robopod-pool-count* (+ *fac-robopod-pool-count* 1)) + ) + ) + ) + ) + (else + ) + ) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defun fac-robopod-invalidate-hoverbot ((arg0 fac-robopod) (arg1 int)) + (when (> (-> arg0 num-babies) 0) + (let ((v1-2 (+ (-> arg0 num-babies) -1))) + (set! (-> arg0 num-babies) v1-2) + (let ((a2-2 (-> arg0 my-baby v1-2)) + (a3-2 (-> arg0 my-baby arg1)) + ) + (set! *fac-robopod-pool-count* (+ *fac-robopod-pool-count* -1)) + (when (!= v1-2 arg1) + (set! (-> arg0 my-baby arg1) a2-2) + (set! (-> arg0 my-baby v1-2) a3-2) + ) + ) + (set! (-> arg0 my-baby v1-2) (the-as handle #f)) + ) + ) + (none) + ) + +(defbehavior fac-robopod-base-handler fac-robopod ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('impact-impulse) + (let ((v1-1 (the-as object (-> arg3 param 0)))) + (when (< 40960.0 (-> (the-as rigid-body-impact v1-1) impulse)) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.15)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 192 (seconds 0.1)) + (go-virtual die) + #t + ) + ) + ) + (('child-die) + (let ((v1-10 (+ (-> self subtask-countdown) -1))) + (set! (-> self subtask-countdown) v1-10) + (when (zero? v1-10) + (let ((t9-3 format) + (a0-9 #t) + (a1-3 "%s dead~%") + ) + (-> self name) + (t9-3 a0-9 a1-3) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + ) + ) + (('suppress) + (format #t "suppress~%") + (set! (-> self suppressed) #t) + (dotimes (gp-0 3) + (format #t "~d : ~I~%" gp-0 (-> self my-baby gp-0)) + (when (and (-> self my-baby gp-0) (handle->process (-> self my-baby gp-0))) + (let ((s5-0 (handle->process (-> self my-baby gp-0)))) + (format #t "killing ~A~%" (-> s5-0 name)) + (send-event s5-0 'die-fast) + ) + ) + ) + #f + ) + (('unsuppress) + (set! (-> self suppressed) #f) + #f + ) + ) + ) + +;; og:preserve-this duplicate +; (defmethod get-inv-mass ((this fac-robopod)) +; 2.0 +; ) + +(defstate idle (fac-robopod) + :virtual #t + :event fac-robopod-base-handler + :enter (behavior () + (setup-masks (-> self draw) 2 1) + ) + :code (behavior () + (until #f + (dotimes (gp-0 (the-as int (-> self num-babies))) + (cond + ((and (-> self my-baby gp-0) (handle->process (-> self my-baby gp-0))) + (let ((s5-0 (handle->process (-> self my-baby gp-0)))) + (when (and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'dormant)) + (fac-robopod-invalidate-hoverbot self gp-0) + (send-event s5-0 'die-fast) + ) + ) + ) + (else + (fac-robopod-invalidate-hoverbot self gp-0) + ) + ) + ) + (if (and (< (-> self num-babies) (the-as uint 3)) + (< *fac-robopod-pool-count* 3) + (and (< (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 245760.0 + ) + (< (+ -24576.0 (-> self root trans y)) (-> (target-pos 0) y)) + (not (-> self suppressed)) + ) + ) + (go-virtual generate) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +(defstate generate (fac-robopod) + :virtual #t + :event fac-robopod-base-handler + :code (behavior () + (fac-robopod-add-hoverbot self) + (sound-play "fac-hatch-open") + (ja-no-eval :group! fac-robopod-open-ja :num! (seek! max 2.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (sound-play "fac-hatch-close") + (ja-no-eval :group! fac-robopod-close-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual idle) + ) + :post ja-post + ) + +(defstate die (fac-robopod) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let* ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) + (s5-0 *target*) + (a0-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when a0-3 + (get-trans a0-3 0) + (let ((s5-1 (-> *target* control transv))) + (vector-negate! (-> gp-0 fountain-rand-transv-lo) s5-1) + (vector+! (-> gp-0 fountain-rand-transv-lo) (-> gp-0 fountain-rand-transv-lo) (-> self root trans)) + (+! (-> gp-0 fountain-rand-transv-lo y) -40960.0) + (let ((f0-2 (vector-length s5-1))) + (set! (-> gp-0 fountain-rand-transv-hi x) f0-2) + (set! (-> gp-0 fountain-rand-transv-hi y) (* 3.0 f0-2)) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi z) 24576.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 73728.0) + (sound-play "fac-hatch-explo") + (cond + ((logtest? (-> *part-group-id-table* 752 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 752)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 752)) + ) + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-robopod-explode" (the-as (pointer level) #f)) + 8 + gp-0 + *fac-robopod-exploder-params* + :name "joint-exploder" + :to self + ) + ) + ) + ) + :code (behavior () + (set! (-> self root root-prim prim-core collide-with) (collide-spec)) + (set! (-> self root root-prim prim-core collide-as) (collide-spec)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (cond + ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) + ) + ) + (setup-masks (-> self draw) 1 2) + (sleep-code) + ) + :post ja-post + ) + +(defstate already-dead (fac-robopod) + :virtual #t + :enter (behavior () + (set! (-> self root root-prim prim-core collide-with) (collide-spec)) + (set! (-> self root root-prim prim-core collide-as) (collide-spec)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (setup-masks (-> self draw) 1 2) + ) + :code sleep-code + :post ja-post + ) + +(defmethod get-inv-mass ((this fac-robopod)) + 2.0 + ) + +(defmethod deactivate ((this fac-robopod)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (format #t "~s killing ~d babies~%" (-> this name) (-> this num-babies)) + (set! *fac-robopod-pool-count* (- *fac-robopod-pool-count* (the-as int (-> this num-babies)))) + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this fac-robopod) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robopod" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-14 0) + (a0-14 2) + ) + (while (>= a0-14 v1-14) + (set! (-> this my-baby v1-14) (the-as handle #f)) + (+! v1-14 1) + ) + ) + (set! (-> this num-babies) (the-as uint 0)) + (set! (-> this subtask-countdown) + (res-lump-value (-> this entity) 'gate-countdown int :default (the-as uint128 5) :time -1000000000.0) + ) + (set! (-> this suppressed) #f) + (if (not (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle)) + (go (method-of-object this already-dead)) + ) + ) + +(deftype factory-elec-gate (process) + ((path-l path-control) + (path-r path-control) + (beams lightning-control 4) + (beams-on symbol 4) + (bzzt-sound sound-id) + (blocking-plane handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + flickering + ) + ) + + +(defstate idle (factory-elec-gate) + :virtual #t + :enter (behavior () + (let ((gp-0 0) + (s5-0 3) + ) + (while (>= s5-0 gp-0) + (let ((s4-0 (get-point-in-path! (-> self path-l) (new 'stack-no-clear 'vector) (the float gp-0) 'interp)) + (v1-2 (get-point-in-path! (-> self path-r) (new 'stack-no-clear 'vector) (the float gp-0) 'interp)) + ) + (set! (-> self beams gp-0 state meet data 0 quad) (-> s4-0 quad)) + (let ((a0-9 (-> self beams gp-0))) + (set! (-> a0-9 state meet data (+ (-> a0-9 state points-to-draw) -1) quad) (-> v1-2 quad)) + ) + ) + (set! (-> self beams-on gp-0) #t) + (set-factoryc-light! 1.0 1) + (+! gp-0 1) + ) + ) + (when (not (handle->process (-> self blocking-plane))) + (let ((gp-1 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (get-point-in-path! (-> self path-l) (-> gp-1 0) 0.0 'interp) + (get-point-in-path! (-> self path-r) (-> gp-1 1) 0.0 'interp) + (+! (-> gp-1 0 y) -16384.0) + (+! (-> gp-1 1 y) -16384.0) + (set! (-> self blocking-plane) + (ppointer->handle (process-spawn blocking-plane gp-1 #x47f00000 :name "blocking-plane" :to self)) + ) + ) + (send-event (handle->process (-> self blocking-plane)) 'collide-as #x4000000) + (send-event (handle->process (-> self blocking-plane)) 'attack-mode 'shock) + ) + ) + :code sleep-code + :post (behavior () + (when (> (-> self actor-group-count) 0) + (dotimes (gp-0 (length (-> self actor-group 0))) + (when (logtest? (-> self actor-group 0 data gp-0 actor extra perm status) (entity-perm-status subtask-complete)) + (go-virtual flickering) + #t + (goto cfg-8) + ) + ) + ) + (label cfg-8) + (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) + (debug-draw (-> self path-l)) + (debug-draw (-> self path-r)) + ) + ) + +(defstate flickering (factory-elec-gate) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) + (let ((s4-0 0) + (s3-0 3) + ) + (while (>= s3-0 s4-0) + (cond + ((logtest? s5-0 1) + (when (not (-> self beams-on s4-0)) + (let ((v1-8 (-> self beams s4-0)) + (a0-1 1) + ) + (let ((a1-1 (!= a0-1 (-> v1-8 state mode)))) + (case a0-1 + ((3) + (if a1-1 + (set! (-> v1-8 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) + (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) + ) + ) + ) + (set! (-> v1-8 state mode) (the-as uint a0-1)) + ) + (set! (-> self beams-on s4-0) #t) + (set-factoryc-light! 1.0 1) + ) + ) + (else + (when (-> self beams-on s4-0) + (let ((v1-17 (-> self beams s4-0)) + (a0-5 3) + ) + (let ((a1-12 (!= a0-5 (-> v1-17 state mode)))) + (case a0-5 + ((3) + (if a1-12 + (set! (-> v1-17 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) + (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) + ) + ) + ) + (set! (-> v1-17 state mode) (the-as uint a0-5)) + ) + (set! (-> self beams-on s4-0) #f) + (set-factoryc-light! 0.0 1) + ) + ) + ) + (set! s5-0 (/ s5-0 2)) + (+! s4-0 1) + ) + ) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 0.1)) + (if (logand s5-0 1) + (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) + ) + (suspend) + ) + ) + ) + (suspend) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (process-entity-status! self (entity-perm-status dead) #t) + (sound-stop (-> self bzzt-sound)) + (let ((a0-13 (handle->process (-> self blocking-plane)))) + (if a0-13 + (deactivate a0-13) + ) + ) + ) + :post (behavior () + (debug-draw (-> self path-l)) + (debug-draw (-> self path-r)) + ) + ) + +(defmethod relocate ((this factory-elec-gate) (offset int)) + (if (nonzero? (-> this path-l)) + (&+! (-> this path-l) offset) + ) + (if (nonzero? (-> this path-r)) + (&+! (-> this path-r) offset) + ) + (let ((v1-8 0) + (a0-1 3) + ) + (while (>= a0-1 v1-8) + (if (nonzero? (-> this beams v1-8)) + (&+! (-> this beams v1-8) offset) + ) + (+! v1-8 1) + ) + ) + (call-parent-method this offset) + ) + +(defmethod deactivate ((this factory-elec-gate)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this bzzt-sound)) + (call-parent-method this) + (none) + ) + +(defmethod init-from-entity! ((this factory-elec-gate) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (when (task-node-closed? (game-task-node factory-assault-get-vehicle)) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + (set! (-> this path-l) (new 'process 'path-control this 'pathl 0.0 arg0 #f)) + (set! (-> this path-r) (new 'process 'path-control this 'pathr 0.0 arg0 #f)) + (logior! (-> this path-l flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this path-r flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this bzzt-sound) (new-sound-id)) + (let ((s4-0 0) + (s3-0 3) + ) + (while (>= s3-0 s4-0) + (set! (-> this beams s4-0) (new 'process 'lightning-control (-> *lightning-spec-id-table* 34) this 0.0)) + (set! (-> this beams-on s4-0) #f) + (set-factoryc-light! 0.0 1) + (+! s4-0 1) + ) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-20 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-20 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) v1-20) + ) + (else + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this blocking-plane) (the-as handle #f)) + (if (not (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle)) + (go (method-of-object this flickering)) + ) + ) diff --git a/goal_src/jak3/levels/factory/factoryc-obs2.gc b/goal_src/jak3/levels/factory/factoryc-obs2.gc index d5a7ba3b45..d150f2594b 100644 --- a/goal_src/jak3/levels/factory/factoryc-obs2.gc +++ b/goal_src/jak3/levels/factory/factoryc-obs2.gc @@ -7,3 +7,1777 @@ ;; DECOMP BEGINS +(deftype fac-break-floor (process-drawable) + ((root collide-shape :override) + (notify-actor entity-actor) + ) + (:state-methods + idle + die + ) + ) + + +(defskelgroup skel-fac-break-floor fac-break-floor fac-break-floor-lod0-jg fac-break-floor-idle-ja + ((fac-break-floor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(defskelgroup skel-fac-break-floor-explode fac-break-floor fac-break-floor-explode-lod0-jg fac-break-floor-explode-idle-ja + ((fac-break-floor-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(define *fac-break-floor-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(defstate idle (fac-break-floor) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual die) + #f + ) + ) + ) + ) + :code sleep-code + ) + +(defstate die (fac-break-floor) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "break-floor") + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-2 send-event-function) + (v1-6 (-> self notify-actor)) + ) + (t9-2 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + ) + :code (behavior () + ((lambda :behavior fac-break-floor + () + (cond + ((logtest? (-> *part-group-id-table* 750 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 750)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 750)) + ) + ) + (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (a0-14 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when a0-14 + (set! (-> gp-2 fountain-rand-transv-lo quad) (-> (get-trans a0-14 0) quad)) + (+! (-> gp-2 fountain-rand-transv-lo y) 16384.0) + ) + ) + (set! (-> gp-2 fountain-rand-transv-hi x) 24576.0) + (set! (-> gp-2 fountain-rand-transv-hi y) 81920.0) + (set! (-> gp-2 fountain-rand-transv-hi z) 12288.0) + (set! (-> gp-2 fountain-rand-transv-hi w) 32768.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-floor-explode" (the-as (pointer level) #f)) + 6 + gp-2 + *fac-break-floor-exploder-params* + :name "joint-exploder" + :to self + ) + ) + ) + ) + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this fac-break-floor) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.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) + ) + (set! (-> this root penetrated-by) (penetrate flop)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-floor" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (go (method-of-object this idle)) + ) + +(deftype fac-break-fence (process-focusable) + ((notify-actor entity-actor) + ) + (:state-methods + idle + die + ) + ) + + +(defstate idle (fac-break-fence) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((gp-0 (the-as object (-> block param 0)))) + (format #t "roboguard::handle-events: got impact-impulse ~M~%" (-> (the-as rigid-body-impact gp-0) impulse)) + (when (< 16384.0 (-> (the-as rigid-body-impact gp-0) impulse)) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.15)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 192 (seconds 0.1)) + (go-virtual die) + #t + ) + ) + ) + ) + ) + :code sleep-code + ) + +(defstate die (fac-break-fence) + :virtual #t + :enter (behavior () + '() + ) + :code (behavior () + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +(defmethod get-inv-mass ((this fac-break-fence)) + 6.6666665 + ) + +(deftype fac-break-fence-a (fac-break-fence) + ((pad uint8 4) + ) + ) + + +(defskelgroup skel-fac-break-fence-a fac-break-fence-a fac-break-fence-a-lod0-jg fac-break-fence-a-idle-ja + ((fac-break-fence-a-lod0-mg (meters 999999))) + :bounds (static-spherem 9 6 0 12) + ) + +(defskelgroup skel-fac-break-fence-a-explode fac-break-fence-a fac-break-fence-a-explode-lod0-jg fac-break-fence-a-explode-idle-ja + ((fac-break-fence-a-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +(define *fac-break-fence-a-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :collide-sound (static-sound-name "fence-debris") + :collide-sound-interval (seconds 0.4) + ) + ) + +(defstate die (fac-break-fence-a) + :virtual #t + :enter (behavior () + (local-vars (v1-10 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (get-trans s4-0 0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-0 0) (-> self root trans))) + (s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (.lvf vf1 (&-> s4-1 quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (if (< (the int v1-10) 0) + (vector-negate-in-place! s4-1) + ) + (vector+float*! (-> gp-0 fountain-rand-transv-lo) s5-1 s4-1 49152.0) + ) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 49152.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 262144.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 0.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-fence-a-explode" (the-as (pointer level) #f)) + 6 + gp-0 + *fac-break-fence-a-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((a1-9 (new 'static 'vector :x 49152.0 :y 24576.0 :w 1.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) + (cond + ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-hit-fence") + (sound-play "fence-break") + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this fac-break-fence-a) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 36864.0 24576.0 0.0 49152.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-fence-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (if (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + (go (method-of-object this idle)) + ) + ) + +(deftype fac-break-fence-b (fac-break-fence) + ((pad uint8 4) + ) + ) + + +(defskelgroup skel-fac-break-fence-b fac-break-fence-b fac-break-fence-b-lod0-jg fac-break-fence-b-idle-ja + ((fac-break-fence-b-lod0-mg (meters 999999))) + :bounds (static-spherem 10 6 0 12.5) + ) + +(defskelgroup skel-fac-break-fence-b-explode fac-break-fence-b fac-break-fence-b-explode-lod0-jg fac-break-fence-b-explode-idle-ja + ((fac-break-fence-b-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +(define *fac-break-fence-b-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :collide-sound (static-sound-name "fence-debris") + :collide-sound-interval (seconds 0.4) + ) + ) + +(defstate die (fac-break-fence-b) + :virtual #t + :enter (behavior () + (local-vars (v1-10 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (get-trans s4-0 0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-0 0) (-> self root trans))) + (s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (.lvf vf1 (&-> s4-1 quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (if (< (the int v1-10) 0) + (vector-negate-in-place! s4-1) + ) + (vector+float*! (-> gp-0 fountain-rand-transv-lo) s5-1 s4-1 49152.0) + ) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 49152.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 262144.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 0.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-fence-b-explode" (the-as (pointer level) #f)) + 6 + gp-0 + *fac-break-fence-b-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((a1-9 (new 'static 'vector :x 49152.0 :y 24576.0 :w 1.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) + (cond + ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-hit-fence") + (sound-play "fence-break") + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this fac-break-fence-b) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 40960.0 24576.0 0.0 51200.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-fence-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (if (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + (go (method-of-object this idle)) + ) + ) + +(deftype fac-break-fence-c (fac-break-fence) + ((pad uint8 4) + ) + ) + + +(defskelgroup skel-fac-break-fence-c fac-break-fence-c fac-break-fence-c-lod0-jg fac-break-fence-c-idle-ja + ((fac-break-fence-c-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +(defskelgroup skel-fac-break-fence-c-explode fac-break-fence-c fac-break-fence-c-explode-lod0-jg fac-break-fence-c-explode-idle-ja + ((fac-break-fence-c-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +(define *fac-break-fence-c-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :collide-sound (static-sound-name "fence-debris") + :collide-sound-interval (seconds 0.4) + ) + ) + +(defmethod init-from-entity! ((this fac-break-fence-c) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 49152.0 0.0 0.0 73728.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-fence-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (if (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + (go (method-of-object this idle)) + ) + ) + +(defstate idle (fac-break-fence-c) + :virtual #t + :code sleep-code + :post ja-post + ) + +(defstate die (fac-break-fence-c) + :virtual #t + :enter (behavior () + (local-vars (v1-10 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (get-trans s4-0 0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-0 0) (-> self root trans))) + (s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (.lvf vf1 (&-> s4-1 quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (if (< (the int v1-10) 0) + (vector-negate-in-place! s4-1) + ) + (vector+float*! (-> gp-0 fountain-rand-transv-lo) s5-1 s4-1 49152.0) + ) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 49152.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 262144.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 0.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-fence-c-explode" (the-as (pointer level) #f)) + 6 + gp-0 + *fac-break-fence-c-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((a1-9 (new 'static 'vector :x 49152.0 :y 24576.0 :w 1.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) + (cond + ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-hit-fence") + (sound-play "fence-break") + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +(deftype fac-switch (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (lever-jmod joint-mod-rotate-local :inline) + (part-red sparticle-launch-control :overlay-at part) + (part-green sparticle-launch-control) + (minimap connection-minimap) + ) + (:state-methods + idle + (done symbol) + ) + (:methods + (is-done? (_type_) symbol) + ) + ) + + +(defskelgroup skel-fac-switch fac-switch fac-switch-lod0-jg fac-switch-idle-ja + ((fac-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defmethod is-done? ((this fac-switch)) + (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (let ((a0-2 (res-lump-struct (-> this entity) 'task-name string))) + (if a0-2 + (task-closed? a0-2) + #f + ) + ) + ) + ) + +(defmethod relocate ((this fac-switch) (offset int)) + (when (nonzero? (-> this part-green)) + (if (nonzero? (-> this part-green)) + (&+! (-> this part-green) offset) + ) + ) + (call-parent-method this offset) + ) + +(defstate idle (fac-switch) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((gp-0 (the-as object (-> block param 1)))) + (when (and (= (-> (find-offending-process-focusable proc (the-as attack-info gp-0)) type) target) + (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop punch spin roll uppercut bonk)) + ) + (when (and *target* (focus-test? *target* indax)) + (let ((gp-1 (res-lump-struct (-> self entity) 'on-activate structure))) + (if gp-1 + (script-eval (the-as pair gp-1)) + ) + ) + (sound-play "floor-switch") + (go-virtual done #f) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (setup-masks (-> self draw) 4 0) + (setup-masks (-> self draw) 0 2) + (quaternion-identity! (-> self lever-jmod rotation)) + ) + :exit (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + ) + :trans (behavior () + (cond + ((task-open? (res-lump-struct (-> self entity) 'task-name string)) + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 129) (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) + ) + ) + ) + (spawn-from-cspace (-> self part) (joint-node fac-switch-lod0-jg glow)) + ) + :code sleep-code + :post ja-post + ) + +(defstate done (fac-switch) + :virtual #t + :enter (behavior ((arg0 symbol)) + (setup-masks (-> self draw) 0 4) + (setup-masks (-> self draw) 2 0) + ) + :trans (behavior () + (spawn-from-cspace (-> self part-green) (joint-node fac-switch-lod0-jg glow)) + ) + :code (behavior ((arg0 symbol)) + (when (> (-> self actor-group-count) 0) + (dotimes (s5-0 (length (-> self actor-group 0))) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-7 (-> self actor-group 0 data s5-0 actor)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cond + ((not arg0) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.3)) + (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) + (f30-0 (cos f28-0)) + (f0-2 (sin f28-0)) + ) + (quaternion-set! (-> self lever-jmod rotation) f0-2 0.0 0.0 f30-0) + ) + (suspend) + ) + ) + (let ((gp-2 (res-lump-struct (-> self entity) 'cutaway-camera structure))) + (when (and gp-2 *target*) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (set-setting! 'entity-name gp-2 0.0 0) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 3)) + '() + (suspend) + ) + ) + (remove-setting! 'entity-name) + (while (not (process-release? *target*)) + (suspend) + ) + ) + ) + ) + (else + (quaternion-set! (-> self lever-jmod rotation) 0.34202015 0.0 0.0 0.9396926) + ) + ) + (sleep-code) + ) + :post pusher-post + ) + +(defmethod init-from-entity! ((this fac-switch) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 4) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 5) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-20 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this minimap) #f) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-26 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-26 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-26)) + ) + (else + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (init (-> this lever-jmod) this (the-as uint 4) (joint-mod-base-flags attached)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 753) this)) + (set! (-> this part-green) (create-launch-control (-> *part-group-id-table* 754) this)) + (if (is-done? this) + (go (method-of-object this done) #t) + (go (method-of-object this idle)) + ) + ) + +(deftype fac-move-plat-a (plat) + ((dead-set-time float) + ) + (:state-methods + locking-down + ) + (:methods + (fac-move-plat-a-method-39 (_type_) none) + ) + ) + + +(defskelgroup skel-fac-move-pla fac-move-plat-a fac-move-plat-a-lod0-jg fac-move-plat-a-idle-ja + ((fac-move-plat-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +(defmethod get-art-group ((this fac-move-plat-a)) + (art-group-get-by-name *level* "skel-fac-move-pla" (the-as (pointer level) #f)) + ) + +(defmethod init-collision! ((this fac-move-plat-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this root pause-adjust-distance) 573440.0) + 0 + (none) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod base-plat-method-33 ((this fac-move-plat-a)) + (set-vector! (-> this root scale) 1.4 1.4 1.6 1.0) + (none) + ) + +(defmethod deactivate ((this fac-move-plat-a)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + ((method-of-type plat deactivate) this) + (none) + ) + +(defmethod go-initial-state ((this fac-move-plat-a)) + (set! (-> this dead-set-time) (res-lump-float (-> this entity) 'fac-plat-dead-set :default 0.5)) + (cond + ((or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (task-closed? (res-lump-struct (-> this entity) 'task-name string)) + ) + (fac-move-plat-a-method-39 this) + (go (method-of-object this plat-idle)) + ) + (else + (go (method-of-object this plat-path-active)) + ) + ) + ) + +;; WARN: Return type mismatch vector vs none. +(defmethod fac-move-plat-a-method-39 ((this fac-move-plat-a)) + (set! (-> this path-pos) (-> this dead-set-time)) + (get-point-at-percent-along-path! (-> this path) (-> this basetrans) (-> this path-pos) 'interp) + (none) + ) + +(defstate plat-idle (fac-move-plat-a) + :virtual #t + :event plat-event + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((t9-1 (-> (find-parent-state) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defstate plat-path-active (fac-move-plat-a) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual locking-down) + ) + (else + (plat-event proc argc message block) + ) + ) + ) + :exit (behavior () + (sound-stop (-> self sound-id)) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (if (< (vector-vector-distance (-> self root trans) (ear-trans 0)) 163840.0) + (sound-play "move-plat-loop" :id (-> self sound-id) :position (-> self root trans)) + ) + (let ((v1-11 (shr (-> self sync period) 1))) + (if (< (mod (current-time) (the-as time-frame v1-11)) + (mod (-> self clock old-frame-counter) (the-as time-frame v1-11)) + ) + (sound-play "move-plat-hit") + ) + ) + (plat-trans) + ) + :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 plat-post + ) + +(defstate locking-down (fac-move-plat-a) + :virtual #t + :event plat-event + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + :trans plat-trans + :code (behavior () + (let ((f30-0 (-> self dead-set-time))) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (set! (-> self path-pos) + (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) gp-0)))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (suspend) + ) + ) + (suspend) + (set! (-> self path-pos) f30-0) + ) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (sleep-code) + ) + :post plat-post + ) + +(deftype fac-move-plat-b (plat) + () + ) + + +(defskelgroup skel-fac-move-pla fac-move-plat-b fac-move-plat-b-lod0-jg fac-move-plat-b-idle-ja + ((fac-move-plat-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) + +(defmethod get-art-group ((this fac-move-plat-b)) + (art-group-get-by-name *level* "skel-fac-move-pla" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod init-collision! ((this fac-move-plat-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 22528.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this root pause-adjust-distance) 327680.0) + (none) + ) + +(defmethod deactivate ((this fac-move-plat-b)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + ((method-of-type plat deactivate) this) + (none) + ) + +(defmethod go-initial-state ((this fac-move-plat-b)) + (let ((f0-0 (res-lump-float (-> this entity) 'fac-plat-dead-start :default -1.0))) + (if (>= f0-0 0.0) + (get-point-at-percent-along-path! (-> this path) (-> this basetrans) f0-0 'interp) + ) + ) + (if (and (nonzero? (res-lump-value (-> this entity) 'fac-plat-reset-stopped uint128 :time -1000000000.0)) + (not (task-closed? (res-lump-struct (-> this entity) 'task-name string))) + ) + (go (method-of-object this plat-idle)) + (go (method-of-object this plat-path-active)) + ) + ) + +(defstate plat-idle (fac-move-plat-b) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual plat-path-active) + ) + (('bonk) + (start-bounce! self) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((t9-1 (-> (find-parent-state) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defstate plat-path-active (fac-move-plat-b) + :virtual #t + :event plat-event + :exit (behavior () + (sound-stop (-> self sound-id)) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (if (< (vector-vector-distance (-> self root trans) (ear-trans 0)) 163840.0) + (sound-play "move-plat-loop" :id (-> self sound-id) :position (-> self root trans)) + ) + (let ((v1-11 (shr (-> self sync period) 1))) + (if (< (mod (current-time) (the-as time-frame v1-11)) + (mod (-> self clock old-frame-counter) (the-as time-frame v1-11)) + ) + (sound-play "move-plat-hit") + ) + ) + (plat-trans) + ) + :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 plat-post + ) + +(deftype fac-rotfan (process-drawable) + ((root collide-shape :override) + (motor-noise sound-id) + (effect-opacity float) + (no-collision-timer time-frame) + (attack-id int32) + ) + (:state-methods + idle + spindown + out + ) + (:methods + (is-out? (_type_) symbol) + ) + ) + + +(defskelgroup skel-fac-rotfan fac-rotfan fac-rotfan-lod0-jg fac-rotfan-idle-ja + ((fac-rotfan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +(defmethod is-out? ((this fac-rotfan)) + (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (task-closed? (res-lump-struct (-> this entity) 'task-name string)) + ) + ) + +(defbehavior fac-rotfan-part-trans fac-rotfan () + (when (not (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> *part-id-table* 2832 init-specs 8 initial-valuef) (-> self effect-opacity)) + (if (< (-> self effect-opacity) 30.0) + (set! (-> *part-id-table* 2832 init-specs 8 random-rangef) 0.0) + ) + (spawn-from-cspace (-> self part) (joint-node fac-rotfan-lod0-jg electrified)) + ) + (none) + ) + +(defstate idle (fac-rotfan) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual spindown) + ) + (('touch) + (let* ((s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when (and gp-0 (= (-> gp-0 type) target) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root) + (the-as uint 4) + ) + ) + (when (time-elapsed? (-> self no-collision-timer) (-> *TARGET-bank* hit-invulnerable-timeout)) + (let ((s4-1 + (vector-negate! (new 'stack-no-clear 'vector) (the-as vector (-> self node-list data 3 bone transform))) + ) + ) + (set! (-> s4-1 y) 0.0) + (vector-xz-normalize! s4-1 1.0) + (when (send-event + gp-0 + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint (-> self attack-id))) + (damage 0.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (vector s4-1) + (shove-back (meters 6)) + (shove-up (meters 1)) + (control (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self no-collision-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (ja-no-eval :group! fac-rotfan-spin-ja :num! (loop! 0.5) :frame-num 0.0) + (set! (-> self effect-opacity) 40.0) + (set! (-> self no-collision-timer) 0) + 0 + ) + :trans fac-rotfan-part-trans + :code (behavior () + (let ((f28-0 15.0)) + (new-sound-id) + (until #f + (let ((f30-0 (* 0.05 (the float (mod (current-time) 300))))) + (let ((f26-0 (- f30-0 (* (the float (the int (/ f30-0 5.0))) 5.0)))) + (if (< f26-0 f28-0) + (sound-play-by-name + (static-sound-name "fan-blades-fast") + (new-sound-id) + (the int (* 1024.0 (rand-vu-float-range 0.75 1.0))) + -1219 + 0 + (sound-group) + #t + ) + ) + (set! f28-0 f26-0) + ) + (ja :group! fac-rotfan-spin-ja :num! (identity f30-0)) + ) + (suspend) + ) + ) + #f + ) + :post (behavior () + (sound-play "fan-motor-loop" :id (-> self motor-noise)) + (ja-post) + ) + ) + +(defstate spindown (fac-rotfan) + :virtual #t + :trans fac-rotfan-part-trans + :code (behavior () + (set-time! (-> self state-time)) + (let* ((f30-0 15.0) + (f28-0 f30-0) + (gp-0 900) + (f26-0 (* 0.0033333334 (the float (mod (current-time) 300)) f30-0)) + ) + (- f26-0 (* (the float (the int (/ f26-0 5.0))) 5.0)) + (let ((s5-0 #f) + (s4-0 (the-as sound-id #f)) + ) + (while (not (time-elapsed? (-> self state-time) gp-0)) + (let ((f24-0 (/ (the float (- (current-time) (-> self state-time))) (the float gp-0)))) + (set! (-> self effect-opacity) (lerp 40.0 0.0 f24-0)) + (let ((f0-13 (+ f26-0 (* (lerp f30-0 0.0 f24-0) (seconds-per-frame))))) + (set! f26-0 (- f0-13 (* (the float (the int (/ f0-13 15.0))) 15.0))) + ) + ) + (set! f28-0 + (cond + ((not (time-elapsed? (-> self state-time) (seconds 2.035))) + (let ((f24-1 (- f26-0 (* (the float (the int (/ f26-0 5.0))) 5.0)))) + (if (< f24-1 f28-0) + (set! s4-0 + (sound-play-by-name + (static-sound-name "fan-blades-slow") + (new-sound-id) + (the int (* 1024.0 (rand-vu-float-range 0.75 1.0))) + -1524 + 0 + (sound-group) + #t + ) + ) + ) + f24-1 + ) + ) + (else + (when (not s5-0) + (sound-stop s4-0) + (sound-play "fan-blades-stop") + (set! s5-0 #t) + ) + f28-0 + ) + ) + ) + (ja :group! fac-rotfan-spin-ja :num! (identity f26-0)) + (when *sound-player-enable* + (let ((s3-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s3-3 command) (sound-command set-param)) + (set! (-> s3-3 id) (-> self motor-noise)) + (set! (-> s3-3 params pitch-mod) + (the int + (* 1524.0 + (lerp-clamp + -1.4 + -0.1 + (* 0.06666667 (lerp f30-0 0.0 (/ (the float (- (current-time) (-> self state-time))) (the float gp-0)))) + ) + ) + ) + ) + (set! (-> s3-3 params mask) (the-as uint 2)) + (-> s3-3 id) + ) + ) + (suspend) + ) + ) + ) + (sound-stop (-> self motor-noise)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action) + (collide-action) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (sleep-code) + ) + :post transform-post + ) + +(defstate out (fac-rotfan) + :virtual #t + :enter (behavior () + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action) + (collide-action) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + :code (behavior () + (ja :group! fac-rotfan-spin-ja :num! (identity 2.0)) + (sleep-code) + ) + :post ja-post + ) + +(defmethod deactivate ((this fac-rotfan)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this motor-noise)) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +(defmethod init-from-entity! ((this fac-rotfan) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 4) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 4)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 2)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 3) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-22 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this motor-noise) (new-sound-id)) + (set! (-> this root pause-adjust-distance) 327680.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 755) this)) + (let* ((v1-29 *game-info*) + (a0-27 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-27) + (set! (-> this attack-id) (the-as int a0-27)) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-rotfan" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (is-out? this) + (go (method-of-object this out)) + (go (method-of-object this idle)) + ) + ) + +(deftype fac-robot-ass-manager (process) + () + (:state-methods + idle + ) + ) + + +(defstate idle (fac-robot-ass-manager) + :virtual #t + :code sleep-code + ) + +(defmethod init-from-entity! ((this fac-robot-ass-manager) (arg0 entity-actor)) + (process-entity-set! this arg0) + (go (method-of-object this idle)) + ) + +(deftype factory-conveyor (conveyor) + () + ) + + +(defmethod init-fields! ((this factory-conveyor)) + (local-vars (sv-16 res-tag)) + (set! (-> this speed) 22528.0) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this speed-mult-array) (the-as (pointer float) #f)) + (set! (-> this speed-mult-array-len) 0) + (let ((a0-1 (-> this entity))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data a0-1 'scale-factor pointer :tag-ptr (& sv-16)))) + (when v1-3 + (set! (-> this speed-mult-array) (the-as (pointer float) v1-3)) + (set! (-> this speed-mult-array-len) (the-as int (-> sv-16 elt-count))) + ) + ) + ) + (set! (-> this belt-radius) (* 4096.0 (the-as float ((method-of-type res-lump get-property-struct) + (-> this entity) + 'extra-radius + 'interp + -1000000000.0 + (the-as structure 6.0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (set! (-> this root pause-adjust-distance) 327680.0) + 0 + (none) + ) + +(deftype fac-punch-wall (process-drawable) + ((root collide-shape :override) + (notify-actor entity-actor) + (spool-sound-id sound-id) + ) + (:state-methods + idle + die + ) + (:states + perish-immediately + ) + ) + + +(defskelgroup skel-fac-punch-wall fac-punch-wall fac-punch-wall-lod0-jg fac-punch-wall-idle-ja + ((fac-punch-wall-lod0-mg (meters 20)) (fac-punch-wall-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +(defstate idle (fac-punch-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let* ((a1-2 (-> block param 1)) + (v1-1 (find-offending-process-focusable proc (the-as attack-info a1-2))) + ) + (when (and v1-1 + (= (-> v1-1 type) target) + (not (focus-test? v1-1 indax)) + (< (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 163840.0 + ) + ) + (go-virtual die) + #f + ) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate die (fac-punch-wall) + :virtual #t + :enter (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-2 (-> self notify-actor)) + ) + (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-glass-break") + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + (set-time! (-> self state-time)) + (ja-no-eval :group! fac-punch-wall-drop-ja :num! (seek! 10.0 2.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 2.0)) + ) + (set! (-> self spool-sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action play) "glassmsh" -99.0 0) + ) + (ja-no-eval :group! fac-punch-wall-drop-ja :num! (seek! max 2.0) :frame-num 10.0) + (until (ja-done? 0) + (when *sound-player-enable* + (let ((v1-44 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-44 command) (sound-command set-param)) + (set! (-> v1-44 id) (-> self spool-sound-id)) + (set! (-> v1-44 params volume) 696) + (set! (-> v1-44 params mask) (the-as uint 1)) + (-> v1-44 id) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (setup-masks (-> self draw) 1 2) + (sleep-code) + ) + :post ja-post + ) + +(defstate perish-immediately (fac-punch-wall) + :enter (behavior () + (ja :group! fac-punch-wall-drop-ja :num! max) + (setup-masks (-> self draw) 1 2) + (let ((v1-16 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-16 prim-core collide-as) (collide-spec)) + (set! (-> v1-16 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this fac-punch-wall) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 204800.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 2)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 102400.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 102400.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-punch-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this spool-sound-id) (the-as sound-id #f)) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (not (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle)) + (go perish-immediately) + ) + ) diff --git a/goal_src/jak3/levels/factory/ffight-projectile.gc b/goal_src/jak3/levels/factory/ffight-projectile.gc index 6b09d1e0fa..021ebd67cd 100644 --- a/goal_src/jak3/levels/factory/ffight-projectile.gc +++ b/goal_src/jak3/levels/factory/ffight-projectile.gc @@ -7,3 +7,705 @@ ;; DECOMP BEGINS +(defpart 2850 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2851 + :init-specs ((:texture (gun-enemy-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 2852 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.15) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 2853 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2854 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.8) + (:fade-g -0.8) + (:fade-b -0.4) + (:fade-a -0.1875) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2855 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y (meters 5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 2856 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.10666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-ffight-shot-hit-object + :id 763 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2857 :flags (sp3)) (sp-item 2858 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +(defpart 2857 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 2858 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 255.0) + (:g 40.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.42666668 -0.42666668) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ffight-shot-hit + :id 764 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2859 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2860 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2861 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2862 :period (seconds 30) :length (seconds 0.167)) + ) + ) + +(defpart 2859 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2860 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 40.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.4) + (:fade-g -0.13333334) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2861 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2862 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 30.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.26666668) + (:fade-g -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-ffight-shot-die + :id 765 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(deftype ffight-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + + +(defmethod deal-damage! ((this ffight-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(defmethod projectile-method-24 ((this ffight-shot)) + (draw-beam (-> *part-id-table* 2855) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 2856)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this ffight-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 2851 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2851 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 2851) a1-0 s5-1 #f) + (set! (-> *part-id-table* 2851 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 2852) s4-0) + (launch-particles (-> *part-id-table* 2853) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f28-1 (* 0.000015258789 f30-0)) + (f30-1 (-> *part-id-table* 2854 init-specs 3 initial-valuef)) + ) + (-> *part-id-table* 2854 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) (* f28-1 f30-1)) + (launch-particles (-> *part-id-table* 2854) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) f30-1) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this ffight-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 763 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 763) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 763) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 764 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 764) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 764) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod play-impact-sound ((this ffight-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "ffight-shot-fir") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "fighter-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + (sound-play "ffight-shot-hit") + ) + ) + ) + 0 + (none) + ) + +(defstate impact (ffight-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +(defun ffight-shot-move ((arg0 ffight-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 65536.0 f0-0) + (vector-normalize! s4-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod made-impact? ((this ffight-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +(defmethod setup-collision! ((this ffight-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this ffight-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'ffight-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) ffight-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) 1.0) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-ffight-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 symbol)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as projectile (spawn-projectile ffight-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +(set! (-> *lightning-spec-id-table* 27) (new 'static 'lightning-spec + :name "lightning-trail-ffight-ffight" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(set! (-> *lightning-spec-id-table* 28) (new 'static 'lightning-spec + :name "lightning-fractal-ffight-ffight" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(defpart 2863 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 2864 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup part-ffight-lightning-glow + :id 766 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2864 :fade-after (meters 100) :flags (sp6)) (sp-item 2863 :fade-after (meters 100) :flags (sp6))) + ) diff --git a/goal_src/jak3/levels/factory/ftank-projectile.gc b/goal_src/jak3/levels/factory/ftank-projectile.gc index e274603f93..aa3befe9c5 100644 --- a/goal_src/jak3/levels/factory/ftank-projectile.gc +++ b/goal_src/jak3/levels/factory/ftank-projectile.gc @@ -7,3 +7,612 @@ ;; DECOMP BEGINS +(defpart 2865 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2866 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 16)) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 2867 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.15) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 2868 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2869 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0 10.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b 1.6) + (:fade-a -0.375) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2870 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 2)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 255.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 2871 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.10666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-ftank-shot-hit-object + :id 767 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2872 :flags (sp3)) (sp-item 2873 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +(defpart 2872 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 2873 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 0.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 128.0 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.21333334 -0.21333334) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ftank-shot-hit + :id 768 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2874 :flags (sp3 sp7))) + ) + +(defpart 2874 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 30.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters -0.033333335)) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -4.25) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-ftank-shot-die + :id 769 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(deftype ftank-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + + +(defmethod deal-damage! ((this ftank-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(defmethod projectile-method-24 ((this ftank-shot)) + (draw-beam (-> *part-id-table* 2870) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 2871)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this ftank-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 2866 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2866 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 2866) a1-0 s5-1 #f) + (set! (-> *part-id-table* 2866 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 2867) s4-0) + (launch-particles (-> *part-id-table* 2868) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f28-1 (* 0.000015258789 f30-0)) + (f30-1 (-> *part-id-table* 2869 init-specs 3 initial-valuef)) + ) + (-> *part-id-table* 2869 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) (* f28-1 f30-1)) + (launch-particles (-> *part-id-table* 2869) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) f30-1) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this ftank-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 767 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 767) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 767) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 768 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 768) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 768) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod play-impact-sound ((this ftank-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "tank-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "tank-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +(defstate impact (ftank-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + (when *traffic-manager* + (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-5 sphere quad) (-> self root trans quad)) + (set! (-> v1-5 sphere r) 40960.0) + (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (set! (-> v1-5 notify-radius) 122880.0) + (set! (-> v1-5 danger-level) 1.0) + (set! (-> v1-5 decay-rate) 0.0) + (set! (-> v1-5 flags) (the-as uint 1)) + (set! (-> v1-5 danger-type) (the-as uint 0)) + (set! (-> v1-5 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-5) + ) + ) + ) + ) + +(defun ftank-shot-move ((arg0 ftank-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 65536.0 f0-0) + (vector-normalize! s4-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod made-impact? ((this ftank-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +(defmethod setup-collision! ((this ftank-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this ftank-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fac-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) ftank-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-ftank-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as projectile (spawn-projectile ftank-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +(set! (-> *lightning-spec-id-table* 29) (new 'static 'lightning-spec + :name "lightning-trail-ftank-ftank" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(set! (-> *lightning-spec-id-table* 30) (new 'static 'lightning-spec + :name "lightning-fractal-ftank-ftank" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(defpart 2875 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 2876 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup part-ftank-lightning-glow + :id 770 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2876 :fade-after (meters 100) :flags (sp6)) (sp-item 2875 :fade-after (meters 100) :flags (sp6))) + ) diff --git a/goal_src/jak3/levels/factory/fturret-projectile.gc b/goal_src/jak3/levels/factory/fturret-projectile.gc index 721d0aaad7..0522cd5089 100644 --- a/goal_src/jak3/levels/factory/fturret-projectile.gc +++ b/goal_src/jak3/levels/factory/fturret-projectile.gc @@ -7,3 +7,695 @@ ;; DECOMP BEGINS +(defpart 2877 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2878 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.25)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.0016666667)) + (:fade-a -2.1333334) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 2879 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.6) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2880 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2881 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 8.0 8.0) + (:z (meters 0) (meters -3)) + (:scale-x (meters 0.4) (meters 0.4)) + (:scale-y (meters 0.4) (meters 0.4)) + (:r 192.0) + (:g 64.0 128.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.00234375)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.2 -2.4) + (:fade-a -0.53333336 -2.1333334) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2882 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 2883 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 4515.75)) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-a -7.285714) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 1024.0) + ) + ) + +(defpartgroup group-fturret-shot-hit-object + :id 771 + :duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2884 :flags (sp3)) (sp-item 2885 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +(defpart 2884 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +(defpart 2885 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.42666668 -0.42666668) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-fturret-shot-hit + :id 772 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2886 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2887 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2888 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2889 :period (seconds 30) :length (seconds 0.167)) + ) + ) + +(defpart 2886 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2887 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-b -0.13333334) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2888 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2889 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-fturret-grenade + :id 773 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2890 :fade-after (meters 200) :falloff-to (meters 200))) + ) + +(defpart 2890 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 32.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16 -0.16) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0)) + ) + ) + +(defpartgroup group-fturret-shot-die + :id 774 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(deftype fturret-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + + +(defmethod deal-damage! ((this fturret-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(defmethod projectile-method-24 ((this fturret-shot)) + (draw-beam (-> *part-id-table* 2882) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 2883)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this fturret-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 2878 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2878 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 2878) a1-0 s5-1 #f) + (set! (-> *part-id-table* 2878 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 2879) s4-0) + (launch-particles (-> *part-id-table* 2880) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000027126736 f30-0)) + (f30-1 (-> *part-id-table* 2881 init-specs 3 initial-valuef)) + (f28-1 (-> *part-id-table* 2881 init-specs 4 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 2881 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 2881 init-specs 4 initial-valuef) (* f26-0 f28-1)) + (launch-particles (-> *part-id-table* 2881) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 2881 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 2881 init-specs 4 initial-valuef) f28-1) + ) + ) + 0 + (none) + ) + ) + +(defmethod projectile-method-26 ((this fturret-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 771 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 771) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 771) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 772 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 772) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 772) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod play-impact-sound ((this fturret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "tank-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "turret-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +(defun fturret-shot-move ((arg0 fturret-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 36864.0 f0-0) + (vector-normalize! s4-0 36864.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod made-impact? ((this fturret-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +(defmethod setup-collision! ((this fturret-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this fturret-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fac-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) fturret-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) 1.0) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + 0 + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-fturret-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as projectile (spawn-projectile fturret-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +(set! (-> *lightning-spec-id-table* 31) (new 'static 'lightning-spec + :name "lightning-trail-fturret-fturret" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(set! (-> *lightning-spec-id-table* 32) (new 'static 'lightning-spec + :name "lightning-fractal-fturret-fturret" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +(defpart 2891 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpart 2892 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup part-fturret-lightning-glow + :id 775 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2892 :fade-after (meters 100) :flags (sp6)) (sp-item 2891 :fade-after (meters 100) :flags (sp6))) + ) diff --git a/goal_src/jak3/levels/factory/h-warf.gc b/goal_src/jak3/levels/factory/h-warf.gc index bda1a4233b..8b3edb541d 100644 --- a/goal_src/jak3/levels/factory/h-warf.gc +++ b/goal_src/jak3/levels/factory/h-warf.gc @@ -5,5 +5,1829 @@ ;; name in dgo: h-warf ;; dgos: LFACTORY +(deftype h-warf-stack-var0 (structure) + ((vec0 vector :inline :offset 0) + (vec1 vector :inline :offset 16) + (mat matrix :inline :offset 32) + ) + ) + +(define-extern factory-shotsleft (function int none)) + ;; DECOMP BEGINS +(define *h-warf-center-of-level* (new 'static 'vector :x 1228800.0 :z 1024000.0 :w 1.0)) + +(defskelgroup skel-h-warf hellcat hellcat-lod0-jg hellcat-idle-ja + ((hellcat-lod0-mg (meters 20)) (hellcat-lod1-mg (meters 40)) (hellcat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow hellcat-shadow-mg + :origin-joint-index 3 + ) + +(define *h-warf-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 10.0 + :inv-mass 0.1 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 6) (meters 6)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 20) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*h-warf-constants* + :flags #x40408 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 30) + :inv-max-engine-thrust 0.000008138021 + :engine-response-rate 60.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.3 + :air-drag-factor 1.0 + :steering-thruster-factor 30.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 300) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.5 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000034877234 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.5 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters -2) + :turning-accel (meters 12) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 6.5) + :string-max-height (meters 6.5) + :string-min-length (meters 13.4) + :string-max-length (meters 17.5) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 11059.2 :z -51200.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 14336.0 :w 1.0) + (new 'static 'vector :x 20480.0 :y 14336.0 :w 1.0) + (new 'static 'vector :y 14336.0 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 8 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "impact-hard") + :glance-sound (static-sound-name "impact-soft") + :impact-sound (static-sound-name "impact-hard") + :explode-sound (static-sound-name "hellcat-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-8") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 3 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 1) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 4096.0 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 4096.0 :z -17612.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 5529.6 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 5529.6 :z -17612.8 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 4096.0 :z -16384.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 4096.0 :z -16384.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :x -5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :y 6963.2 :z 6922.24 :w 1.0) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 10362.88 :y 4710.4 :z -16998.4 :w 1.0) + (new 'static 'vector :x -10362.88 :y 4710.4 :z -16998.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.005 + :hit-points 30.0 + :inv-hit-points 0.033333335 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 6144.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 2048.0 :z -7782.4 :w 1.0) + :brake-local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 409.6 :z 24576.0 :w 1.0) + (new 'static 'vector :x 3276.8 :y 409.6 :z 25395.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3276.8 :y 409.6 :z 25395.2 :w 1.0) + (new 'static 'vector :x -3686.4 :y 409.6 :z 24576.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 8601.6 :z -409.6 :w 1.0) + (new 'static 'vector :x 8601.6 :y -409.6 :z 2867.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -8601.6 :y -409.6 :z 2867.2 :w 1.0) + (new 'static 'vector :x -8601.6 :z -409.6 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + (new 'static 'vector :x 10240.0 :y -409.6 :z -13926.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -10240.0 :y -409.6 :z -13926.4 :w 1.0) + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 5120.0 :y 819.2 :z 2457.6 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -5120.0 :y 819.2 :z 2457.6 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3686.4 :z -8192.0 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1351.68 :y 2048.0 :w 1.0) + (new 'static 'vector :x -1351.68 :y 2048.0 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +(deftype h-warf (hvehicle) + ((minalt float) + (curalt float) + (maxalt float) + (forward vector :inline) + (langvel vector :inline) + (rollerr float) + (pitcherr float) + (straighterr float) + (alterr float) + (rolling symbol) + (speed float) + (poierr float) + (poipos float) + (poivel float) + (bigshotcount int8) + (deathspin symbol) + (deathrot vector :inline) + (birth time-frame) + (stop-time time-frame) + (bounce-state? symbol) + (bounce-angle float) + (fire-time time-frame 4) + (l1-fire-time time-frame) + (l1-recharge-time time-frame) + (snd-cmd-time time-frame) + (damage-loop sound-id) + (damage-loop-playing? symbol) + (damage-loop-index uint8) + (engine-sound sound-id) + (engine-boost-sound sound-id) + (wind-noise-sound sound-id) + (wind-noise-playing? symbol) + (track-obj handle) + (track-joint int8) + (wind float) + ) + (:methods + (h-warf-method-162 (_type_ time-frame) symbol) + (h-warf-method-163 (_type_ vector) float) + (draw-thrusters (_type_ float vector vector) none) + ) + ) + + +(defmethod relocate ((this h-warf) (offset int)) + (call-parent-method this offset) + ) + +(defun impact-reduction ((arg0 int)) + (fmax 0.0 (fmin 1.0 (* 0.0026666669 (the float (+ (- -90 arg0) (current-time)))))) + ) + +(defun steer-attenuation ((arg0 int)) + 0.0 + (let ((f0-2 (- 1.0 (fmax 0.0 (fmin 1.0 (* 0.0033333334 (the float (+ (- -90 arg0) (current-time))))))))) + (* f0-2 f0-2) + ) + ) + +(deftype warf-asc (structure) + ((asc float) + (des float) + ) + ) + + +(defun ascention-atten! ((arg0 float)) + (let ((v0-0 (new 'static 'vector))) + 0.0 + (cond + ((< arg0 1286144.0) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 0.0) + ) + ((< arg0 1331200.0) + (let ((f0-6 (- 1.0 (* 0.000022194603 (- 1331200.0 arg0))))) + (set! (-> v0-0 x) (+ 1.0 (* 0.0 f0-6))) + (set! (-> v0-0 y) (* 0.7 f0-6)) + ) + ) + ((< arg0 1351680.0) + (let ((f0-10 (- 1.0 (* 0.000048828126 (- 1351680.0 arg0))))) + (set! (-> v0-0 x) (+ 1.0 (* 0.0 f0-10))) + (set! (-> v0-0 y) (+ 0.7 (* 0.3 f0-10))) + ) + ) + ((< arg0 1638400.0) + (let ((f0-15 (- 1.0 (* 0.0000034877232 (- 1638400.0 arg0))))) + (set! (-> v0-0 x) (+ 1.0 (* -0.5 f0-15))) + (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-15))) + ) + ) + ((< arg0 1761280.0) + (let ((f0-20 (- 1.0 (* 0.000008138021 (- 1761280.0 arg0))))) + (set! (-> v0-0 x) (+ 0.5 (* -0.5 f0-20))) + (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-20))) + ) + ) + (else + (set! (-> v0-0 x) 0.0) + (set! (-> v0-0 y) 1.0) + ) + ) + v0-0 + ) + ) + +(defmethod init-collision! ((this h-warf)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 26624.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 4096.0 1228.8 9011.2 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -4096.0 1228.8 9011.2 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 2048.0 -409.6 6144.0) + (set! (-> v1-15 nav-radius) 24576.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 4096.0 -10240.0 8192.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 10240.0 2048.0 -8192.0 6144.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -10240.0 2048.0 -8192.0 6144.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 26624.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod h-warf-method-162 ((this h-warf) (arg0 time-frame)) + (let ((a3-0 0) + (v1-0 -1) + ) + (dotimes (a2-0 4) + (when (< a3-0 (- (current-time) (-> this fire-time a2-0))) + (set! a3-0 (the-as int (- (current-time) (-> this fire-time a2-0)))) + (set! v1-0 a2-0) + ) + ) + (when (and (>= v1-0 0) (time-elapsed? (-> this fire-time v1-0) arg0)) + (set-time! (-> this fire-time v1-0)) + (return #t) + ) + ) + #f + ) + +(defmethod control-hook-player ((this h-warf)) + (local-vars (sv-1040 vector)) + (b! (focus-test? *target* dead grabbed) cfg-39 :delay (nop!)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-0 (* 182.04445 (seconds-per-frame) (* 180.0 (-> this controls steering)))) + (vector-rotate*! (-> this forward) (-> this forward) s5-0) + ) + (call-parent-method this) + (when (and (cpad-pressed? 0 r1) (h-warf-method-162 this (seconds 1))) + (let ((s3-0 (-> this node-list data 0 bone transform)) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (set-vector! s2-0 0.0 7372.8 10649.6 1.0) + (vector-matrix*! s4-0 s2-0 s3-0) + (sound-play "hellcat-fire") + (set! (-> s5-1 ent) (-> this entity)) + (set! (-> s5-1 charge) 1.0) + (set! (-> s5-1 options) (projectile-options po13)) + (logclear! (-> s5-1 options) (projectile-options po14 po15 po16)) + (set! (-> s5-1 pos quad) (-> s4-0 quad)) + (set! (-> s5-1 notify-handle) (the-as handle #f)) + (set! (-> s5-1 owner-handle) (process->handle *target*)) + (set! (-> s5-1 target-handle) (the-as handle #f)) + (set! (-> s5-1 target-pos quad) (the-as uint128 0)) + (set! (-> s5-1 ignore-handle) (process->handle (send-event this 'get-vehicle))) + (let* ((v1-33 *game-info*) + (a0-26 (+ (-> v1-33 attack-id) 1)) + ) + (set! (-> v1-33 attack-id) a0-26) + (set! (-> s5-1 attack-id) a0-26) + ) + (set! (-> s5-1 timeout) (seconds 4)) + (set-vector! s2-0 0.0 0.0 4096000.0 1.0) + (vector-rotate*! (-> s5-1 vel) s2-0 s3-0) + (vector+! (-> s5-1 vel) (-> s5-1 vel) (-> this rbody lin-velocity)) + (let ((s1-1 (new 'stack 'boxed-array collide-shape 128)) + (s0-1 (new 'stack-no-clear 'vector)) + ) + (set! sv-1040 (new 'stack-no-clear 'vector)) + 0 + (set-vector! s2-0 0.0 0.0 204800.0 1.0) + (vector-matrix*! s0-1 s2-0 s3-0) + (set-vector! s2-0 0.0 0.0 1658880.0 1.0) + (vector-rotate*! sv-1040 s2-0 s3-0) + (set! (-> s0-1 w) 32768.0) + (set! (-> sv-1040 w) 32768.0) + (set! (-> s1-1 length) (fill-actor-list-for-sphere + *actor-hash* + s0-1 + sv-1040 + (-> sv-1040 w) + (the-as (pointer collide-shape) (-> s1-1 data)) + (-> s1-1 allocated-length) + -1 + ) + ) + (let ((a0-41 (find-nearest-focusable + (the-as (array collide-shape) s1-1) + s0-1 + 1658880.0 + (search-info-flag prefer-angle cull-angle-simple) + (search-info-flag) + (-> s3-0 fvec) + s4-0 + 10922.667 + ) + ) + ) + (when a0-41 + (vector-! (-> s5-1 vel) (get-trans a0-41 3) (-> s5-1 pos)) + (vector-normalize! (-> s5-1 vel) 4096000.0) + ) + ) + ) + (spawn-projectile gun-warf-shot s5-1 this *default-dead-pool*) + ) + 0 + ) + (when (and (time-elapsed? (-> this l1-recharge-time) (seconds 20)) (< (-> this bigshotcount) 8)) + (set-time! (-> this l1-recharge-time)) + (+! (-> this bigshotcount) 1) + (factory-shotsleft (-> this bigshotcount)) + ) + (when (and (> (-> this bigshotcount) 0) (cpad-pressed? 0 l1) (time-elapsed? (-> this l1-fire-time) (seconds 2))) + (set-time! (-> this l1-fire-time)) + (let ((s4-3 (-> this node-list data 0 bone transform))) + (let ((s2-1 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'vector)) + (s5-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (set-vector! s3-1 0.0 7372.8 18841.6 1.0) + (vector-matrix*! s2-1 s3-1 s4-3) + (set! (-> s5-2 ent) (-> this entity)) + (set! (-> s5-2 charge) 1.0) + (set! (-> s5-2 options) (projectile-options)) + (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) + (set! (-> s5-2 pos quad) (-> s2-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 handle #f)) + (set! (-> s5-2 target-pos quad) (the-as uint128 0)) + (set! (-> s5-2 ignore-handle) (process->handle (send-event this 'get-vehicle))) + (let* ((v1-90 *game-info*) + (a0-63 (+ (-> v1-90 attack-id) 1)) + ) + (set! (-> v1-90 attack-id) a0-63) + (set! (-> s5-2 attack-id) a0-63) + ) + (set! (-> s5-2 timeout) (seconds 10)) + (set! (-> s5-2 damage) 64.0) + (logior! (-> s5-2 options) (projectile-options po14)) + (set-vector! s3-1 0.0 0.0 819200.0 1.0) + (vector-rotate*! (-> s5-2 vel) s3-1 s4-3) + (vector+! (-> s5-2 vel) (-> s5-2 vel) (-> this rbody lin-velocity)) + (sound-play "hellcat-firealt") + (spawn-projectile warf-projectile s5-2 this *default-dead-pool*) + ) + ) + (+! (-> this bigshotcount) -1) + (factory-shotsleft (-> this bigshotcount)) + ) + (label cfg-39) + 0 + (none) + ) + +(defmethod vehicle-method-79 ((this h-warf)) + 0 + (none) + ) + +(defmethod vehicle-method-106 ((this h-warf)) + (let ((t9-0 (method-of-type hvehicle vehicle-method-106))) + (t9-0 this) + ) + (when (-> this damage-loop-playing?) + (sound-stop (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #f) + (set! (-> this damage-loop-index) (the-as uint 0)) + 0 + ) + (when (nonzero? (-> this wind-noise-sound)) + (sound-stop (-> this wind-noise-sound)) + (set! (-> this wind-noise-playing?) #f) + (set! (-> this wind-noise-sound) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> this engine-sound)) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> this engine-boost-sound)) + (sound-stop (-> this engine-boost-sound)) + (set! (-> this engine-boost-sound) (new 'static 'sound-id)) + 0 + ) + (none) + ) + +(defmethod rigid-body-object-method-38 ((this h-warf)) + (let ((t9-0 (method-of-type hvehicle rigid-body-object-method-38))) + (t9-0 this) + ) + 0.0 + (let ((f0-2 (+ 1.0 (fmax 0.0 (fmin 1.0 (* 0.0000024414062 (-> this speed))))))) + (sound-play-by-name + (static-sound-name "hellcat-engine") + (-> this engine-sound) + 1024 + (the int (* 1524.0 f0-2)) + 0 + (sound-group) + (-> this root trans) + ) + ) + (sound-play-by-name + (static-sound-name "hellcat-boost") + (-> this engine-boost-sound) + (the int (* 1024.0 (-> this engine-thrust))) + 1524 + 0 + (sound-group) + (-> this root trans) + ) + 0.0 + (let ((v1-11 (new 'stack-no-clear 'vector))) + (set! (-> v1-11 quad) (-> this rbody ang-velocity quad)) + (let ((f0-10 (* 0.25 (fabs (-> v1-11 y))))) + (set! (-> v1-11 y) 0.0) + (let* ((f0-11 (+ f0-10 (vector-length v1-11))) + (f0-13 (fmax 0.0 (fmin 1.0 f0-11))) + ) + (seek! (-> this wind) f0-13 (* 2.0 (seconds-per-frame))) + ) + ) + ) + (cond + (#f + (when (-> this wind-noise-playing?) + (sound-stop (-> this wind-noise-sound)) + (set! (-> this wind-noise-playing?) #f) + ) + ) + (else + (sound-play-by-name + (static-sound-name "hellcat-bank") + (-> this wind-noise-sound) + (the int (* 1024.0 (-> this wind))) + (the int (* 1524.0 (+ 0.7 (* 0.25 (-> this wind))))) + 0 + (sound-group) + (-> this root trans) + ) + (set! (-> this wind-noise-playing?) #t) + ) + ) + (when (time-elapsed? (-> this snd-cmd-time) (seconds 2)) + (set-time! (-> this snd-cmd-time)) + (cond + ((< (-> this hit-points) 0.15) + (if (!= (-> this damage-loop-index) 3) + (sound-stop (-> this damage-loop)) + ) + (sound-play "damage-high" :id (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #t) + (set! (-> this damage-loop-index) (the-as uint 3)) + ) + ((< (-> this hit-points) 0.2) + (if (!= (-> this damage-loop-index) 2) + (sound-stop (-> this damage-loop)) + ) + (sound-play "damage-med" :id (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #t) + (set! (-> this damage-loop-index) (the-as uint 2)) + ) + ((< (-> this hit-points) 0.5) + (if (!= (-> this damage-loop-index) 1) + (sound-stop (-> this damage-loop)) + ) + (sound-play "damage-low" :id (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #t) + (set! (-> this damage-loop-index) (the-as uint 1)) + ) + ((and (-> this damage-loop-playing?) (< 0.5 (-> this hit-points))) + (sound-stop (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #f) + (set! (-> this damage-loop-index) (the-as uint 0)) + 0 + ) + ) + ) + (none) + ) + +(defmethod init-rbody-control! ((this h-warf)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-warf" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-warf-constants*) + (vector-reset! (-> this deathrot)) + (set-time! (-> this birth)) + (set-time! (-> this stop-time)) + (set! (-> this deathspin) #f) + (set! (-> this rbody angular-damping) 0.97) + (set-vector! (-> this forward) 0.0 0.0 1.0 1.0) + (set! (-> this bigshotcount) 8) + (factory-shotsleft (-> this bigshotcount)) + (set! (-> this minalt) 1288192.0) + (set! (-> this maxalt) 1966080.0) + (set! (-> this curalt) (-> this minalt)) + (set! (-> this rollerr) 0.0) + (set! (-> this alterr) 0.0) + (set! (-> this pitcherr) 0.0) + (set! (-> this straighterr) 0.0) + (set! (-> this rolling) #f) + (set! (-> this speed) 0.0) + (set! (-> this poierr) 0.0) + (set! (-> this poipos) 0.0) + (set! (-> this poivel) 0.0) + (set! (-> this bounce-state?) #f) + (set! (-> this bounce-angle) 0.0) + (set! (-> this wind) 0.0) + (set! (-> this engine-sound) (new-sound-id)) + (set! (-> this engine-boost-sound) (new-sound-id)) + (set! (-> this wind-noise-sound) (new-sound-id)) + (set! (-> this wind-noise-playing?) #f) + (set! (-> this damage-loop) (new-sound-id)) + (set! (-> this damage-loop-playing?) #f) + (set! (-> this damage-loop-index) (the-as uint 0)) + (set-time! (-> this snd-cmd-time)) + (dotimes (v1-18 4) + (set! (-> this fire-time v1-18) (+ (current-time) (seconds -4))) + ) + (set-time! (-> this l1-fire-time)) + (set-time! (-> this l1-recharge-time)) + (set! *war-factory-vehicle-mask* (-> this draw seg-mask)) + (set! *war-factory-effects-mask* (-> this draw effect-mask)) + 0 + (none) + ) + +(defmethod apply-damage ((this h-warf) (arg0 float) (arg1 rigid-body-impact)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.25)) + (let ((s4-0 0.4)) + (set! *war-factory-vehicle-mask* (-> this draw seg-mask)) + (set! *war-factory-effects-mask* (-> this draw effect-mask)) + (call-parent-method this s4-0 arg1) + ) + (none) + ) + +;; WARN: Return type mismatch vehicle-flag vs none. +(defmethod on-impact ((this h-warf) (arg0 rigid-body-impact)) + (call-parent-method this arg0) + (set! (-> this bounce-state?) #t) + (set! (-> this bounce-angle) 0.0) + (when (< (-> this speed) 2048.0) + (if (time-elapsed? (-> this stop-time) (seconds 1)) + (set-time! (-> this stop-time)) + ) + (when (time-elapsed? (-> this stop-time) (seconds 0.5)) + (set! (-> this hit-points) -1.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + ) + ) + (none) + ) + +(defmethod vehicle-method-97 ((this h-warf) (arg0 float) (arg1 vehicle-physics-work)) + (local-vars (v1-107 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (-> this rbody))) + (mem-copy! (the-as pointer (-> arg1 mat)) (the-as pointer (-> s3-0 matrix)) 64) + (let* ((f28-0 (* -1.0 (-> this controls steering) (-> this info handling tire-steering-angle))) + (f30-0 (cos f28-0)) + (f0-2 (sin f28-0)) + ) + (set! (-> arg1 steering-axis x) f30-0) + (set! (-> arg1 steering-axis y) 0.0) + (set! (-> arg1 steering-axis z) f0-2) + ) + (vector-rotate*! (-> arg1 steering-axis) (-> arg1 steering-axis) (-> arg1 mat)) + (logior! (-> this v-flags) (vehicle-flag in-air)) + (logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (vector-reset! (-> arg1 ground-normal)) + (set! (-> arg1 ground-normal y) 1.0) + (let ((f30-1 (-> this info handling ground-probe-distance))) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (vector-reset! (-> arg1 lift-dir)) + (set! (-> arg1 lift-dir y) -1.0) + (set! (-> arg1 speed-factor) + (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 lin-velocity)))))) + ) + (when (logtest? (-> this info flags) 1) + (vector-float*! (-> arg1 tmp) (-> arg1 mat uvec) -1.0) + (let ((t9-4 vector-lerp!) + (a0-7 (-> arg1 lift-dir)) + (a1-4 (-> arg1 lift-dir)) + (a2-3 (-> arg1 tmp)) + (f0-8 (-> arg1 speed-factor)) + ) + (t9-4 a0-7 a1-4 a2-3 (* f0-8 f0-8)) + ) + (vector-normalize! (-> arg1 lift-dir) 1.0) + ) + (vector-float*! (-> s2-0 move-dist) (-> arg1 lift-dir) (the-as float f30-1)) + (let ((v1-26 s2-0)) + (set! (-> v1-26 radius) 409.6) + (set! (-> v1-26 collide-with) (collide-spec + backgnd + bot + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-26 ignore-process0) #f) + (set! (-> v1-26 ignore-process1) #f) + (set! (-> v1-26 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-26 action-mask) (collide-action solid)) + ) + (dotimes (s1-0 (-> this info physics-model lift-thruster-count)) + (let ((v1-29 (-> this info physics-model lift-thruster-array s1-0)) + (s0-0 (-> arg1 probe-work-array s1-0)) + ) + (vector-reset! (-> s0-0 tire-force)) + (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) + (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) + (let ((a1-9 (-> s0-0 probe-pos))) + (let ((v1-32 (-> s0-0 world-pos))) + (let ((a0-22 (-> arg1 mat uvec))) + (let ((a2-6 (-> this info handling ground-probe-offset))) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-22 quad)) + ) + (.lvf vf4 (&-> v1-32 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-9 quad) vf6) + ) + (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) + (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + quad + ) + ) + (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (set! (-> s0-0 ground-pos y) 0.0) + (vector-reset! (-> s0-0 ground-normal)) + (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) + (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) + (cond + ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) + (logclear! (-> this v-flags) (vehicle-flag in-air)) + (logior! (-> this v-flags) (vehicle-flag on-ground)) + (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) + (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) + (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + ) + (else + (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) + ) + ) + ) + 0 + ) + ) + ) + ) + (set! (-> this lift-thrust 0) 0.0) + (set! (-> this lift-thrust 1) 0.0) + (set! (-> this lift-thrust 2) 0.0) + (set! (-> this lift-thrust 3) 0.0) + (set! (-> this roll-thrust 0) 0.0) + (set! (-> this roll-thrust 1) 0.0) + (when (>= 1 (-> this force-level)) + (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) + (let ((s1-1 (-> arg1 probe-work-array s2-1))) + (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) + (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (let* ((f1-12 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) + (f28-1 (- 1.0 (/ (+ -4096.0 f1-12) (+ -4096.0 f30-1)))) + ) + (if (>= (-> this info handling cos-ground-effect-angle) (vector-dot (-> s1-1 ground-normal) (-> arg1 mat uvec))) + (set! f28-1 0.0) + ) + (set! (-> arg1 tmp y) 0.0) + (set! (-> arg1 tmp x) (-> arg1 velocity z)) + (set! (-> arg1 tmp z) (- (-> arg1 velocity x))) + (vector-normalize! (-> arg1 tmp) 1.0) + (vector+float*! + (-> arg1 normal) + (-> s1-1 ground-normal) + (-> arg1 tmp) + (- (vector-dot (-> s1-1 ground-normal) (-> arg1 tmp))) + ) + (let ((v1-80 (-> arg1 force)) + (a0-45 (-> arg1 normal)) + (f0-37 (* 2.0 f28-1)) + (f1-17 arg0) + ) + (vector-float*! v1-80 a0-45 (* f0-37 + (/ 1.0 f1-17) + (-> this info physics-model inv-lift-thruster-count) + (-> this info info mass) + (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> arg1 normal)))) + ) + ) + ) + (apply-impact! s3-0 (-> arg1 world-pos) (-> arg1 force)) + (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) + (let ((f0-51 (* 8.0 + (-> this info info mass) + (-> this info extra gravity) + (-> this info physics-model inv-lift-thruster-count) + (+ (* (-> this info handling spring-lift-factor) f28-1) + (* 0.75 (-> this jump-thrust) (-> this info handling jump-thrust-factor)) + ) + (- (+ 1.0 (* 2.0 (rand-vu) (-> this power-fluctuation-factor))) (-> this power-fluctuation-factor)) + ) + ) + ) + (+! (-> this lift-thrust s2-1) f0-51) + (vector-float*! (-> arg1 force) (-> arg1 lift-dir) (* -1.0 f0-51)) + ) + ) + (apply-impact! s3-0 (-> arg1 world-pos) (-> arg1 force)) + (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) + (when (and (< 0.0 (-> this info handling tire-friction-factor)) (let ((f0-54 0.0)) + (.lvf vf1 (&-> (-> s1-1 ground-normal) 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-107 vf1) + (< f0-54 v1-107) + ) + ) + (vector+float*! + (-> arg1 normal) + (-> s1-1 wheel-axis) + (-> s1-1 ground-normal) + (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) + ) + (vector-normalize! (-> arg1 normal) 1.0) + (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) + (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) + (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) + (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) + (vector-cross! (-> arg1 tmp) (-> arg1 tmp) (-> arg1 p-body)) + (set! (-> arg1 vel-dot-norm) (vector-dot (-> arg1 velocity) (-> arg1 normal))) + (let ((f0-61 (fabs (-> arg1 vel-dot-norm)))) + (set! (-> arg1 friction-coef) + (smooth-interp + (-> this info handling tire-static-friction) + (-> this info handling tire-dynamic-friction) + f0-61 + (-> this info handling tire-static-friction-speed) + (-> this info handling tire-dynamic-friction-speed) + ) + ) + ) + (set! (-> arg1 friction-coef) + (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> this engine-thrust)))))) + ) + (let ((f0-69 (* (-> arg1 friction-coef) + (-> this info handling tire-friction-factor) + (fmax 0.0 (vector-dot (-> s1-1 ground-normal) (-> s1-1 tire-force))) + ) + ) + ) + (set! (-> arg1 impulse) (/ (* -1.0 (-> arg1 vel-dot-norm)) + (* arg0 (+ (-> s3-0 info inv-mass) (vector-dot (-> arg1 normal) (-> arg1 tmp)))) + ) + ) + (set! (-> arg1 impulse) (fmax (fmin (-> arg1 impulse) f0-69) (- f0-69))) + ) + (vector-float*! (-> arg1 force) (-> arg1 normal) (-> arg1 impulse)) + (apply-impact! s3-0 (-> arg1 world-pos) (-> arg1 force)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod h-warf-method-163 ((this h-warf) (arg0 vector)) + (let ((s3-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (forward-up->inv-matrix s1-0 arg0 *up-vector*) + (matrix-transpose! s1-0 s1-0) + (set! (-> s2-0 quad) (-> this rbody matrix fvec quad)) + (set! (-> s2-0 y) 0.0) + (vector-normalize! s2-0 1.0) + (vector-rotate*! s2-0 s2-0 s1-0) + (let ((f0-3 (vector-dot arg0 (-> this rbody matrix fvec)))) + (if (< (-> s2-0 x) 0.0) + (- f0-3) + ) + ) + (vector-! s5-0 *h-warf-center-of-level* (-> this root trans)) + (set! (-> s5-0 x) (fabs (-> s5-0 x))) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (fabs (-> s5-0 z))) + 0.0 + (let* ((f1-1 (atan (-> s2-0 x) (- (-> s2-0 z)))) + (f30-0 (fmax -1.0 (fmin 1.0 (* 0.000030517578 f1-1)))) + ) + (matrix-transpose! s3-0 (-> this rbody matrix)) + (vector-rotate*! arg0 (-> this forward) s3-0) + (set! f30-0 (cond + ((or (< 1187840.0 (-> s5-0 x)) (< 1187840.0 (-> s5-0 z))) + (if (or (= (-> this controls steering) 0.0) + (and (< 0.0 f30-0) (< 0.0 (-> this controls steering))) + (and (< f30-0 0.0) (< (-> this controls steering) 0.0)) + ) + (set! f30-0 (fmax -1.0 (fmin 1.0 (+ f30-0 (-> this controls steering))))) + ) + f30-0 + ) + (else + (-> this controls steering) + ) + ) + ) + f30-0 + ) + ) + ) + +(defun world-to-local-vec! ((arg0 vector) (arg1 vector) (arg2 matrix)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (matrix-transpose! s4-0 arg2) + (vector-rotate*! arg0 arg1 s4-0) + ) + ) + +(defmethod apply-gravity! ((this h-warf) (arg0 float)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (when (movie?) + (logior! (-> this draw status) (draw-control-status no-draw)) + (disable-physics! this) + ) + (when (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (not (time-elapsed? (-> this birth) (seconds 1)))) + (set! (-> this rbody lin-momentum quad) (-> this rbody matrix fvec quad)) + (vector-normalize! (-> this rbody lin-momentum) 204800.0) + (vector-float*! (-> this rbody lin-momentum) (-> this rbody lin-momentum) (-> this rbody info mass)) + ) + (set! (-> this rbody angular-damping) 0.97) + (when (and (logtest? (-> this v-flags) (vehicle-flag dead)) (not (-> this deathspin))) + (set! (-> this rbody angular-damping) 1.0) + (set! (-> this hit-points) -1.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this deathspin) #t) + (set-vector! s3-0 4096.0 0.0 0.0 1.0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! s4-0 (-> this rbody matrix uvec) (* 4096.0 (rand-vu-float-range -40000.0 40000.0))) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (let ((s2-2 (new 'stack-no-clear 'vehicle-physics-work))) + (set! (-> s2-2 world-pos w) (steer-attenuation (the-as int (-> this impact-time)))) + (set! (-> s2-2 world-pos x) 0.0) + (when (and (< 0.0 (-> this rbody matrix uvec y)) + (and (logtest? (-> this v-flags) (vehicle-flag riding)) (not (-> this bounce-state?))) + ) + (vector-! (the-as vector (-> s2-2 mat)) (-> this root trans) *h-warf-center-of-level*) + (set! (-> s2-2 mat rvec y) 0.0) + (vector-normalize! (the-as vector (-> s2-2 mat)) 1.0) + (set! (-> s2-2 world-pos x) (h-warf-method-163 this (the-as vector (-> s2-2 mat)))) + (set! (-> s2-2 world-normal x) (-> s2-2 world-pos x)) + (vector-reset! s3-0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (+! (-> s3-0 z) 4096.0) + (set! (-> s2-2 velocity quad) (-> *x-vector* quad)) + (let ((f0-19 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) + (set! (-> s2-2 world-pos z) (/ 1.0 f0-19)) + ) + (set! (-> s2-2 world-pos z) (fmin 0.1 (-> s2-2 world-pos z))) + (set! (-> s2-2 world-pos z) (* 49152000.0 (-> s2-2 world-pos z) (-> s2-2 world-pos x))) + (vector-float*! s4-0 (-> s2-2 velocity) (-> s2-2 world-pos z)) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (when (and (logtest? (-> this v-flags) (vehicle-flag riding)) (-> this bounce-state?)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s0-0 quad) (-> this rbody matrix rvec quad)) + (set! (-> s0-0 y) 0.0000000001) + (vector-normalize! s0-0 1.0) + (set! (-> s2-2 world-pos x) (* 0.00024414062 (vector-dot (-> this rbody lin-velocity) s0-0))) + (world-to-local-vec! s1-1 (-> this rbody lin-velocity) (-> this rbody matrix)) + (set! (-> s2-2 world-pos x) (atan2-rad (-> s1-1 x) (-> s1-1 z))) + ) + (set! (-> s2-2 world-pos y) (- (-> s2-2 world-pos x) (-> this straighterr))) + (set! (-> this straighterr) (-> s2-2 world-pos x)) + (set-vector! s3-0 40960.0 0.0 0.0 1.0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! + s4-0 + (-> this rbody matrix fvec) + (- (+ (* 4096000.0 (-> s2-2 world-pos y)) (* 409600.0 (-> s2-2 world-pos x)))) + ) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + (if (= (-> this bounce-angle) 0.0) + (set! (-> this bounce-angle) (-> s2-2 world-pos x)) + ) + (when (or (< (fabs (-> s2-2 world-pos x)) 0.01) + (and (< (-> s2-2 world-pos x) 0.0) (< 0.0 (-> this bounce-angle))) + (and (< 0.0 (-> s2-2 world-pos x)) (< (-> this bounce-angle) 0.0)) + ) + (set! (-> this bounce-state?) #f) + (set! (-> this bounce-angle) 0.0) + (set! (-> this straighterr) 0.0) + ) + ) + 0.0 + 0.0 + (let ((f0-57 (-> this speed))) + (set! (-> s2-2 world-pos z) (-> s2-2 world-normal x)) + (if (< 1.0 (-> s2-2 world-pos z)) + (set! (-> s2-2 world-pos z) 1.0) + ) + (if (< (-> s2-2 world-pos z) -1.0) + (set! (-> s2-2 world-pos z) -1.0) + ) + (let ((f0-61 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ -20480.0 f0-57)))))) + (matrix-rotate-z! (the-as matrix (-> s2-2 mat uvec)) (* 14563.556 (-> s2-2 world-pos z) f0-61)) + ) + ) + (matrix*! (the-as matrix (-> s2-2 mat uvec)) (the-as matrix (-> s2-2 mat uvec)) (-> this rbody matrix)) + (set! (-> s2-2 world-pos x) (- (-> s2-2 mat uvec y))) + (set! (-> s2-2 world-pos y) (- (-> s2-2 world-pos x) (-> this rollerr))) + (set! (-> this rollerr) (-> s2-2 world-pos x)) + (let ((f30-1 (+ (* 32768000.0 (-> s2-2 world-pos y)) (* 1638400.0 (-> s2-2 world-pos x))))) + (set-vector! s3-0 4096.0 0.0 0.0 1.0) + 0.0 + (let ((s1-2 (new 'stack-no-clear 'matrix))) + (let ((f0-76 (* 16384.0 (fmax -1.0 (fmin 1.0 (* 0.0000000012207031 (-> this rbody ang-velocity y) (fabs f30-1)))))) + ) + (matrix-rotate-y! s1-2 f0-76) + ) + (vector-rotate*! s3-0 s3-0 s1-2) + ) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! s4-0 (-> this rbody matrix uvec) f30-1) + ) + (if (and (>= 1 (-> this force-level)) (not (-> this rolling))) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (if (>= (-> this force-level) 1) + (set! (-> this curalt) (-> this rbody matrix trans y)) + ) + (set! (-> this speed) (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec))) + 0.0 + (let* ((v1-138 (-> this rbody lin-velocity)) + (f28-0 (sqrtf (+ (* (-> v1-138 x) (-> v1-138 x)) (* (-> v1-138 z) (-> v1-138 z))))) + (f30-2 (fmax 0.0 (fmin 1.0 (* 0.000030517578 (+ -4096.0 f28-0))))) + ) + (set! (-> s2-2 world-pos x) + (* f30-2 (atan (-> this rbody lin-velocity y) (vector-length (-> this rbody lin-velocity)))) + ) + (if (< 15473.777 (-> s2-2 world-pos x)) + (set! (-> s2-2 world-pos x) 15473.777) + ) + (if (< (-> s2-2 world-pos x) -15473.777) + (set! (-> s2-2 world-pos x) -15473.777) + ) + (cond + ((< (vector-dot (-> this rbody matrix fvec) (-> this rbody lin-velocity)) -16384.0) + (set! (-> s2-2 world-pos x) (- (-> s2-2 world-pos x))) + (set! (-> this curalt) + (- (-> this curalt) + (* (-> this controls lean-z) (+ (* -8192.0 (seconds-per-frame)) (* -0.1 (seconds-per-frame) f28-0))) + ) + ) + ) + (else + (+! (-> this curalt) + (* (-> this controls lean-z) (+ (* -8192.0 (seconds-per-frame)) (* -0.1 (seconds-per-frame) f28-0))) + ) + ) + ) + (when #f + (set-vector! + s4-0 + 0.0 + (* 40.96 (-> this info info mass) (- 1.0 f30-2) (- (-> this curalt) (-> this rbody matrix trans y))) + 0.0 + 1.0 + ) + (add-force! (-> this rbody) s4-0) + ) + ) + (if (< (-> this maxalt) (-> this curalt)) + (set! (-> this curalt) (-> this maxalt)) + ) + (if (< (-> this curalt) (-> this minalt)) + (set! (-> this curalt) (-> this minalt)) + ) + (matrix-rotate-x! (the-as matrix (-> s2-2 mat uvec)) (-> s2-2 world-pos x)) + (matrix*! (the-as matrix (-> s2-2 mat uvec)) (the-as matrix (-> s2-2 mat uvec)) (-> this rbody matrix)) + (set! (-> s2-2 world-pos x) (-> s2-2 mat trans y)) + (set! (-> s2-2 world-pos y) (- (-> s2-2 world-pos x) (-> this pitcherr))) + (set! (-> this pitcherr) (-> s2-2 world-pos x)) + (set-vector! s3-0 0.0 0.0 4096.0 1.0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! + s4-0 + (-> this rbody matrix uvec) + (- (+ (* 196608000.0 (-> s2-2 world-pos y)) (* 16384000.0 (-> s2-2 world-pos x)))) + ) + ) + (if (and (not (-> this rolling)) + (or (logtest? (-> this v-flags) (vehicle-flag dead)) (>= 1 (-> this force-level))) + (>= (-> this speed) 0.0) + ) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (when (< (-> this maxalt) (-> this rbody matrix trans y)) + (vector-float*! s4-0 *up-vector* (* -2000.0 (- (-> this rbody matrix trans y) (-> this maxalt)))) + (add-force! (-> this rbody) s4-0) + ) + (when (and (< (-> this rbody matrix trans y) (-> this minalt)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + ) + (when (< (-> this speed) 0.0) + (set! (-> this hit-points) -1.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + ) + (vector-float*! s4-0 *up-vector* (* -2000.0 (- (-> this rbody matrix trans y) (-> this minalt)))) + (add-force! (-> this rbody) s4-0) + ) + (let ((f0-134 (-> this speed))) + (let ((f1-64 (-> this controls throttle)) + (f2-21 (-> this controls brake)) + ) + 0.0 + (if (= f1-64 0.0) + (set! f2-21 0.1) + ) + (let ((f1-66 (* 3276800.0 (- f1-64 (* 4.0 f2-21))))) + (if (and (< 204800.0 f0-134) (< 0.0 f1-66)) + (set! f1-66 0.0) + ) + (if (< f0-134 153600.0) + (set! f1-66 1638400.0) + ) + (vector-float*! s4-0 (-> this rbody matrix fvec) f1-66) + ) + ) + (set! (-> s4-0 y) 0.0) + (if (and (logtest? (-> this v-flags) (vehicle-flag riding)) + (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (or (not (-> this bounce-state?)) (< 0.0 f0-134))) + ) + (add-force! (-> this rbody) s4-0) + ) + ) + (vector-float*! s4-0 (-> this rbody lin-velocity) (- (-> this info handling drag-force-factor))) + (add-force! (-> this rbody) s4-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f30-3 (impact-reduction (the-as int (-> this impact-time))))) + (set! (-> s3-1 quad) (-> this rbody matrix rvec quad)) + (set! (-> s3-1 y) 0.0000000001) + (vector-normalize! s3-1 1.0) + (vector-float*! + s4-0 + (the-as vector (-> this rbody matrix)) + (* -512.0 (vector-dot (-> this rbody lin-velocity) s3-1) f30-3) + ) + ) + ) + (set! (-> s4-0 y) 0.0) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (not (-> this bounce-state?))) + (add-force! (-> this rbody) s4-0) + ) + (when #f + (vector-float*! + s4-0 + (-> this rbody matrix uvec) + (* -128.0 (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix uvec))) + ) + (add-force! (-> this rbody) s4-0) + ) + (vector-reset! s4-0) + 0.0 + (let ((v1-258 (ascention-atten! (-> this root trans y))) + (f0-149 (* -15.0 (-> this controls lean-z) (-> this speed))) + ) + (let ((f1-75 1.5) + (a0-104 (-> this rbody lin-velocity)) + ) + (if (< (* f1-75 (sqrtf (+ (* (-> a0-104 x) (-> a0-104 x)) (* (-> a0-104 z) (-> a0-104 z))))) + (fabs (-> this rbody lin-velocity y)) + ) + (set! f0-149 0.0) + ) + ) + (if (< 0.0 (-> this controls lean-z)) + (set! (-> s4-0 y) (+ (* -20.0 (-> this rbody lin-velocity y)) (* f0-149 (-> v1-258 y)))) + (set! (-> s4-0 y) (+ (* -20.0 (-> this rbody lin-velocity y)) (* f0-149 (-> v1-258 x)))) + ) + ) + (when #t + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s2-3 (new 'stack-no-clear 'vector)) + ) + 0.0 + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (set! (-> s3-2 quad) (-> this rbody lin-velocity quad)) + (vector-normalize! s3-2 1.0) + (let ((f0-156 (vector-dot s3-2 s4-0))) + (vector-float*! s2-3 s3-2 f0-156) + ) + (vector-! s4-0 s4-0 s2-3) + (add-force! (-> this rbody) s4-0) + (when (or (< 81920.0 (-> this speed)) (< (-> this rbody lin-velocity y) 0.0)) + (vector-float*! s4-0 *up-vector* (* -1.0 (-> this info info mass) (-> this info extra gravity))) + (let ((f0-163 (vector-dot s3-2 s4-0))) + (vector-float*! s4-0 s3-2 f0-163) + ) + (add-force! (-> this rbody) s4-0) + ) + ) + ) + ) + (when (logtest? (-> this v-flags) (vehicle-flag dead)) + (let* ((f2-39 (fmax 1.0 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) + (f0-166 (+ -1.5 (* 50.0 (/ 1.0 f2-39)))) + ) + (if (logtest? (-> this v-flags) (vehicle-flag dead)) + (set! f0-166 2.0) + ) + (when (< 0.0 f0-166) + (vector-float*! s4-0 *up-vector* (* -1.0 (-> this info info mass) (-> this info extra gravity) f0-166)) + (add-force! (-> this rbody) s4-0) + ) + ) + ) + ) + (let ((a2-15 (new 'stack-no-clear 'vehicle-physics-work))) + (vehicle-method-97 this arg0 a2-15) + ) + 0 + (none) + ) + +(defmethod vehicle-method-94 ((this h-warf)) + ((method-of-type vehicle vehicle-method-94) this) + (none) + ) + +(defmethod touch-handler ((this h-warf) (arg0 process-focusable) (arg1 touching-shapes-entry)) + (b! + (or (not (logtest? (process-mask target crate enemy guard civilian) (-> arg0 mask))) + (and (logtest? (-> arg0 mask) (process-mask target)) (focus-test? arg0 dangerous pilot)) + ) + cfg-32 + :delay (nop!) + ) + (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 (get-inv-mass arg0)) + ) + (init-rbody-impact-from-tshape! this s5-0 arg1) + (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (rigid-body-control-method-23 (-> this rbody) (-> s5-0 point) (-> s5-0 velocity)) + (set! (-> s5-0 velocity quad) (-> this root transv quad)) + ) + (let ((v1-17 (-> arg0 root))) + (set! (-> s2-0 quad) (-> v1-17 transv quad)) + (vector-! (-> s5-0 velocity) (-> v1-17 transv) (-> s5-0 velocity)) + ) + (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) + (when (< f0-1 0.0) + (set! (-> s5-0 impulse) (* -1.0 (/ 1.0 (+ f30-0 (-> this info info inv-mass))) f0-1)) + (vector+float*! s2-0 s2-0 (-> s5-0 normal) (* 3.1 f30-0 (-> s5-0 impulse))) + (set! (-> s2-0 y) (fmax (* 49152.0 f30-0) (-> s2-0 y))) + (when (or (logtest? (vehicle-flag in-pursuit) (-> this v-flags)) (!= arg0 *target*)) + (when (>= (the-as uint (- (current-time) (the-as int (-> this sent-attack-time)))) (the-as uint 150)) + (set! (-> this sent-attack-time) (the-as uint (current-time))) + (let* ((v1-40 *game-info*) + (a0-18 (+ (-> v1-40 attack-id) 1)) + ) + (set! (-> v1-40 attack-id) a0-18) + (set! (-> this outgoing-attack-id) a0-18) + ) + ) + (let ((f0-10 (+ 0.5 (* 0.000024414063 (-> s5-0 impulse))))) + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info :mask (vehicle-impulse-factor) ((id (-> this outgoing-attack-id)) + (damage f0-10) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (attacker (process->handle (vehicle-method-68 this))) + (mode 'vehicle) + (vector s2-0) + (penetrate-using (penetrate vehicle)) + ) + ) + ) + ) + ) + ) + (impulse-handler this) + (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 normal) (* -1.0 (-> s5-0 impulse))) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + (when #f + (set-time! (-> *debug-vehicle-work* impact-time)) + (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer s5-0) 64) + (let ((v1-71 (-> arg1 head))) + (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-71 prim1 cprim prim-core world-sphere quad)) + (set! (-> *debug-vehicle-work* prim-sphere2 quad) (-> v1-71 prim2 cprim prim-core world-sphere quad)) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 point) *color-blue*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 point) + (-> s5-0 normal) + (-> s5-0 impulse) + *color-blue* + ) + ) + (on-impact this s5-0) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) + ) + ) + ) + ) + (label cfg-32) + #t + ) + +(defmethod vehicle-method-77 ((this h-warf)) + (set! (-> *game-info* health-bar-vehicle) (-> this hit-points)) + (call-parent-method this) + (none) + ) + +(defmethod draw-thrusters ((this h-warf) (arg0 float) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg2 quad)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (quaternion->matrix s4-0 (-> this root quat)) + (let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) s4-0))) + (vector-rotate*! (-> this langvel) (-> this rbody ang-velocity) a2-1) + ) + (cond + ((not (-> this bounce-state?)) + (vector-rotate-around-axis! s5-0 (the-as quaternion arg2) (* -2184.5334 (-> this langvel x)) (-> s4-0 rvec)) + (vector-rotate-around-axis! s5-0 (the-as quaternion s5-0) (* -1820.4445 (-> this langvel y)) (-> s4-0 uvec)) + (vector-rotate-around-axis! + s5-0 + (the-as quaternion s5-0) + (* 182.04445 (-> this langvel z) (* 5.0 arg0)) + (-> s4-0 rvec) + ) + ) + (else + (set! (-> s5-0 quad) (-> arg2 quad)) + ) + ) + (set! (-> s4-0 trans quad) (-> arg1 quad)) + (dotimes (s3-1 15) + (let* ((f28-0 (* 0.06666667 (- 15.0 (the float s3-1)))) + (f26-0 (* f28-0 (rand-vu-float-range 8192.0 9011.2))) + (f30-0 (* f28-0 (rand-vu-float-range 8192.0 12288.0))) + ) + (let ((a1-9 (-> s4-0 trans))) + (let ((v1-18 (-> s4-0 trans))) + (let ((a0-12 s5-0)) + (let ((a2-7 (+ (* 819.2 f28-0) (* 1024.0 (-> this engine-thrust) f28-0)))) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a0-12 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! (-> *part-id-table* 2761 init-specs 11 initial-valuef) + (+ (rand-vu-float-range 0.0 5.0) (* 60.0 f28-0 (-> this engine-thrust)) (* 40.0 f28-0)) + ) + (set! (-> *part-id-table* 2761 init-specs 8 initial-valuef) + (+ (* 215.0 (-> this engine-thrust)) (* 40.0 f28-0)) + ) + (set! (-> *part-id-table* 2761 init-specs 10 initial-valuef) + (the float (- 255 (the int (* 255.0 (-> this engine-thrust))))) + ) + (set! (-> *part-id-table* 2761 init-specs 3 initial-valuef) f26-0) + (set! (-> *part-id-table* 2761 init-specs 7 initial-valuef) f26-0) + (set! (-> *part-id-table* 2762 init-specs 4 initial-valuef) (* 255.0 f28-0 (-> this engine-thrust))) + (set! (-> *part-id-table* 2762 init-specs 5 initial-valuef) + (the float (- 28 (the int (* 28.0 f28-0 (-> this engine-thrust))))) + ) + (set! (-> *part-id-table* 2762 init-specs 6 initial-valuef) + (the float (- 255 (the int (* 255.0 f28-0 (-> this engine-thrust))))) + ) + (set! (-> *part-id-table* 2762 init-specs 7 initial-valuef) + (+ (rand-vu-float-range 0.0 (* 40.0 (-> this engine-thrust))) + (* 20.0 f28-0 (-> this engine-thrust)) + (the float (* 30 (the int f28-0))) + ) + ) + (set! (-> *part-id-table* 2762 init-specs 2 initial-valuef) f30-0) + (set! (-> *part-id-table* 2762 init-specs 3 initial-valuef) f30-0) + ) + (launch-particles (-> *part-id-table* 2761) s4-0 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 2762) s4-0 :origin-is-matrix #t) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod vehicle-method-78 ((this h-warf)) + (let ((t9-0 (method-of-type vehicle vehicle-method-78))) + (t9-0 this) + ) + (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (let ((s5-0 (new 'stack-no-clear 'h-warf-stack-var0))) + (quaternion->matrix (-> s5-0 mat) (-> this root quat)) + (set! (-> s5-0 mat trans quad) (-> this root trans quad)) + (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) + (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat)) + (when (< 0.0 (-> this info particles thruster-flame-length)) + (let ((f30-0 (fmax 0.01 (* (-> this info particles thruster-flame-length) + (-> this power-level) + (-> this force-scale) + (-> this engine-thrust) + ) + ) + ) + ) + (fmin (-> this info particles thruster-flame-width) f30-0) + ) + (dotimes (s4-0 2) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles thruster-local-pos s4-0) (-> s5-0 mat)) + (draw-thrusters + this + (if (zero? s4-0) + -1.0 + 1.0 + ) + (-> s5-0 vec0) + (-> s5-0 vec1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod rigid-body-object-method-54 ((this h-warf)) + (cond + ((logtest? (vehicle-flag tracking-mode) (-> this v-flags)) + (let ((a0-3 (the-as process-focusable (handle->process (-> this track-obj))))) + (when a0-3 + (let ((s5-0 (new 'stack-no-clear 'vehicle-physics-work))) + (let* ((v1-7 (-> s5-0 mat)) + (a3-0 (-> a0-3 node-list data (-> this track-joint) bone transform)) + (a0-9 (-> a3-0 rvec quad)) + (a1-3 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-7 rvec quad) a0-9) + (set! (-> v1-7 uvec quad) a1-3) + (set! (-> v1-7 fvec quad) a2-0) + (set! (-> v1-7 trans quad) a3-1) + ) + (set! (-> s5-0 velocity quad) (-> s5-0 mat trans quad)) + (matrix->quaternion (the-as quaternion (-> s5-0 force)) (-> s5-0 mat)) + (rigid-body-control-method-28 (-> this rbody) (-> s5-0 velocity) (the-as quaternion (-> s5-0 force))) + ) + (vector-reset! (-> this rbody lin-velocity)) + (vector-reset! (-> this rbody ang-velocity)) + ) + ) + (set! (-> this rbody time-remaining) 0.0) + ) + (else + (call-parent-method this) + ) + ) + (none) + ) + +(defmethod rbody-event-handler ((this h-warf) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('tracking-mode) + (let ((v1-1 (-> arg3 param 0)) + (a0-2 (-> arg3 param 1)) + ) + (set! (-> this track-obj) (the-as handle v1-1)) + (set! (-> this track-joint) (the-as int a0-2)) + ) + (let ((v0-0 (the-as object (logior (vehicle-flag tracking-mode) (-> this v-flags))))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + v0-0 + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/goal_src/jak3/levels/factory/hover-nav-factoryc.gc b/goal_src/jak3/levels/factory/hover-nav-factoryc.gc index 5858c2c971..d96603786f 100644 --- a/goal_src/jak3/levels/factory/hover-nav-factoryc.gc +++ b/goal_src/jak3/levels/factory/hover-nav-factoryc.gc @@ -7,3 +7,401 @@ ;; DECOMP BEGINS +(define *factoryc-adjacency* + (new 'static 'nav-network-data + :node-array (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :parent #f) + :pos (new 'static 'vector :x 1172152.4 :y 1784913.9 :z 86958.08 :w 1.0) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 1 :dist 37765.12) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :pos (new 'static 'vector :x 1174282.2 :y 1822597.1 :z 86466.56 :w 1.0) + :index 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :dist 37765.12) + (new 'static 'nav-network-adjacency :index 2 :dist 23388.16) + (new 'static 'nav-network-adjacency :index 6 :dist 128450.56) + (new 'static 'nav-network-adjacency :index 29 :dist 53288.96) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :pos (new 'static 'vector :x 1165393.9 :y 1801912.4 :z 80158.72 :w 1.0) + :index 2 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 1 :dist 23388.16) + (new 'static 'nav-network-adjacency :index 3 :dist 101130.24) + (new 'static 'nav-network-adjacency :index 4 :dist 58941.44) + (new 'static 'nav-network-adjacency :index 5 :dist 70901.76) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :pos (new 'static 'vector :x 1188167.6 :y 1801912.4 :z -18350.08 :w 1.0) + :index 3 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 2 :dist 101130.24) + (new 'static 'nav-network-adjacency :index 29 :dist 66314.24) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :pos (new 'static 'vector :x 1170923.5 :y 1801912.4 :z 138813.44 :w 1.0) + :index 4 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 2 :dist 58941.44) + (new 'static 'nav-network-adjacency :index 5 :dist 55418.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :pos (new 'static 'vector :x 1222737.9 :y 1793761.2 :z 120995.84 :w 1.0) + :index 5 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 70901.76) + (new 'static 'nav-network-adjacency :index 4 :dist 55418.88) + (new 'static 'nav-network-adjacency :index 6 :dist 74055.68) + (new 'static 'nav-network-adjacency :index 29 :dist 77660.16) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :pos (new 'static 'vector :x 1296465.9 :y 1793761.2 :z 113786.88 :w 1.0) + :index 6 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 1 :dist 128450.56) + (new 'static 'nav-network-adjacency :index 5 :dist 74055.68) + (new 'static 'nav-network-adjacency :index 7 :dist 166297.6) + (new 'static 'nav-network-adjacency :index 8 :dist 153681.92) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :pos (new 'static 'vector :x 1353728.0 :y 1793761.2 :z -42311.68 :w 1.0) + :index 7 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 6 :dist 166297.6) + (new 'static 'nav-network-adjacency :index 9 :dist 169246.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :pos (new 'static 'vector :x 1265664.0 :y 1793761.2 :z -36741.12 :w 1.0) + :index 8 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 6 :dist 153681.92) + (new 'static 'nav-network-adjacency :index 9 :dist 171335.69) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :pos (new 'static 'vector :x 1303429.1 :y 1776681.0 :z -202997.77 :w 1.0) + :index 9 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 7 :dist 169246.72) + (new 'static 'nav-network-adjacency :index 8 :dist 171335.69) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :pos (new 'static 'vector :x 825303.06 :y 1806049.2 :z -787783.7 :w 1.0) + :index 10 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 16 :dist 126853.12) + (new 'static 'nav-network-adjacency :index 17 :dist 61849.6) + (new 'static 'nav-network-adjacency :index 27 :dist 85647.36) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :pos (new 'static 'vector :x 686530.56 :y 1806049.2 :z -810557.44 :w 1.0) + :index 11 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 12 :dist 79626.24) + (new 'static 'nav-network-adjacency :index 15 :dist 55992.32) + (new 'static 'nav-network-adjacency :index 20 :dist 53248.0) + (new 'static 'nav-network-adjacency :index 28 :dist 108666.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :pos (new 'static 'vector :x 628285.44 :y 1806049.2 :z -756285.44 :w 1.0) + :index 12 + :sub-graph 1 + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 11 :dist 79626.24) + (new 'static 'nav-network-adjacency :index 13 :dist 42844.16) + (new 'static 'nav-network-adjacency :index 16 :dist 106004.48) + (new 'static 'nav-network-adjacency :index 20 :dist 44441.6) + (new 'static 'nav-network-adjacency :index 28 :dist 62218.24) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :pos (new 'static 'vector :x 585441.25 :y 1806049.2 :z -755752.94 :w 1.0) + :index 13 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 12 :dist 42844.16) + (new 'static 'nav-network-adjacency :index 20 :dist 68075.52) + (new 'static 'nav-network-adjacency :index 21 :dist 58654.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :pos (new 'static 'vector :x 722124.8 :y 1790730.2 :z -716349.44 :w 1.0) + :index 14 + :sub-graph 1 + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 16 :dist 43499.52) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :pos (new 'static 'vector :x 724131.8 :y 1834147.9 :z -841072.6 :w 1.0) + :index 15 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 55992.32) + (new 'static 'nav-network-adjacency :index 16 :dist 122961.92) + (new 'static 'nav-network-adjacency :index 17 :dist 60702.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :pos (new 'static 'vector :x 723107.8 :y 1834147.9 :z -718110.75 :w 1.0) + :index 16 + :sub-graph 1 + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 10 :dist 126853.12) + (new 'static 'nav-network-adjacency :index 12 :dist 106004.48) + (new 'static 'nav-network-adjacency :index 14 :dist 43499.52) + (new 'static 'nav-network-adjacency :index 15 :dist 122961.92) + (new 'static 'nav-network-adjacency :index 27 :dist 66846.72) + (new 'static 'nav-network-adjacency :index 28 :dist 82329.6) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :pos (new 'static 'vector :x 775045.1 :y 1806049.2 :z -823828.5 :w 1.0) + :index 17 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 10 :dist 61849.6) + (new 'static 'nav-network-adjacency :index 15 :dist 60702.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :pos (new 'static 'vector :x 539729.94 :y 1821532.1 :z -807403.5 :w 1.0) + :index 18 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 19 :dist 81592.32) + (new 'static 'nav-network-adjacency :index 21 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 22 :dist 76677.12) + (new 'static 'nav-network-adjacency :index 23 :dist 39034.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :pos (new 'static 'vector :x 618045.44 :y 1821532.1 :z -830218.25 :w 1.0) + :index 19 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 18 :dist 81592.32) + (new 'static 'nav-network-adjacency :index 20 :dist 38543.36) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :pos (new 'static 'vector :x 637460.5 :y 1821532.1 :z -796917.75 :w 1.0) + :index 20 + :sub-graph 1 + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 11 :dist 53248.0) + (new 'static 'nav-network-adjacency :index 12 :dist 44441.6) + (new 'static 'nav-network-adjacency :index 13 :dist 68075.52) + (new 'static 'nav-network-adjacency :index 19 :dist 38543.36) + (new 'static 'nav-network-adjacency :index 21 :dist 111493.12) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :pos (new 'static 'vector :x 530022.4 :y 1821532.1 :z -767098.9 :w 1.0) + :index 21 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 13 :dist 58654.72) + (new 'static 'nav-network-adjacency :index 18 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 20 :dist 111493.12) + (new 'static 'nav-network-adjacency :index 22 :dist 101867.52) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :pos (new 'static 'vector :x 480501.75 :y 1821532.1 :z -856104.94 :w 1.0) + :index 22 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 18 :dist 76677.12) + (new 'static 'nav-network-adjacency :index 21 :dist 101867.52) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f) + :pos (new 'static 'vector :x 538214.4 :y 1782538.2 :z -808099.8 :w 1.0) + :index 23 + :sub-graph 1 + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 18 :dist 39034.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f) + :pos (new 'static 'vector :x 777953.25 :y 1680793.6 :z -723394.56 :w 1.0) + :index 24 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 25 :dist 75038.72) + (new 'static 'nav-network-adjacency :index 27 :dist 176578.56) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f) + :pos (new 'static 'vector :x 719093.75 :y 1680793.6 :z -769966.06 :w 1.0) + :index 25 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 24 :dist 75038.72) + (new 'static 'nav-network-adjacency :index 26 :dist 70983.68) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f) + :pos (new 'static 'vector :x 664739.8 :y 1680793.6 :z -724336.6 :w 1.0) + :index 26 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 25 :dist 70983.68) + (new 'static 'nav-network-adjacency :index 28 :dist 177438.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f) + :pos (new 'static 'vector :x 784179.2 :y 1857044.5 :z -732569.6 :w 1.0) + :index 27 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 10 :dist 85647.36) + (new 'static 'nav-network-adjacency :index 16 :dist 66846.72) + (new 'static 'nav-network-adjacency :index 24 :dist 176578.56) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f) + :pos (new 'static 'vector :x 644259.8 :y 1857044.5 :z -724418.56 :w 1.0) + :index 28 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 11 :dist 108666.88) + (new 'static 'nav-network-adjacency :index 12 :dist 62218.24) + (new 'static 'nav-network-adjacency :index 16 :dist 82329.6) + (new 'static 'nav-network-adjacency :index 26 :dist 177438.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f) + :pos (new 'static 'vector :x 1200906.2 :y 1799249.9 :z 46653.44 :w 1.0) + :index 29 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 1 :dist 53288.96) + (new 'static 'nav-network-adjacency :index 3 :dist 66314.24) + (new 'static 'nav-network-adjacency :index 5 :dist 77660.16) + ) + ) + ) + :edge-array (new 'static 'boxed-array :type nav-network-edge + (new 'static 'nav-network-edge :end-index 1 :radius 16384.0) + (new 'static 'nav-network-edge :start-index 2 :end-index 1 :radius 16384.0) + (new 'static 'nav-network-edge :start-index 2 :end-index 3 :radius 41902.08) + (new 'static 'nav-network-edge :start-index 2 :end-index 4 :radius 30515.2) + (new 'static 'nav-network-edge :start-index 4 :end-index 5 :radius 25067.52) + (new 'static 'nav-network-edge :start-index 5 :end-index 2 :radius 26705.92) + (new 'static 'nav-network-edge :start-index 5 :end-index 6 :radius 36659.2) + (new 'static 'nav-network-edge :start-index 6 :end-index 1 :radius 37806.08) + (new 'static 'nav-network-edge :start-index 6 :end-index 7 :radius 34160.64) + (new 'static 'nav-network-edge :start-index 8 :end-index 6 :radius 31907.84) + (new 'static 'nav-network-edge :start-index 9 :end-index 7 :radius 42844.16) + (new 'static 'nav-network-edge :start-index 9 :end-index 8 :radius 23920.64) + (new 'static 'nav-network-edge :start-index 10 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 10 :end-index 27 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 11 :end-index 12 :radius 37355.52 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 11 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 11 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 13 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 13 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 13 :end-index 21 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 14 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 15 :end-index 11 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 15 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 16 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 17 :end-index 10 :radius 26378.24 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 17 :end-index 15 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 18 :end-index 19 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 18 :end-index 21 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 19 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 20 :end-index 21 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 21 :end-index 22 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 22 :end-index 18 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 23 :end-index 18 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 24 :end-index 25 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 24 :end-index 27 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 25 :end-index 26 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 26 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 27 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 29 :end-index 1 :radius 25067.52) + (new 'static 'nav-network-edge :start-index 29 :end-index 3 :radius 30064.64) + (new 'static 'nav-network-edge :start-index 29 :end-index 5 :radius 32194.56) + ) + ) + ) diff --git a/goal_src/jak3/levels/factory/hover-nav-factoryd.gc b/goal_src/jak3/levels/factory/hover-nav-factoryd.gc index 99e354a68a..37974ba9c5 100644 --- a/goal_src/jak3/levels/factory/hover-nav-factoryd.gc +++ b/goal_src/jak3/levels/factory/hover-nav-factoryd.gc @@ -7,3 +7,53 @@ ;; DECOMP BEGINS +(define *factoryd-adjacency* (new 'static 'nav-network-data + :node-array (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :parent #f) + :pos (new 'static 'vector :x 1078640.6 :y 2171125.8 :z -394813.44 :w 1.0) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 1 :dist 93962.24) + (new 'static 'nav-network-adjacency :index 3 :dist 110755.84) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :pos (new 'static 'vector :x 1072537.6 :y 2171125.8 :z -488570.88 :w 1.0) + :index 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :dist 93962.24) + (new 'static 'nav-network-adjacency :index 2 :dist 110346.24) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :pos (new 'static 'vector :x 962273.25 :y 2171125.8 :z -492912.62 :w 1.0) + :index 2 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 1 :dist 110346.24) + (new 'static 'nav-network-adjacency :index 3 :dist 102604.8) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :pos (new 'static 'vector :x 967966.75 :y 2171125.8 :z -390471.7 :w 1.0) + :index 3 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :dist 110755.84) + (new 'static 'nav-network-adjacency :index 2 :dist 102604.8) + ) + ) + ) + :edge-array (new 'static 'boxed-array :type nav-network-edge + (new 'static 'nav-network-edge :end-index 1 :radius 36331.52) + (new 'static 'nav-network-edge :start-index 1 :end-index 2 :radius 38830.08) + (new 'static 'nav-network-edge :start-index 2 :end-index 3 :radius 35184.64) + (new 'static 'nav-network-edge :start-index 3 :radius 39485.44) + ) + ) + ) diff --git a/goal_src/jak3/levels/factory/lfacrm1-mood.gc b/goal_src/jak3/levels/factory/lfacrm1-mood.gc index 2d829ea343..9a14c1ff94 100644 --- a/goal_src/jak3/levels/factory/lfacrm1-mood.gc +++ b/goal_src/jak3/levels/factory/lfacrm1-mood.gc @@ -7,3 +7,162 @@ ;; DECOMP BEGINS +(deftype lfacrm1-states (structure) + ((door-current-interp float) + (door-target-interp float) + (blink float) + ) + ) + + +(defun update-lfacrm1-lights ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (a1-0 (-> arg0 light-group)) + (a2-1 (-> *level* level-default mood-context light-group)) + ) + (let ((a0-2 (-> a1-0 0))) + (set! (-> a0-2 dir0 direction x) -0.372) + (set! (-> a0-2 dir0 direction y) 0.853) + (set! (-> a0-2 dir0 direction z) 0.363) + (set! (-> a0-2 dir0 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir0 color) 0.65 0.855 0.82 1.0) + (let ((a0-4 (-> a1-0 0 dir1))) + (set! (-> a0-4 direction x) 0.372) + (set! (-> a0-4 direction y) 0.853) + (set! (-> a0-4 direction z) -0.363) + (set! (-> a0-4 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir1 color) 0.65 0.855 0.82 1.0) + (set-vector! (-> a1-0 0 ambi color) 0.627 0.718 1.0 1.0) + (set! (-> a1-0 0 dir0 extra x) 0.85) + (set! (-> a1-0 0 dir1 extra x) 0.3) + (set! (-> a1-0 0 dir2 extra x) 0.0) + (set! (-> a1-0 0 ambi extra x) 0.3) + (light-group-lerp! + (the-as light-group a1-0) + (the-as (pointer light-group) a1-0) + (the-as light-group a2-1) + (-> (the-as lfacrm1-states v1-0) door-current-interp) + ) + ) + (none) + ) + +(defbehavior update-mood-lfacrm1 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #t) + (update-lfacrm1-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as object (-> arg0 state)))) + (vector4-lerp! + (the-as vector (-> arg0 times)) + (the-as vector (-> arg0 times)) + (the-as vector (-> *level* level-default mood-context times)) + (-> (the-as lfacrm1-states gp-0) door-current-interp) + ) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) (-> (the-as lfacrm1-states gp-0) blink)) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + (when (not (paused?)) + (seek! + (-> (the-as lfacrm1-states gp-0) door-current-interp) + (-> (the-as lfacrm1-states gp-0) door-target-interp) + (* 0.3745 (seconds-per-frame)) + ) + (let ((v1-14 (-> *display* part-clock frame-counter))) + (if (< (* 0.2 (the float (mod v1-14 600))) 60.0) + (seek! (-> (the-as lfacrm1-states gp-0) blink) 0.0 (* 0.5 (seconds-per-frame))) + (seek! (-> (the-as lfacrm1-states gp-0) blink) 1.0 (* 0.5 (seconds-per-frame))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun set-lfacrm1-door! ((arg0 float)) + (let ((v1-1 (level-get *level* 'lfacrm1))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 1) (the-as uint arg0)) + (if (= arg0 0.0) + (set! (-> v1-2 0) (the-as uint arg0)) + ) + ) + ) + ) + (let ((v1-4 (level-get *level* 'factorya))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state)))) + (set! (-> (the-as lfacrm1-states v1-5) door-target-interp) arg0) + (if (= arg0 0.0) + (set! (-> (the-as lfacrm1-states v1-5) door-current-interp) arg0) + ) + ) + ) + ) + (none) + ) + +(deftype lfac-hanger-door (process-drawable) + () + (:state-methods + idle + ) + ) + + +(defskelgroup skel-lfac-hanger-door lfac-hanger-door lfac-hanger-door-lod0-jg lfac-hanger-door-idle-ja + ((lfac-hanger-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +(defstate idle (lfac-hanger-door) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +(defmethod init-from-entity! ((this lfac-hanger-door) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-lfac-hanger-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +(defbehavior lfac-hanger-door-init-by-other lfac-hanger-door ((arg0 vector) (arg1 entity-actor)) + (process-entity-set! self arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-lfac-hanger-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go-virtual idle) + ) diff --git a/goal_src/jak3/levels/factory/lfacrm2-mood.gc b/goal_src/jak3/levels/factory/lfacrm2-mood.gc index 35cb5b914e..481bdbc1b1 100644 --- a/goal_src/jak3/levels/factory/lfacrm2-mood.gc +++ b/goal_src/jak3/levels/factory/lfacrm2-mood.gc @@ -7,3 +7,205 @@ ;; DECOMP BEGINS +(deftype fac-elevator-a (elevator) + ((mysound sound-id) + ) + ) + + +(defskelgroup skel-fac-elevator-a fac-elevator-a fac-elevator-a-lod0-jg fac-elevator-a-idle-ja + ((fac-elevator-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + ) + +(defstate running (fac-elevator-a) + :virtual #t + :enter (behavior () + (set! (-> self mysound) (sound-play "elevator-a")) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + :exit (behavior () + (sound-stop (-> self mysound)) + (set! (-> self mysound) (sound-play "elevator-hit")) + (let ((t9-4 (-> (find-parent-state) exit))) + (if t9-4 + (t9-4) + ) + ) + ) + :trans (behavior () + (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 mysound)) + (let ((a1-0 (target-pos 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-0 (-> s5-0 root 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) + ) + ) + (let ((t9-5 (-> (find-parent-state) trans))) + (if t9-5 + (t9-5) + ) + ) + ) + :code (behavior () + (when (not (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0))) + (ja-no-eval :group! fac-elevator-a-gate_up-ja :num! (seek! max 1.333) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.333)) + ) + ) + (let ((t9-5 (-> (find-parent-state) code))) + (if t9-5 + ((the-as (function none) t9-5)) + ) + ) + ) + ) + +(defstate arrived (fac-elevator-a) + :virtual #t + :code (behavior () + (go-virtual dormant) + ) + ) + +(defstate waiting (fac-elevator-a) + :virtual #t + :code (behavior () + (format #t "~I~%" (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0)) + (if (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0)) + (ja :group! fac-elevator-a-gate_up-ja :num! max) + (ja :group! fac-elevator-a-gate_up-ja :num! min) + ) + (sleep-code) + ) + ) + +(defstate dormant (fac-elevator-a) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + '() + (suspend) + ) + ) + (ja-no-eval :group! fac-elevator-a-gate_down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + ) + +(defmethod get-art-group ((this fac-elevator-a)) + (art-group-get-by-name *level* "skel-fac-elevator-a" (the-as (pointer level) #f)) + ) + +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this fac-elevator-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-23 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this fac-elevator-a)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "fac-elevator-a" :group 0)) + (none) + ) + +(deftype lfacrm2-states (structure) + () + ) + + +(defbehavior update-mood-lfacrm2 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (let* ((a0-5 (-> *display* part-clock frame-counter)) + (v1-8 (mod a0-5 300)) + (s5-0 (mod a0-5 900)) + ) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-8)))))) + (set! (-> arg0 times 3 w) (if (< 450 s5-0) + 1.0 + 0.5 + ) + ) + ) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/missile-bot.gc b/goal_src/jak3/levels/factory/missile-bot.gc index 507338fa63..a95b5320c6 100644 --- a/goal_src/jak3/levels/factory/missile-bot.gc +++ b/goal_src/jak3/levels/factory/missile-bot.gc @@ -7,3 +7,1298 @@ ;; DECOMP BEGINS +(defskelgroup skel-missile-bot missile-bot missile-bot-lod0-jg missile-bot-idle-ja + ((missile-bot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow missile-bot-shadow-mg + :origin-joint-index 3 + ) + +(deftype missile-bot (nav-enemy) + ((parent (pointer factory-boss) :override) + (traj trajectory :inline) + (initial-y float) + (top-spin-jm joint-mod) + (top-angle float) + (main-jm joint-mod) + (height-bob bouncing-float :inline) + (height-bob-rand delayed-rand-float :inline) + (main-wobble oscillating-vector :inline) + (main-wobble-rand delayed-rand-vector :inline) + (thruster-part sparticle-launch-control) + (lightning lightning-control 6) + (lightning-wobble oscillating-vector 3 :inline) + (lightning-wobble-rand delayed-rand-vector 3 :inline) + (lightning-mode uint64) + (lightning-timer time-frame) + (lightning-sound sound-id) + (lightning-sound-playing symbol) + (glows-on symbol) + (spin float) + (engine-sound sound-id) + (engine-sound-playing symbol) + (explosion-sound-index int8) + (spin-whoosh-timer time-frame) + (will-hit-errol symbol) + (spark-part sparticle-launch-control) + (spark-part-on symbol) + (spark-timer time-frame) + ) + (:state-methods + fizzle + kicked + lift-off + explode + ) + (:methods + (toggle-glow-sprites (_type_ symbol) none) + ) + ) + + +(define *missile-bot-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim 3 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :look-at-joint 3 + :bullseye-joint 3 + :notice-distance (meters 150) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 20480.0 + :knocked-soft-vxz-hi 28672.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 49152.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 57344.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 4096.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 114688.0 + :knocked-red-vy-lo 53248.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim 3 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 16) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *missile-bot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +(defbehavior stunned? missile-bot () + (and (-> self next-state) (let ((v1-2 (-> self next-state name))) + (or (= v1-2 'fizzle) (= v1-2 'kicked) (= v1-2 'lift-off)) + ) + ) + ) + +(defmethod event-handler ((this missile-bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('lift-off) + (go (method-of-object this lift-off)) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod enemy-method-63 ((this missile-bot) (arg0 float)) + (fmax 0.0 (fmin arg0 (-> this hit-points))) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod toggle-glow-sprites ((this missile-bot) (arg0 symbol)) + (cond + ((stunned?) + (when (-> this glows-on) + (set! (-> this glows-on) #f) + (set! arg0 #t) + ) + ) + ((not (-> this glows-on)) + (set! (-> this glows-on) #t) + (set! arg0 #t) + ) + ) + (when arg0 + (remove-from-process *part-engine* this) + (when (-> this glows-on) + (add-connection *part-engine* this 7 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 8 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 10 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 9 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 11 this 4556 (new 'static 'vector :w 163840.0)) + ) + ) + (none) + ) + +(defbehavior missile-bot-get-kick-time missile-bot ((arg0 float)) + (fmax 30.0 (* 0.0018310547 arg0)) + ) + +(defbehavior missile-bot-find-dest missile-bot ((arg0 vector)) + (local-vars (v1-22 float) (a2-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg main)))) + (set! (-> arg0 quad) (-> s4-0 quad)) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (target-pos 0))) + (s2-0 (ppointer->process (-> self parent))) + (s3-1 (if (type? s2-0 factory-boss) + s2-0 + ) + ) + (s0-0 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (when s3-1 + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-! s0-0 (-> s3-1 center) s4-0) + (set! (-> s0-0 y) 0.0) + (vector-float*! s2-1 s5-1 (vector-dot s5-1 s0-0)) + (vector-! s1-0 s2-1 s0-0) + (let* ((v1-10 arg0) + (a0-11 s2-1) + (a1-7 s5-1) + (f0-4 110592.0) + (f0-6 (* f0-4 f0-4)) + ) + (.lvf vf1 (&-> s1-0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov a2-3 vf1) + (vector+float*! v1-10 a0-11 a1-7 (sqrtf (- f0-6 a2-3))) + ) + (if (< (vector-dot s5-1 arg0) 0.0) + (vector-reset! arg0) + ) + (vector+! s2-1 s2-1 s4-0) + (vector+! arg0 arg0 s4-0) + (let ((s2-3 (vector-! (new 'stack-no-clear 'vector) (-> s3-1 root trans) arg0))) + 0.0 + (let ((f0-13 (* -0.5 (vector-vector-distance arg0 s4-0)))) + (set! (-> s2-3 y) 0.0) + (.lvf vf1 (&-> s2-3 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-22 vf1) + (let ((f1-3 v1-22) + (f2-0 20480.0) + ) + (if (< (* f2-0 f2-0) f1-3) + (vector-float*! s2-3 s2-3 (/ 20480.0 (sqrtf f1-3))) + ) + ) + (let ((f1-7 (vector-dot s2-3 s5-1))) + (if (< f1-7 f0-13) + (vector-float*! s2-3 s2-3 (/ f0-13 f1-7)) + ) + ) + ) + (vector+! arg0 arg0 s2-3) + ) + ) + ) + ) + arg0 + ) + ) + +(defstate jump (missile-bot) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + #f + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + ) + +(defstate knocked (missile-bot) + :virtual #t + :enter (behavior () + (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-2 (the-as number (logior #x3f800000 v1-1))) + ) + (if (< (+ -1.0 (the-as float v1-2)) 0.5) + (set! (-> self spin) 7281.778) + (set! (-> self spin) -7281.778) + ) + ) + (set! (-> self lightning-timer) 0) + (set! (-> self lightning-mode) (the-as uint 0)) + (set! (-> self spin-whoosh-timer) 0) + (let ((t9-1 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (>= (- (current-time) (-> self spin-whoosh-timer)) 0) + (sound-play "mb-spin-whoosh" :position (-> self root trans)) + (let* ((gp-1 (current-time)) + (f30-0 300.0) + (f28-0 0.2) + (f26-0 0.049999997) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> self spin-whoosh-timer) + (+ gp-1 (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-15))))))) + ) + ) + ) + ) + :post (behavior () + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (-> self spin)) + (let ((t9-1 (-> (method-of-type nav-enemy knocked) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +(defstate notice (missile-bot) + :virtual #t + :code (behavior () + (ja-no-eval :group! missile-bot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + ) + +(defstate hostile (missile-bot) + :virtual #t + :trans (behavior () + (nav-enemy-method-172 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) + (go-stare self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + (when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags))) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-stare self) + ) + ) + ) + (let ((f30-0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) + (let* ((gp-2 (-> self nav)) + (t9-11 lerp-scale) + (a0-13 0.0) + (a1-2 (-> self enemy-info run-travel-speed)) + (a2-0 f30-0) + (f0-1 12288.0) + (a3-0 (* f0-1 f0-1)) + (f0-3 16384.0) + ) + (set! (-> gp-2 target-speed) (t9-11 a0-13 a1-2 a2-0 a3-0 (* f0-3 f0-3))) + ) + 0 + (let ((f0-6 16384.0)) + (cond + ((< f30-0 (* f0-6 f0-6)) + (when (zero? (-> self lightning-timer)) + (set! (-> self lightning-mode) (the-as uint 1)) + (set-time! (-> self lightning-timer)) + ) + ) + ((let ((f0-9 24576.0)) + (and (< (* f0-9 f0-9) f30-0) (>= (+ (current-time) (seconds -1)) (-> self lightning-timer))) + ) + (set! (-> self lightning-mode) (the-as uint 0)) + (set! (-> self lightning-timer) 0) + 0 + ) + ) + ) + ) + ) + ) + +(defstate die (missile-bot) + :virtual #t + :code (behavior () + (go-virtual fizzle) + ) + ) + +(defstate fizzle (missile-bot) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (= (-> proc type) target) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((t9-0 missile-bot-find-dest) + (a0-2 gp-0) + ) + 360 + (t9-0 a0-2) + ) + (vector-! gp-0 gp-0 (-> self root trans)) + (let ((s5-0 missile-bot-find-dest) + (s4-0 gp-0) + ) + (+ (the int (missile-bot-get-kick-time (vector-length gp-0))) 360) + (s5-0 s4-0) + ) + (vector-! gp-0 gp-0 (-> self root trans)) + (let* ((f0-2 (vector-length gp-0)) + (f30-0 (fmin 16384.0 (* 0.2 f0-2))) + (f0-3 (missile-bot-get-kick-time f0-2)) + ) + (vector+! gp-0 gp-0 (-> self root trans)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-0 f0-3 f30-0) + ) + ) + (go-virtual kicked) + ) + ) + (('lift-off) + (go-virtual lift-off) + ) + ) + ) + :enter (behavior () + (local-vars (v1-11 enemy-flag) (v1-13 enemy-flag) (v1-15 enemy-flag)) + (set! (-> self root penetrate-using) + (the-as penetrate (logclear (-> self root penetrate-using) (penetrate knocked))) + ) + (enemy-method-50 self 2) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-10 (-> self enemy-flags))) + (if (logtest? v1-10 (enemy-flag vulnerable-backup)) + (set! v1-11 (logior v1-10 (enemy-flag vulnerable))) + (set! v1-11 (logclear v1-10 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-11) + (let ((v1-12 (-> self enemy-flags))) + (if (logtest? v1-12 (enemy-flag attackable-backup)) + (set! v1-13 (logior v1-12 (enemy-flag attackable))) + (set! v1-13 (logclear v1-12 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-13) + (let ((v1-14 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-14) + (set! v1-15 (logior (enemy-flag trackable) v1-14)) + (set! v1-15 (logclear v1-14 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-15) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (set-time! (-> self state-time)) + (let ((v1-23 (-> self root root-prim))) + (set! (-> v1-23 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-23 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set! (-> self lightning-mode) (the-as uint 0)) + (set! (-> self lightning-timer) 0) + (if (send-event (ppointer->process (-> self parent)) 'round? 3) + (factory-boss-play-speech 7 (the-as factory-boss self)) + ) + ) + :trans (behavior () + (spawn + (-> self part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg rotating_ring)) + ) + (cond + ((-> self spark-part-on) + (format *stdebug* "spark-on~%") + (spawn + (-> self spark-part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg rotating_ring)) + ) + (when (>= (- (current-time) (-> self spark-timer)) 0) + (let* ((gp-2 (current-time)) + (f30-0 300.0) + (s5-2 lerp-scale) + (s4-0 0.3) + (s3-0 0.5) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> self spark-timer) + (+ gp-2 (the int (* f30-0 (s5-2 s4-0 s3-0 (+ -1.0 (the-as float v1-16)) 0.0 1.0)))) + ) + ) + (set! (-> self spark-part-on) #f) + ) + ) + ((>= (- (current-time) (-> self spark-timer)) 0) + (let* ((gp-3 (current-time)) + (f30-1 300.0) + (s5-3 lerp-scale) + (s4-1 0.2) + (s3-1 0.4) + (v1-27 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-28 (the-as number (logior #x3f800000 v1-27))) + ) + (set! (-> self spark-timer) + (+ gp-3 (the int (* f30-1 (s5-3 s4-1 s3-1 (+ -1.0 (the-as float v1-28)) 0.0 1.0)))) + ) + ) + (set! (-> self spark-part-on) #t) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-virtual lift-off) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +(defstate kicked (missile-bot) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('lift-off) + (go-virtual lift-off) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (if (time-elapsed? (-> self state-time) (the int (-> self traj time))) + (go-virtual lift-off) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +(defstate lift-off (missile-bot) + :virtual #t + :enter (behavior () + (set! (-> self state-time) 0) + (set! (-> self traj time) 0.0) + (set! (-> self initial-y) (-> self root trans y)) + (set! (-> self explosion-sound-index) 0) + (set! (-> self will-hit-errol) #f) + (let* ((gp-0 (ppointer->process (-> self parent))) + (v1-3 (if (type? gp-0 factory-boss) + gp-0 + ) + ) + ) + (when v1-3 + (let ((f0-2 (vector-vector-xz-distance-squared (-> self root trans) (-> v1-3 root trans))) + (f1-0 20480.0) + ) + (set! (-> self will-hit-errol) (< f0-2 (* f1-0 f1-0))) + ) + ) + ) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (the int (-> self traj time))) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 (rand-vu-float-range 1228.8 2048.0)) + (f28-0 (rand-vu-float-range 30.0 120.0)) + ) + (set! (-> gp-0 quad) (-> self root trans quad)) + (+! (-> gp-0 y) (rand-vu-float-range 6144.0 10240.0)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-0 f28-0 f30-0) + ) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + (when (not (send-event (ppointer->process (-> self parent)) 'in-cutscene?)) + (let ((v1-46 (-> self explosion-sound-index))) + (cond + ((zero? v1-46) + (sound-play "mb-expl-1") + ) + ((= v1-46 1) + (sound-play "mb-expl-2") + ) + ((= v1-46 2) + (sound-play "mb-expl-3") + ) + ((= v1-46 3) + (sound-play "mb-expl-4") + ) + (else + (sound-play "mb-expl-4") + ) + ) + ) + ) + (+! (-> self explosion-sound-index) 1) + (set-time! (-> self state-time)) + ) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (if (and (-> self will-hit-errol) (< (+ 40960.0 (-> self initial-y)) (-> self root trans y))) + (send-event (ppointer->process (-> self parent)) 'gonna-getcha) + ) + (if (< (+ 49152.0 (-> self initial-y)) (-> self root trans y)) + (go-virtual explode) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +(defstate explode (missile-bot) + :virtual #t + :enter (behavior () + (if (not (send-event (ppointer->process (-> self parent)) 'in-cutscene?)) + (sound-play "mb-expl-4") + ) + (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 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) + ) + ) + (when (-> self will-hit-errol) + (send-event (ppointer->process (-> self parent)) 'gonna-getcha) + (send-event (ppointer->process (-> self parent)) 'gotcha) + ) + ) + :trans (behavior () + (when (not (-> self child)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod enemy-common-post ((this missile-bot)) + (local-vars (sv-272 vector) (sv-288 vector) (sv-304 vector)) + (with-pp + (cond + ((stunned?) + (when (-> this engine-sound-playing) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound-playing) #f) + ) + ) + (else + (+! (-> this top-angle) (* 1747.6267 (-> pp clock time-adjust-ratio))) + (if (< 65536.0 (-> this top-angle)) + (+! (-> this top-angle) -65536.0) + ) + (sound-play "mb-engine-loop" :id (-> this engine-sound) :position (-> this root trans)) + (set! (-> this engine-sound-playing) #t) + ) + ) + (quaternion-axis-angle! (-> this top-spin-jm quat) 0.0 1.0 0.0 (-> this top-angle)) + (update! (-> this height-bob-rand)) + (cond + ((stunned?) + (set! (-> this height-bob osc target) 0.0) + (set! (-> this height-bob osc max-vel) 0.1) + (update! (-> this height-bob) 0.0) + ) + (else + (set! (-> this height-bob osc target) 1.0) + (set! (-> this height-bob osc max-vel) 0.05) + (update! (-> this height-bob) (-> this height-bob-rand value)) + ) + ) + (set! (-> this main-jm trans y) (* 8192.0 (-> this height-bob osc value))) + (update-with-delay! (-> this main-wobble-rand)) + (when (not (stunned?)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> this main-wobble-rand value quad)) + (vector+! a1-4 a1-4 (new 'static 'vector :y 1.0)) + (update! (-> this main-wobble) a1-4) + ) + ) + (let ((a2-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this main-wobble)) 1.0))) + (quaternion-from-two-vectors! (-> this main-jm quat) (new 'static 'vector :y 1.0) a2-5) + ) + (let ((t9-13 (method-of-type nav-enemy enemy-common-post))) + (t9-13 this) + ) + (toggle-glow-sprites this #f) + (cond + ((stunned?) + (set! (-> this lightning-timer) 0) + (set! (-> this lightning-mode) (the-as uint 0)) + 0 + ) + (else + (set! (-> *part-id-table* 4558 init-specs 12 initial-valuef) 0.0) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 7)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 8)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 10)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 9)) + (set! (-> *part-id-table* 4558 init-specs 12 initial-valuef) 10922.667) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 7)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 8)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 10)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 9)) + (set! (-> *part-id-table* 4558 init-specs 12 initial-valuef) 21845.334) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 7)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 8)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 10)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 9)) + ) + ) + (dotimes (s5-0 3) + (update-with-delay! (-> this lightning-wobble-rand s5-0)) + (let ((a1-20 (new 'stack-no-clear 'vector))) + (set! (-> a1-20 quad) + (-> (the-as (pointer uint128) (+ (the-as uint (-> this lightning-wobble-rand 0 value)) (* 48 s5-0)))) + ) + (update! (-> this lightning-wobble s5-0) a1-20) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5))) + (s1-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 6))) + ) + (dotimes (s0-0 6) + (let ((v1-85 s0-0)) + (cond + ((zero? v1-85) + (vector<-cspace! s5-1 (-> this node-list data 3)) + (+! (-> s5-1 y) 8192.0) + (let ((v0-33 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this lightning-wobble)) 819.2) + ) + ) + (vector+! s5-1 s5-1 v0-33) + ) + (set! sv-304 s4-0) + (let ((v1-90 (-> s2-0 quad))) + (set! (-> sv-304 quad) v1-90) + ) + ) + ((= v1-85 1) + (set! sv-304 s4-0) + (let ((v1-92 (-> s1-0 quad))) + (set! (-> sv-304 quad) v1-92) + ) + ) + ((= v1-85 2) + (set! sv-272 s3-0) + (let ((v1-93 (-> (target-pos 8) quad))) + (set! (-> sv-272 quad) v1-93) + ) + (vector-! s5-1 s3-0 s2-0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 4096.0) + (vector+! s5-1 s5-1 s2-0) + (+! (-> s5-1 y) 4096.0) + (let ((v0-36 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this lightning-wobble 1)) 819.2) + ) + ) + (vector+! s5-1 s5-1 v0-36) + ) + (set! sv-304 s4-0) + (let ((v1-99 (-> s2-0 quad))) + (set! (-> sv-304 quad) v1-99) + ) + ) + ((= v1-85 3) + (set! sv-304 s4-0) + (let ((v1-101 (-> s3-0 quad))) + (set! (-> sv-304 quad) v1-101) + ) + ) + ((= v1-85 4) + (set! sv-288 s3-0) + (let ((v1-102 (-> (target-pos 8) quad))) + (set! (-> sv-288 quad) v1-102) + ) + (vector-! s5-1 s3-0 s1-0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 4096.0) + (vector+! s5-1 s5-1 s1-0) + (+! (-> s5-1 y) 4096.0) + (let ((v0-39 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this lightning-wobble 2)) 819.2) + ) + ) + (vector+! s5-1 s5-1 v0-39) + ) + (set! sv-304 s4-0) + (let ((v1-108 (-> s1-0 quad))) + (set! (-> sv-304 quad) v1-108) + ) + ) + (else + (set! sv-304 s4-0) + (let ((v1-109 (-> (target-pos 6) quad))) + (set! (-> sv-304 quad) v1-109) + ) + ) + ) + ) + (let ((a0-64 (-> this lightning s0-0)) + (v1-112 s5-1) + ) + (set! (-> a0-64 state meet data 0 quad) (-> v1-112 quad)) + ) + (let ((a0-67 (-> this lightning s0-0)) + (v1-116 s4-0) + ) + (set! (-> a0-67 state meet data (+ (-> a0-67 state points-to-draw) -1) quad) (-> v1-116 quad)) + ) + (cond + ((or (= (-> this lightning-mode) 2) (and (= (-> this lightning-mode) 1) (< s0-0 2))) + (let ((v1-126 (-> this lightning s0-0 state mode))) + (when (or (zero? v1-126) (= v1-126 3)) + (let ((v1-130 (-> this lightning s0-0)) + (a0-74 1) + ) + (let ((a1-45 (!= a0-74 (-> v1-130 state mode)))) + (case a0-74 + ((3) + (if a1-45 + (set! (-> v1-130 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-130 state start-color) (-> v1-130 spec start-color)) + (set! (-> v1-130 state end-color) (-> v1-130 spec end-color)) + ) + ) + ) + (set! (-> v1-130 state mode) (the-as uint a0-74)) + ) + ) + ) + ) + (else + (let ((v1-134 (-> this lightning s0-0 state mode))) + (cond + ((or (zero? v1-134) (= v1-134 3)) + ) + (else + (let ((v1-138 (-> this lightning s0-0)) + (a0-77 3) + ) + (let ((a1-55 (!= a0-77 (-> v1-138 state mode)))) + (case a0-77 + ((3) + (if a1-55 + (set! (-> v1-138 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-138 state start-color) (-> v1-138 spec start-color)) + (set! (-> v1-138 state end-color) (-> v1-138 spec end-color)) + ) + ) + ) + (set! (-> v1-138 state mode) (the-as uint a0-77)) + ) + ) + ) + ) + ) + ) + (cond + ((or (zero? (-> this lightning-timer)) (zero? (-> this lightning-mode))) + (when (-> this lightning-sound-playing) + (sound-stop (-> this lightning-sound)) + (set! (-> this lightning-sound-playing) #f) + ) + ) + (else + (let ((f0-26 (if (= (-> this lightning-mode) 1) + 0.5 + 1.0 + ) + ) + ) + (sound-play-by-name + (static-sound-name "mb-arc") + (-> this lightning-sound) + (the int (* 1024.0 f0-26)) + 0 + 0 + (sound-group) + (-> this root trans) + ) + ) + (set! (-> this lightning-sound-playing) #t) + (cond + ((>= (+ (current-time) (seconds -4)) (-> this lightning-timer)) + (set! (-> this lightning-timer) 0) + (set! (-> this lightning-mode) (the-as uint 0)) + 0 + ) + ((>= (+ (current-time) (seconds -3.4)) (-> this lightning-timer)) + (send-event + *target* + '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 'shock) + (shove-up (meters 2)) + (shove-back (meters 4)) + ) + ) + ) + ) + ((>= (+ (current-time) (seconds -3)) (-> this lightning-timer)) + (set! (-> this lightning-mode) (the-as uint 2)) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod coin-flip? ((this missile-bot)) + #f + ) + +;; WARN: Return type mismatch nav-enemy vs missile-bot. +(defmethod relocate ((this missile-bot) (offset int)) + (if (nonzero? (-> this top-spin-jm)) + (&+! (-> this top-spin-jm) offset) + ) + (if (nonzero? (-> this main-jm)) + (&+! (-> this main-jm) offset) + ) + (if (nonzero? (-> this thruster-part)) + (&+! (-> this thruster-part) offset) + ) + (if (nonzero? (-> this spark-part)) + (&+! (-> this spark-part) offset) + ) + (dotimes (v1-16 6) + (if (nonzero? (-> this lightning v1-16)) + (&+! (-> this lightning v1-16) offset) + ) + ) + (the-as missile-bot ((method-of-type nav-enemy relocate) this offset)) + ) + +(defmethod deactivate ((this missile-bot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (-> this engine-sound-playing) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound-playing) #f) + ) + (when (-> this lightning-sound-playing) + (sound-stop (-> this lightning-sound)) + (set! (-> this lightning-sound-playing) #f) + ) + (if (nonzero? (-> this thruster-part)) + (kill-particles (-> this thruster-part)) + ) + (if (nonzero? (-> this spark-part)) + (kill-particles (-> this spark-part)) + ) + ((method-of-type nav-enemy deactivate) this) + (none) + ) + +(defmethod enemy-method-50 ((this missile-bot) (arg0 int)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) + (a0-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)) + ) + (cond + ((or (zero? arg0) (= arg0 2)) + (set! (-> v1-3 prim-core action) (collide-action)) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + (set! (-> a0-4 prim-core action) (collide-action solid no-standon)) + (set! (-> a0-4 prim-core collide-as) (collide-spec enemy)) + (set! (-> a0-4 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + ) + ((= arg0 1) + (set! (-> v1-3 prim-core action) (collide-action solid)) + (set! (-> v1-3 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-3 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list)) + (set! (-> a0-4 prim-core action) (collide-action)) + (set! (-> a0-4 prim-core collide-as) (collide-spec)) + (set! (-> a0-4 prim-core collide-with) (collide-spec)) + 0 + ) + ) + ) + (none) + ) + +(defmethod init-enemy-collision! ((this missile-bot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 12288.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec)) + (set! (-> v1-12 prim-core collide-with) (collide-spec)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 5734.4 0.0 5734.4) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-16 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-16 local-sphere) 0.0 8192.0 0.0 11468.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod init-enemy! ((this missile-bot)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-missile-bot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + ) + (init-enemy-defaults! this *missile-bot-nav-enemy-info*) + (set! (-> this top-angle) 0.0) + (set! (-> this top-spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (set! (-> this top-spin-jm track-mode) (track-mode no-trans no-scale)) + (set! (-> this main-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this main-jm track-mode) (track-mode no-scale)) + (set-params! (-> this height-bob) 0.0 2.0 0.0 0.7 0.08 0.1 0.9) + (set-params! (-> this height-bob-rand) 90 180 0.02) + (set-params! (-> this main-wobble) (the-as vector #f) 0.01 0.1 0.9) + (set-params! (-> this main-wobble-rand) 30 60 0.1 0.1) + (dotimes (s5-1 3) + (set-params! (-> this lightning-wobble s5-1) (the-as vector #f) 0.1 0.2 0.7) + (set-params! (-> this lightning-wobble-rand s5-1) 3 15 0.1 0.1) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1368) this)) + (set! (-> this thruster-part) (create-launch-control (-> *part-group-id-table* 1370) this)) + (set! (-> this spark-part) (create-launch-control (-> *part-group-id-table* 1369) this)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (set! (-> this glows-on) #f) + (toggle-glow-sprites this #t) + (set! (-> this lightning-mode) (the-as uint 0)) + (set! (-> this lightning-timer) 0) + (dotimes (s5-2 6) + (set! (-> this lightning s5-2) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + (let ((v1-50 (-> this lightning s5-2)) + (a0-21 0) + ) + (let ((a1-17 (!= a0-21 (-> v1-50 state mode)))) + (case a0-21 + ((3) + (if a1-17 + (set! (-> v1-50 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-50 state start-color) (-> v1-50 spec start-color)) + (set! (-> v1-50 state end-color) (-> v1-50 spec end-color)) + ) + ) + ) + (set! (-> v1-50 state mode) (the-as uint a0-21)) + ) + ) + (set! (-> this engine-sound) (new-sound-id)) + (set! (-> this engine-sound-playing) #f) + (set! (-> this lightning-sound) (new-sound-id)) + (set! (-> this lightning-sound-playing) #f) + (set! (-> this event-hook) enemy-event-handler) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/factory/warf-projectile.gc b/goal_src/jak3/levels/factory/warf-projectile.gc index 5468bf904c..0c21658eda 100644 --- a/goal_src/jak3/levels/factory/warf-projectile.gc +++ b/goal_src/jak3/levels/factory/warf-projectile.gc @@ -7,3 +7,1464 @@ ;; DECOMP BEGINS +(defpart 2893 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 30)) + (:r 0.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +(defpart 2894 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(defpart 2895 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g 0.8) + (:fade-b 1.6) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2896 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-r -3.6571429) + (:fade-b -3.6571429) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpartgroup group-gun-warf-shot-hit + :id 776 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2897 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2898 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2899 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2900 :period (seconds 30) :length (seconds 0.167)) + ) + ) + +(defpart 2897 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2898 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 255.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.4) + (:fade-b -0.13333334) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2899 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 128.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2900 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(deftype warf-explosion-sphere (process-drawable) + ((current-alpha float) + (expanding? symbol :offset 216) + ) + (:state-methods + active + ) + (:methods + (warf-explosion-sphere-method-21 (_type_) none) + (warf-explosion-sphere-method-22 (_type_) none) + ) + ) + + +(deftype warf-explosion-sphere-init-params (structure) + ((pos vector :inline) + ) + ) + + +(defskelgroup skel-warf-explosion-sphere hemisplosion hemisplosion-lod0-jg hemisplosion-idle-ja + ((hemisplosion-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +(defbehavior warf-explosion-sphere-init-by-other warf-explosion-sphere ((arg0 warf-explosion-sphere-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self level) (level-get *level* 'factoryb)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-warf-explosion-sphere" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self draw lod-set lod 0 dist) 14336000.0) + (set! (-> self expanding?) #t) + (go-virtual active) + ) + +;; WARN: Return type mismatch symbol vs object. +(defbehavior warf-explosion-sphere-event-handler warf-explosion-sphere ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('dissapate) + (set! (-> self expanding?) #f) + #f + ) + ) + ) + +(defstate active (warf-explosion-sphere) + :virtual #t + :event warf-explosion-sphere-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (math-camera-matrix)) + (v1-0 (-> a2-0 rvec quad)) + (a0-0 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-0) + (set! (-> gp-0 uvec quad) a0-0) + (set! (-> gp-0 fvec quad) a1-0) + (set! (-> gp-0 trans quad) a2-1) + ) + (let ((a1-1 (-> gp-0 fvec)) + (v1-1 (-> gp-0 rvec)) + ) + (vector-float*! a1-1 a1-1 -1.0) + (vector-float*! v1-1 v1-1 -1.0) + ) + (matrix->quat gp-0 (-> self root quat)) + ) + (set! (-> self current-alpha) (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (let ((f0-4 (-> self root scale x))) + (if (-> self expanding?) + (+! f0-4 (* 120.0 (seconds-per-frame))) + ) + (set-vector! (-> self root scale) f0-4 f0-4 f0-4 1.0) + (set! (-> self draw bounds w) (* 4505.6 f0-4)) + ) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + ) + :code (behavior () + (while (-> self expanding?) + (suspend) + ) + (let ((f30-0 1.0)) + (while (< 0.0 f30-0) + (set! f30-0 (seek f30-0 0.0 (* 2.0 (seconds-per-frame)))) + (set-vector! (-> self draw color-emissive) f30-0 f30-0 f30-0 1.0) + (suspend) + ) + ) + (deactivate self) + ) + :post (behavior () + (ja-post) + ) + ) + +(deftype warf-projectile (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + (hit-pos vector :inline) + (last-hit-time time-frame) + (snd-whoosh sound-id) + (muzzle-flash-part sparticle-launch-control :offset 576) + ) + (:methods + (warf-projectile-method-41 (_type_) none) + (warf-projectile-method-42 (_type_ vector) none) + (warf-projectile-method-43 (_type_) none) + (send-attack (_type_ process-focusable) none) + (warf-projectile-method-45 (_type_) none) + ) + ) + + +(deftype fac-gun-tower-projectile (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + + +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-warf-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-14 *game-info*) + (a1-11 (+ (-> a0-14 attack-id) 1)) + ) + (set! (-> a0-14 attack-id) a1-11) + (set! (-> gp-0 attack-id) a1-11) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 1.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-damage-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po15)) + (set! (-> gp-0 vehicle-impulse-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po16)) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (set! (-> gp-0 timeout) (the-as time-frame (the int (* 300.0 (/ 2457600.0 arg3))))) + (the-as projectile (spawn-projectile warf-projectile gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-fac-gun-tower-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-14 *game-info*) + (a1-11 (+ (-> a0-14 attack-id) 1)) + ) + (set! (-> a0-14 attack-id) a1-11) + (set! (-> gp-0 attack-id) a1-11) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (set! (-> gp-0 timeout) (the-as time-frame (the int (* 300.0 (/ 2457600.0 arg3))))) + (the-as projectile (spawn-projectile fac-gun-tower-projectile gp-0 arg0 *default-dead-pool*)) + ) + ) + +(defmethod projectile-method-25 ((this warf-projectile)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (v1-1 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 v1-1)) + (f30-0 (vector-length s5-1)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a0-4 s5-1)) + (let ((a1-2 0.8)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-0 quad) vf6) + (vector-normalize! s5-1 1.0) + (warf-projectile-method-42 this s3-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix))) + (fmin 1.0 (* 0.0000061035157 f30-0)) + (-> *part-id-table* 2895 init-specs 3 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + ) + ) + 0 + (none) + ) + ) + +(defmethod setup-collision! ((this warf-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) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd bot crate civilian obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd bot crate civilian obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod warf-projectile-method-45 ((this warf-projectile)) + (when (time-elapsed? (-> this spawn-time) (seconds 0.5)) + (set! (-> this hit-pos quad) (-> this root trans quad)) + (go (method-of-object this impact)) + ) + 0 + (none) + ) + +(defun warf-projectile-move ((arg0 warf-projectile)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 163840.0 f0-0) + (vector-normalize! s4-0 163840.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (warf-projectile-method-45 arg0) + (when (and (logtest? (-> s5-0 status) (collide-status touch-surface)) + (not (vector= (-> arg0 hit-pos) (-> arg0 root trans))) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (let ((v1-19 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-6 (-> arg0 hit-pos)) + ) + (set! (-> a1-6 quad) (-> s5-0 trans quad)) + (vector+! a1-6 a1-6 v1-19) + (move-to-point! (-> arg0 root) a1-6) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod send-attack ((this warf-projectile) (arg0 process-focusable)) + (with-pp + (let* ((v1-1 (get-trans arg0 3)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) + ) + (when (< (vector-length s4-1) (-> this hit-pos w)) + (when (not (type? arg0 h-warf)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'attack) + (set! (-> a1-3 param 0) (the-as uint #f)) + (let ((v1-9 (new 'static 'attack-info :mask (attack-mask + trans + mode + id + penetrate-using + attacker-velocity + damage + vehicle-damage-factor + vehicle-impulse-factor + ) + ) + ) + ) + (set! (-> v1-9 id) (-> this attack-id)) + (set! (-> v1-9 damage) 128.0) + (set! (-> v1-9 vehicle-damage-factor) 1.0) + (set! (-> v1-9 vehicle-impulse-factor) 0.0) + (set! (-> v1-9 mode) 'explode) + (set! (-> v1-9 attacker-velocity quad) (-> s4-1 quad)) + (set! (-> v1-9 trans quad) (-> this root trans quad)) + (set! (-> v1-9 penetrate-using) (penetrate explode enemy-yellow-shot)) + (set! (-> a1-3 param 1) (the-as uint v1-9)) + ) + (send-event-function arg0 a1-3) + ) + ) + ) + ) + 0 + (none) + ) + ) + +(defmethod warf-projectile-method-43 ((this warf-projectile)) + (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* (-> this hit-pos) s5-0 384)) + (let* ((s3-0 (-> s5-0 s4-0)) + (v1-3 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-3 + (let* ((s3-1 (-> v1-3 process)) + (a1-3 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when a1-3 + (if (and (!= *target* a1-3) + (not (logtest? (-> (the-as process-focusable a1-3) focus-status) (focus-status disable dead inactive))) + ) + (send-attack this (the-as process-focusable a1-3)) + ) + ) + ) + ) + ) + ) + ) + (let* ((s4-1 *target*) + (s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when (and s5-1 (< (vector-vector-distance (get-trans s5-1 0) (-> this hit-pos)) (-> this hit-pos w))) + (if (and (!= *target* s5-1) (not (logtest? (-> s5-1 focus-status) (focus-status disable dead inactive)))) + (send-attack this s5-1) + ) + ) + ) + 0 + (none) + ) + +(defmethod projectile-method-40 ((this warf-projectile)) + 128 + ) + +(defstate impact (warf-projectile) + :virtual #t + :enter (behavior () + (local-vars (sv-32 int)) + (set! (-> self hit-pos w) 0.0) + (kill-particles (-> self part)) + (let ((gp-0 (new 'stack-no-clear 'warf-explosion-sphere-init-params))) + (set! (-> gp-0 pos quad) (-> self hit-pos quad)) + (let ((s5-0 sound-play-by-name) + (sname (static-sound-name "impact-trigger2")) + (s3-0 (new-sound-id)) + (s2-0 1024) + (s1-0 0) + (s0-0 0) + ) + (set! sv-32 0) + (let ((t2-0 (target-pos 0))) + (s5-0 (the-as sound-name sname) s3-0 s2-0 s1-0 s0-0 (the-as sound-group sv-32) t2-0) + ) + ) + (process-spawn warf-explosion-sphere gp-0 :name "warf-explosion-sphere" :to self) + ) + (let ((t9-8 (-> (find-parent-state) enter))) + (if t9-8 + (t9-8) + ) + ) + ) + :code (behavior () + (while (< (-> self hit-pos w) 245760.0) + (warf-projectile-method-43 self) + (seek! (-> self hit-pos w) 245760.0 (* 491520.0 (seconds-per-frame))) + (suspend) + ) + (send-event (ppointer->process (-> self child)) 'dissapate) + (while (-> self child) + (suspend) + ) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-func-factory-move ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let* ((v1-1 (-> arg1 key proc)) + (v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> v1-1 root quat))) + ) + (vector-float*! v1-3 v1-3 (* (-> arg1 user-float) (seconds-per-frame))) + (+! (-> arg2 x-y-z-sx x) (-> v1-3 x)) + (+! (-> arg2 x-y-z-sx y) (-> v1-3 y)) + (+! (-> arg2 x-y-z-sx z) (-> v1-3 z)) + ) + (none) + ) + +(defpartgroup group-fac-guntower-particle + :id 777 + :duration (seconds 4) + :linger-duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2901 :flags (sp7)) + (sp-item 2902 :flags (sp7)) + (sp-item 2903 :flags (sp7)) + (sp-item 2904 :flags (sp7)) + ) + ) + +(defpart 2901 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2902 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2903 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 3.0) + (:scale-x (meters 2) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 40.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpart 2904 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 20.0) + (:x (meters -2) (meters 4)) + (:y (meters -2) (meters 4)) + (:z (meters 0) (meters -20)) + (:scale-x (meters 0.5) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0 30.0) + (:b 10.0) + (:a 128.0) + (:scalevel-x (meters -0.002) (meters -0.002)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0) (meters -0.00016666666)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 launch-along-z)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-factory-vehicle-shot + :id 778 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2905 :flags (sp3 sp7)) + (sp-item 2906 :flags (sp3 sp7)) + (sp-item 2907 :flags (sp7)) + (sp-item 2908 :flags (sp7)) + ) + ) + +(defmethod init-proj-settings! ((this warf-projectile)) + (set! (-> this hit-actor?) #f) + (set! (-> this hit-pos quad) (the-as uint128 0)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'guard-shot) + (set! (-> this max-speed) 327680.0) + (set! (-> this move) warf-projectile-move) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this muzzle-flash-part) (the-as sparticle-launch-control (-> *part-id-table* 2896))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 778) this)) + (let* ((v1-12 *game-info*) + (a0-6 (+ (-> v1-12 attack-id) 1)) + ) + (set! (-> v1-12 attack-id) a0-6) + (set! (-> this attack-id) a0-6) + ) + 0 + (none) + ) + +(defmethod projectile-method-24 ((this warf-projectile)) + (draw-beam + (the-as sparticle-launcher (-> this muzzle-flash-part)) + (-> this tail-pos) + (-> this starting-dir) + #f + ) + 0 + (none) + ) + +(defmethod warf-projectile-method-41 ((this warf-projectile)) + 0 + (none) + ) + +(defpart 2909 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 128.0) + (:a 196.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 0.0) + ) + ) + +(defpart 2905 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -0.1)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-factory-move) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2906 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees 0.1)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-factory-move) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2907 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 8.0) + (:x (meters 9)) + (:scale-x (meters 9)) + (:scale-y (meters 2)) + (:r 80.0) + (:g 80.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters -0.03)) + (:accel-x (meters -0.0016666667)) + (:friction 0.98 0.01) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-part-crystal-torpedo-in) + (:next-time (seconds 0.017)) + (:next-launcher 2910) + (:rotate-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2910 + :init-specs ((:fade-a 1.28) (:next-time (seconds 0.167)) (:next-launcher 2911)) + ) + +(defpart 2911 + :init-specs ((:fade-a -1.28)) + ) + +(defun spt-func-part-crystal-torpedo-in ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (spt-func-factory-move arg0 arg1 arg2) + (sparticle-2d-spline-align-instant arg0 arg1 arg2) + (none) + ) + +(defpart 2908 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 4.0) + (:x (meters 1)) + (:scale-x (meters 0.1)) + (:scale-y (meters 2)) + (:r 80.0) + (:g 80.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0)) + (:accel-x (meters 0.006666667)) + (:friction 0.99 0.01) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-part-crystal-torpedo-out) + (:next-time (seconds 0.017)) + (:next-launcher 2912) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2912 + :init-specs ((:scalevel-x (meters 0.033333335)) + (:fade-a 1.28) + (:friction 0.93 0.01) + (:next-time (seconds 0.167)) + (:next-launcher 2913) + ) + ) + +(defpart 2913 + :init-specs ((:fade-a -1.28)) + ) + +(defun spt-func-part-crystal-torpedo-out ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (spt-func-factory-move arg0 arg1 arg2) + (sparticle-2d-spline-align-instant arg0 arg1 arg2) + (none) + ) + +(defmethod warf-projectile-method-42 ((this warf-projectile) (arg0 vector)) + (the int (* 255.0 (/ (the float (- (current-time) (-> this spawn-time))) (the float (-> this timeout))))) + (set! (-> *part-id-table* 2905 init-specs 12 initial-valuef) (vector-length (-> this root transv))) + (set! (-> *part-id-table* 2906 init-specs 12 initial-valuef) (vector-length (-> this root transv))) + (set! (-> *part-id-table* 2907 init-specs 14 initial-valuef) (vector-length (-> this root transv))) + (set! (-> *part-id-table* 2908 init-specs 14 initial-valuef) (vector-length (-> this root transv))) + (spawn (-> this part) arg0) + 0 + (none) + ) + +(defmethod deal-damage! ((this warf-projectile) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(deftype gun-warf-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + (hit-pos vector :inline) + (last-hit-time time-frame) + (snd-whoosh sound-id) + (muzzle-flash-part sparticle-launch-control) + (main-shot-part sparticle-launch-control) + (shot-aim-part sparticle-launch-control) + ) + (:methods + (gun-warf-shot-method-41 (_type_ vector vector) none) + (gun-warf-shot-method-42 (_type_ float float matrix) none) + (launch-part (_type_ vector) none) + ) + ) + + +(defmethod projectile-method-24 ((this gun-warf-shot)) + (draw-beam + (the-as sparticle-launcher (-> this muzzle-flash-part)) + (-> this tail-pos) + (-> this starting-dir) + #f + ) + 0 + (none) + ) + +(defmethod projectile-method-25 ((this gun-warf-shot)) + (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 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a1-0)) + (f30-0 (vector-length s4-1)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s4-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-0 quad) vf6) + (gun-warf-shot-method-41 this a1-0 s4-1) + (vector-normalize! s4-1 1.0) + (launch-part this s3-0) + ) + (let ((s3-1 (new 'stack-no-clear 'matrix)) + (f30-1 (fmin 1.0 (* 0.000008138021 f30-0))) + (f28-0 (-> *part-id-table* 2895 init-specs 3 initial-valuef)) + ) + (forward-up->inv-matrix s3-1 s4-1 *up-vector*) + (set! (-> s3-1 trans quad) (-> s5-0 quad)) + (gun-warf-shot-method-42 this f30-1 f28-0 s3-1) + ) + ) + 0 + (none) + ) + ) + +(defmethod deal-damage! ((this gun-warf-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(defmethod deal-damage! ((this fac-gun-tower-projectile) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +(defun fac-gun-tower-projectile-move ((arg0 fac-gun-tower-projectile)) + (projectile-move-fill-line-sphere arg0) + (let ((s4-0 (-> arg0 root)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-0 (-> arg0 tail-pos) (-> s4-0 trans)) + (let ((f0-0 (vector-length gp-0))) + (when (< 65536.0 f0-0) + (vector-normalize! gp-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s4-0 trans) gp-0) + ) + ) + ) + 0 + (none) + ) + +(defstate impact (fac-gun-tower-projectile) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + '() + ) + ) + +(defmethod projectile-method-25 ((this fac-gun-tower-projectile)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((a1-0 (-> this root trans)) + (v1-1 (-> this tail-pos)) + (a2-1 (vector-! (new 'stack-no-clear 'vector) a1-0 v1-1)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (let ((a3-2 0.8)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a2-1 quad)) + (.lvf vf4 (&-> v1-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-1 quad) vf6) + (spawn (-> this part) a1-1) + ) + 0 + (none) + ) + ) + +(defmethod play-impact-sound ((this fac-gun-tower-projectile) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "gtower-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "tower-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this fac-gun-tower-projectile)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 734 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 734) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 734) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 735 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 735) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 735) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this fac-gun-tower-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) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this fac-gun-tower-projectile)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) #t) + (set! (-> this max-speed) 327680.0) + (set! (-> this move) fac-gun-tower-projectile-move) + (set! (-> this damage) 1.0) + (set! (-> this sound-id) (new-sound-id)) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 777) this)) + (let* ((v1-10 *game-info*) + (a0-6 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-6) + (set! (-> this attack-id) a0-6) + ) + 0 + (none) + ) + +(defmethod projectile-method-26 ((this gun-warf-shot)) + (when (not (-> this hit-actor?)) + (let ((v1-10 + (cond + ((-> this hit-actor?) + (cond + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ) + (send-event (ppointer->process v1-10) 'clock this) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this gun-warf-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "yellow-shot-fir") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "yellow-gun-burn") + ) + ((= v1-0 (projectile-options po1)) + (sound-play "yellow-shot-fiz") + ) + (else + (sound-play "yellow-shot-std" :id (-> this sound-id) :position (-> this root trans)) + ) + ) + ) + (none) + ) + +(defmethod made-impact? ((this gun-warf-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +(defun gun-warf-shot-move ((arg0 gun-warf-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 122880.0 f0-0) + (vector-normalize! s4-0 122880.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (let ((v1-14 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-14) + (move-to-point! (-> arg0 root) a1-5) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this gun-warf-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this gun-warf-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 1638400.0) + (set! (-> this move) gun-warf-shot-move) + (set! (-> this timeout) (seconds 2)) + (set! (-> this sound-id) (new-sound-id)) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this muzzle-flash-part) (the-as sparticle-launch-control (-> *part-id-table* 2896))) + (set! (-> this main-shot-part) (the-as sparticle-launch-control (-> *part-id-table* 2893))) + (set! (-> this shot-aim-part) (the-as sparticle-launch-control (-> *part-id-table* 2895))) + 0 + (none) + ) + +(defmethod gun-warf-shot-method-41 ((this gun-warf-shot) (arg0 vector) (arg1 vector)) + (let ((f30-0 (-> *part-id-table* 2893 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2893 init-specs 4 initial-valuef) (fmin f30-0 (vector-length arg1))) + (draw-beam (the-as sparticle-launcher (-> this main-shot-part)) arg0 arg1 #f) + (set! (-> *part-id-table* 2893 init-specs 4 initial-valuef) f30-0) + ) + 0 + (none) + ) + +(defmethod gun-warf-shot-method-42 ((this gun-warf-shot) (arg0 float) (arg1 float) (arg2 matrix)) + (set! (-> *part-id-table* 2895 init-specs 3 initial-valuef) (* arg0 arg1)) + (launch-particles (-> *part-id-table* 2895) arg2 :origin-is-matrix #t) + (set! (-> *part-id-table* 2895 init-specs 3 initial-valuef) arg1) + 0 + (none) + ) + +(defmethod launch-part ((this gun-warf-shot) (arg0 vector)) + (launch-particles (-> *part-id-table* 2894) arg0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/forest/for-turret.gc b/goal_src/jak3/levels/forest/for-turret.gc index 1905aa1790..f652170e99 100644 --- a/goal_src/jak3/levels/forest/for-turret.gc +++ b/goal_src/jak3/levels/forest/for-turret.gc @@ -1557,7 +1557,8 @@ (a3-2 #x70004000) ) (t9-2 (the-as for-turret-blocker a0-12) a1-6 a2-2 (the-as pointer a3-2)) - (run-now-in-process s5-0 for-turret-blocker-init-by-other (-> this root trans) (the-as none a3-2)) + ;; og:preserve-this passing entity arg here instead of garbage + (run-now-in-process s5-0 for-turret-blocker-init-by-other (-> this root trans) (-> this entity)) ) (-> s5-0 ppointer) ) diff --git a/goal_src/jak3/levels/forest/neo-spawner.gc b/goal_src/jak3/levels/forest/neo-spawner.gc index 475438c294..8937b932e6 100644 --- a/goal_src/jak3/levels/forest/neo-spawner.gc +++ b/goal_src/jak3/levels/forest/neo-spawner.gc @@ -9,7 +9,7 @@ (defun foresta-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 128 10) + (alloc-nav-network-for-level! *nav-network* 128 10) 0 (none) ) @@ -578,21 +578,11 @@ ) :trans (-> (method-of-type neo-spawner open) trans) :code (behavior () - (local-vars (a2-1 (function joint-control-channel float float float float :behavior process))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! neo-spawner-spit-start-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group frames num-frames) -1))) - (set! (-> a0-2 param 1) 1.0) - (let ((t9-2 joint-control-channel-group-eval!) - (a1-2 #f) - ) - (set! a2-1 num-func-seek!) - (t9-2 a0-2 (the-as art-joint-anim a1-2) a2-1) - ) - ) + (ja :num! (seek!)) ) (spawn-neo self) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) @@ -613,7 +603,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((a1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (matrix-f-compose gp-0 a1-5 (the-as float a2-1)) + (matrix-f-compose gp-0 a1-5) ) (set! (-> gp-0 trans quad) (-> self root trans quad)) (if (logtest? (-> *part-group-id-table* 566 flags) (sp-group-flag sp13)) diff --git a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc index 02b4c9174b..16cbd86cd3 100644 --- a/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc +++ b/goal_src/jak3/levels/mhcity/destroy-dark-eco.gc @@ -5,5 +5,1407 @@ ;; name in dgo: destroy-dark-eco ;; dgos: LCTYDEST +(define-extern *dark-lightning-width* curve2d-fast) +(define-extern *dark-tower-lightning* lightning-appearance) + ;; DECOMP BEGINS +(defskelgroup skel-dark-eco-tower mhcity-eco-dark-tower mhcity-eco-dark-tower-lod0-jg mhcity-eco-dark-tower-idle-ja + ((mhcity-eco-dark-tower-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 12) + ) + +(deftype hud-eco-egg (hud) + () + ) + + +(defmethod draw ((this hud-eco-egg)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) + 165 + ) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 50) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-eco-egg)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-eco-egg)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc7d))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 1.0) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + 0 + (none) + ) + +(defpartgroup group-part-dark-egg-mist-active + :id 1449 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 10) + :parts ((sp-item 4749) (sp-item 4750)) + ) + +(defpart 4749 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 1.0 1.0) + (:x (meters 0) (meters 2)) + (:y (meters 4) (meters 15)) + (:scale-x (meters -4) (meters 8)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y (meters 3) (meters 1)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y (meters 0.0033333334)) + (:fade-r 0.128 0.128) + (:fade-g 0.08533333) + (:fade-a 0.10666667 0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4750 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:y (meters 4)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0 64.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.10666667 0.21333334) + (:fade-g -0.053333335 -0.053333335) + (:fade-b 0.10666667 0.10666667) + (:fade-a 0.21333334 0.21333334) + (:accel-x (meters -0.00066666666) (meters 0.0013333333)) + (:accel-z (meters -0.00066666666) (meters 0.0013333333)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 4751) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 4751 + :init-specs ((:fade-a -0.42666668 -0.42666668)) + ) + +(define *initial-orb-pos* (new 'static 'vector :x -1552384.0 :y 39813.12 :z 4849664.0 :w 1.0)) + +(deftype lightning-bolt-tower (lightning-bolt) + () + ) + + +(deftype tower-lightning-disc (structure) + ((bolt lightning-bolt-tower) + (orient quaternion :inline) + (cur-state symbol) + (last-spawn-time time-frame) + (pts vector 8 :inline) + (last-rot-angle float) + ) + ) + + +(set! (-> *lightning-spec-id-table* 46) (new 'static 'lightning-spec + :name "orb-elec-lightning" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x40 :b #xff :a #x80) + :end-color (new 'static 'rgba :g #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 1.5 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3b :page #x4) + :reduction 0.52 + :num-points 64 + :box-size 40960.0 + :merge-factor 0.8 + :merge-count 2 + :radius 2048.0 + :duration 45.0 + :sound #f + ) + ) + +(defskelgroup skel-dark-eco-orb mhcity-de-tower-egg mhcity-de-tower-egg-lod0-jg mhcity-de-tower-egg-idle-ja + ((mhcity-de-tower-egg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +(deftype dark-eco-orb (process-focusable) + ((last-attack-id uint32) + (hit-points float) + (alt-actor entity-actor) + (movie? symbol) + (minimap connection-minimap) + (discs tower-lightning-disc 2 :inline) + (shock-sound sound-id) + (plasma-sound sound-id) + (shock-spawn-time time-frame) + ) + (:state-methods + active + hit + die + die-movie + ) + ) + + +(defbehavior dark-eco-orb-event-handler dark-eco-orb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die-fast) + (deactivate self) + ) + (('touched) + (send-event (ppointer->process (-> self parent)) 'child-touched) + #t + ) + (('attack) + (let ((gp-0 (the-as attack-info (-> arg3 param 1)))) + (when (and (!= (-> gp-0 id) (-> self last-attack-id)) + (logtest? (-> gp-0 penetrate-using) (penetrate flop punch spin uppercut)) + (not (logtest? (penetrate dark-bomb) (-> gp-0 penetrate-using))) + ) + (sound-play "egg-gethit") + (set! (-> self last-attack-id) (-> gp-0 id)) + (let ((f0-1 (if (logtest? (attack-mask damage) (-> gp-0 mask)) + (-> gp-0 damage) + (penetrate-using->damage (-> gp-0 penetrate-using)) + ) + ) + ) + (set! (-> self hit-points) (- (-> self hit-points) f0-1)) + ) + (go-virtual hit) + (return #t) + ) + ) + #f + ) + ) + ) + +(defstate die-movie (dark-eco-orb) + :virtual #t + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (process-spawn scene-player :init scene-player-init "city-get-dark-punch" #t #f :name "scene-player") + (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 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (while *scene-player* + (suspend) + ) + (task-node-close! (game-task-node city-destroy-darkeco-dark-punch) 'event) + (set-setting! 'airlock #f 0.0 0) + (suspend) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 ds9)) + ) + ) + +(defstate die (dark-eco-orb) + :virtual #t + :enter (behavior () + (if (-> self movie?) + (go-virtual die-movie) + ) + ) + :code (behavior () + (sound-play "egg-explode") + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) + (set! (-> gp-1 trans quad) (-> self root trans quad)) + (if (logtest? (-> *part-group-id-table* 325 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 325) + :mat-joint gp-1 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325) :mat-joint gp-1) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.1)) + (suspend) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((t0-2 (res-lump-struct (-> self entity) 'camera-name structure))) + (if t0-2 + (persist-with-delay *setting-control* #f (seconds 2) 'entity-name (the-as symbol t0-2) 0.0 0) + ) + ) + (toggle-status (-> self entity) (entity-perm-status dead) #t) + ) + :post (behavior () + (ja-post) + ) + ) + +(defun spawn-shock-effect ((arg0 dark-eco-orb) + (arg1 vector) + (arg2 lightning-spec) + (arg3 (function lightning-tracker none)) + (arg4 sparticle-launcher) + (arg5 time-frame) + (arg6 float) + ) + (local-vars + (sv-640 (pointer lightning-tracker)) + (sv-656 float) + (sv-672 matrix) + (sv-688 collide-query) + (sv-704 symbol) + (sv-720 vector) + (sv-736 int) + (sv-752 process) + (sv-768 vector) + ) + (set! sv-656 arg6) + (let ((s5-0 *lightning-probe-vars*)) + (set! sv-672 (new 'stack-no-clear 'matrix)) + (set! sv-688 (new 'stack-no-clear 'collide-query)) + (set! sv-704 (the-as symbol #f)) + (set! sv-768 (new 'stack-no-clear 'vector)) + (set! (-> sv-688 start-pos quad) (-> arg1 quad)) + (set! sv-720 (-> sv-688 move-dist)) + (set! (-> sv-720 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 w) 1.0) + (matrix-rotate-zyx! sv-672 (-> sv-688 move-dist)) + (set! sv-736 6) + (while (nonzero? sv-736) + (set! sv-736 (+ sv-736 -1)) + (vector-rotate*! (-> sv-688 move-dist) (-> s5-0 probe-dirs sv-736) sv-672) + (vector-normalize! (-> sv-688 move-dist) sv-656) + (let ((v1-19 sv-688)) + (set! (-> v1-19 radius) 409.6) + (set! (-> v1-19 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) + (set! (-> v1-19 ignore-process0) arg0) + (set! (-> v1-19 ignore-process1) #f) + (set! (-> v1-19 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-19 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) + (set-time! (-> s5-0 last-valid-time)) + (set! (-> sv-768 quad) (-> sv-688 best-other-tri intersect quad)) + (when (< 16384.0 (vector-vector-distance sv-768 (-> sv-688 start-pos))) + (set! sv-704 #t) + (goto cfg-7) + ) + ) + ) + (label cfg-7) + (when sv-704 + (set! sv-752 (get-process *default-dead-pool* lightning-tracker #x4000 0)) + (set! sv-640 + (the-as + (pointer lightning-tracker) + (when sv-752 + (let ((t9-9 (method-of-type lightning-tracker activate))) + (t9-9 (the-as lightning-tracker sv-752) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (run-now-in-process sv-752 lightning-tracker-init arg2 arg5 arg3 arg0 arg1 sv-768) + (-> sv-752 ppointer) + ) + ) + ) + (when sv-640 + (set! (-> sv-640 0 user-time 0) 0) + (when arg4 + (let ((v1-47 (get-field-spec-by-id arg4 (sp-field-id spt-timer)))) + (if v1-47 + (set! (-> v1-47 initial-valuef) (the-as float (-> sv-640 0 duration))) + ) + ) + (let ((t9-12 sp-launch-particles-var) + (a0-26 *sp-particle-system-2d*) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (t9-12 a0-26 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(set! (-> *lightning-spec-id-table* 47) (new 'static 'lightning-spec + :name "lightning-dark-attack-tower" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.5 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 4 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 45.0 + :duration-rand 60.0 + :sound #f + ) + ) + +(if #t + (set! *dark-lightning-width* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 4.5 :z 5.5 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if (or (zero? *dark-tower-lightning*) (!= loading-level global)) + (set! *dark-tower-lightning* (new 'loading-level 'lightning-appearance)) + ) + +(set! (-> *dark-tower-lightning* base-alpha) 0.5) + +(set! (-> *dark-tower-lightning* tex-id) (the-as uint #x403a00)) + +(set! (-> *dark-tower-lightning* blend-mode) (the-as uint 1)) + +(set! (-> *dark-tower-lightning* alpha-1-curve) *curve-unity*) + +(set! (-> *dark-tower-lightning* alpha-1-mode) (the-as uint 3)) + +(set! (-> *dark-tower-lightning* alpha-1-repeat-dist) 262144.0) + +(set! (-> *dark-tower-lightning* alpha-2-curve) #f) + +(set! (-> *dark-tower-lightning* alpha-2-mode) (the-as uint 3)) + +(set! (-> *dark-tower-lightning* alpha-2-repeat-dist) 4096.0) + +(set! (-> *dark-tower-lightning* width-curve) *dark-lightning-width*) + +(set! (-> *dark-tower-lightning* width-mode) (the-as uint 2)) + +(set! (-> *dark-tower-lightning* width-repeat-dist) 4096.0) + +(set! (-> *dark-tower-lightning* uv-repeat-dist) 28672.0) + +(set! (-> *dark-tower-lightning* regenerate-time-start) (seconds 0.167)) + +(set! (-> *dark-tower-lightning* regenerate-time-end) (seconds 0.25)) + +(set! (-> *dark-tower-lightning* width-range-start) 4096.0) + +(set! (-> *dark-tower-lightning* width-range-end) 6144.0) + +(set! (-> *dark-tower-lightning* fade-time) (seconds 0.1)) + +(set! (-> *dark-tower-lightning* uv-shift?) #f) + +(set! (-> *dark-tower-lightning* uv-shift-speed) (seconds 0.1)) + +(set! (-> *dark-tower-lightning* use-sprite-bucket?) #t) + +(set! (-> *dark-tower-lightning* use-accurate-interp?) #t) + +(defstate active (dark-eco-orb) + :virtual #t + :event dark-eco-orb-event-handler + :exit (behavior () + (sound-stop (-> self shock-sound)) + (sound-stop (-> self plasma-sound)) + ) + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (if (>= 0.0 (-> self hit-points)) + (go-virtual die) + ) + (when (and (< (vector-vector-xz-distance (-> self root trans) (camera-pos)) 614400.0) + (time-elapsed? (-> self shock-spawn-time) (seconds 0.017)) + ) + (new 'stack-no-clear 'vector) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set-vector! + gp-1 + (rand-vu-float-range -8192.0 8192.0) + (rand-vu-float-range 0.0 12288.0) + (rand-vu-float-range -8192.0 8192.0) + 1.0 + ) + (set-time! (-> self shock-spawn-time)) + (spawn-shock-effect + self + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-1) + (-> *lightning-spec-id-table* 46) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 409600.0 + ) + ) + (sound-play "de-tower-zap" :id (-> self plasma-sound) :position (-> self root trans)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> self root trans quad)) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-2 (new 'stack-no-clear 'vector)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (let ((f0-6 -28672.0) + (f1-3 (* 70.0 (the float (current-time)))) + (f2-3 (- -40960.0 (-> self root trans y))) + ) + (set! (-> s3-0 y) (+ f0-6 (- f1-3 (* (the float (the int (/ f1-3 f2-3))) f2-3)))) + ) + (set! (-> gp-2 quad) (-> s3-0 quad)) + (sound-play "tree-shocker" :id (-> self shock-sound) :position gp-2) + (+! (-> s3-0 x) 28672.0) + (set! (-> s4-0 start-pos quad) (-> s3-0 quad)) + (vector-float*! (-> s4-0 move-dist) *x-vector* -40960.0) + (let ((v1-39 s4-0)) + (set! (-> v1-39 radius) 2048.0) + (set! (-> v1-39 collide-with) (collide-spec crate obstacle hit-by-others-list pusher)) + (set! (-> v1-39 ignore-process0) self) + (set! (-> v1-39 ignore-process1) #f) + (set! (-> v1-39 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-39 action-mask) (collide-action solid)) + ) + (let ((f0-12 (fill-and-probe-using-line-sphere *collide-cache* s4-0)) + (s3-1 (-> self discs)) + ) + (when (>= f0-12 0.0) + (set! (-> s5-2 quad) (-> s4-0 best-other-tri intersect quad)) + (let ((s4-1 *x-vector*) + (f30-0 9362.286) + (s2-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 0 orient))) + (s1-0 (new 'stack-no-clear 'vector)) + (f28-0 0.0) + (f26-0 (vector-vector-distance gp-2 s5-2)) + ) + (dotimes (s5-3 8) + (vector-rotate-around-axis! s1-0 (the-as quaternion s4-1) f28-0 s2-0) + (vector-float*! s1-0 s1-0 f26-0) + (vector+! (-> s3-1 0 pts s5-3) gp-2 s1-0) + (+! f28-0 f30-0) + ) + ) + ) + ) + ) + ) + (let* ((a0-27 0) + (v1-55 (-> self discs a0-27)) + (gp-3 (-> self discs a0-27 bolt)) + ) + (set! (-> gp-3 base-color) (new 'static 'rgba :r #x78 :g #x78 :b #xff :a #xff)) + (set! (-> gp-3 inner-point-travel-time) (seconds 1)) + (set! (-> gp-3 snap-inner-points?) #t) + (set! (-> gp-3 fractal-reduction) 0.4) + (set! (-> gp-3 generate-mode) (the-as uint 1)) + (set! (-> gp-3 appearance) *dark-tower-lightning*) + (set! (-> gp-3 num-active-spans) 7) + (dotimes (a0-37 8) + (set! (-> gp-3 spans data a0-37 random-offset-size-start) 4096.0) + (set! (-> gp-3 spans-internal data a0-37 num-inner-points) 2) + (set! (-> gp-3 spans data a0-37 inner-random-offset-size) 4096.0) + (set! (-> gp-3 span-pts-start data a0-37 quad) (-> v1-55 pts a0-37 quad)) + ) + (set! (-> gp-3 spans data 0 random-offset-size-start) 0.0) + (set! (-> gp-3 spans data 7 random-offset-size-start) 0.0) + (set! (-> gp-3 spans-internal data 7 num-inner-points) 0) + (case (-> v1-55 cur-state) + (('inactive) + (if (zero? (lightning-bolt-method-14 gp-3)) + (lightning-bolt-method-13 gp-3 2) + ) + ) + (('active) + (if (and (!= (lightning-bolt-method-14 gp-3) 0) (!= (lightning-bolt-method-14 gp-3) 1)) + (lightning-bolt-method-13 gp-3 1) + ) + ) + ) + (lightning-bolt-method-11 gp-3) + (lightning-bolt-method-12 gp-3) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let* ((f30-0 0.15) + (f28-0 0.19999999) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f30-1 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) + ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + #f + ) + :post (behavior () + (transform-post) + ) + ) + +(defstate hit (dark-eco-orb) + :virtual #t + :event dark-eco-orb-event-handler + :trans (behavior () + (if (>= 0.0 (-> self hit-points)) + (go-virtual die) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.5) :frame-num 5.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (go-virtual active) + ) + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defmethod relocate ((this dark-eco-orb) (offset int)) + (dotimes (v1-0 2) + (if (nonzero? (-> this discs v1-0 bolt)) + (&+! (-> this discs v1-0 bolt) offset) + ) + ) + (call-parent-method this offset) + ) + +(defbehavior dark-eco-orb-init-by-other dark-eco-orb ((arg0 entity-actor)) + (set! (-> self level) (level-get *level* 'lctydest)) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 81920.0) + (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! (-> self root) s5-0) + ) + (set! (-> self shock-sound) (new-sound-id)) + (set! (-> self plasma-sound) (new-sound-id)) + (set! (-> self entity) arg0) + (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-orb" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self last-attack-id) (the-as uint 0)) + (set! (-> self hit-points) 1.0) + (set! (-> self movie?) #f) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1449) self)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (-> arg0 extra trans) 0)) + (dotimes (gp-1 2) + (quaternion-identity! (the-as quaternion (+ (the-as uint (-> self discs 0 orient)) (* 192 gp-1)))) + (set! (-> self discs gp-1 bolt) (new 'process 'lightning-bolt-tower)) + (set! (-> self discs gp-1 cur-state) 'active) + (init! (-> self discs gp-1 bolt) 8 4 *dark-tower-lightning*) + ) + (go-virtual active) + ) + +(defbehavior dark-eco-orb-init-by-other-pos-scale dark-eco-orb ((arg0 vector) (arg1 float)) + (set! (-> self level) (level-get *level* 'lctydest)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-0 penetrate-using) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list projectile)) + (set! (-> s3-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s3-0 transform-index) 0) + (set-vector! (-> s3-0 local-sphere) 0.0 8192.0 0.0 24576.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-18 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> s4-0 max-iteration-count) (the-as uint 2)) + (set! (-> self root) s4-0) + ) + (quaternion-identity! (-> self root quat)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) arg1 arg1 arg1 1.0) + (set! (-> self shock-sound) (new-sound-id)) + (set! (-> self plasma-sound) (new-sound-id)) + (set! (-> self last-attack-id) (the-as uint 0)) + (set! (-> self hit-points) 1.0) + (set! (-> self movie?) #t) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-orb" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) + (dotimes (gp-2 2) + (quaternion-identity! (the-as quaternion (+ (the-as uint (-> self discs 0 orient)) (* 192 gp-2)))) + (set! (-> self discs gp-2 bolt) (new 'process 'lightning-bolt-tower)) + (set! (-> self discs gp-2 cur-state) 'inactive) + (init! (-> self discs gp-2 bolt) 8 4 *dark-tower-lightning*) + ) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1449) self)) + (go-virtual active) + ) + +(deftype dark-eco-tower (process-drawable) + ((puffer? symbol) + (puffer-h handle) + (jump-y float) + (jump-z float) + (creak-sound ambient-sound) + ) + (:state-methods + idle + ) + ) + + +(deftype tower-wave (structure) + ((start float) + (end float) + (freq float) + (amp float) + ) + ) + + +(define *dark-eco-tower-waves* (new 'static 'boxed-array :type tower-wave + (new 'static 'tower-wave :end 0.5 :freq 0.5 :amp 0.2) + (new 'static 'tower-wave :end 0.2 :freq 0.2 :amp 0.1) + ) + ) + +(defun dark-eco-tower-callback ((arg0 cspace) (arg1 transformq)) + (-> arg0 param1) + (-> arg0 param2) + (let ((f30-0 1.0)) + (cspace<-parented-transformq-joint! arg0 arg1) + (dotimes (s4-0 (length *dark-eco-tower-waves*)) + (let* ((s3-0 (-> *dark-eco-tower-waves* s4-0)) + (f0-2 (- (* 0.000012207031 (-> arg0 bone transform trans y)) + (* 0.0033333334 (the float (current-time)) (-> s3-0 freq)) + ) + ) + ) + 0.0 + (let* ((f0-8 (lerp-scale 0.0 1.0 (fabs (- f0-2 (the float (the int f0-2)))) (-> s3-0 start) (-> s3-0 end))) + (f0-10 (sin (* 32768.0 f0-8))) + ) + (+! f30-0 (* (-> s3-0 amp) f0-10)) + ) + ) + ) + (set! (-> arg1 scale x) f30-0) + (set! (-> arg1 scale z) f30-0) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +(defstate idle (dark-eco-tower) + :virtual #t + :trans (behavior () + (update-trans! (-> self creak-sound) (-> self root trans)) + (set-falloff-far! (-> self creak-sound) 163840.0) + (update! (-> self creak-sound)) + ) + :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 transform-post + ) + +(defmethod init-from-entity! ((this dark-eco-tower) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-tower" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +(defmethod deactivate ((this dark-eco-tower)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this puffer-h) + (deactivate (-> this puffer-h process 0)) + ) + (call-parent-method this) + (none) + ) + +(defmethod relocate ((this dark-eco-tower) (offset int)) + (if (nonzero? (-> this creak-sound)) + (&+! (-> this creak-sound) offset) + ) + (call-parent-method this offset) + ) + +(defbehavior dark-eco-tower-init-by-other dark-eco-tower ((arg0 entity-actor)) + (set! (-> self level) (level-get *level* 'lctydest)) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 81920.0) + (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! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-tower" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (transform-post) + (let ((a0-20 (-> self node-list data 4))) + (set! (-> a0-20 param0) dark-eco-tower-callback) + (set! (-> a0-20 param1) self) + (set! (-> a0-20 param2) (the-as basic 0)) + ) + (let ((v1-34 (-> self node-list data 5))) + (set! (-> v1-34 param0) dark-eco-tower-callback) + (set! (-> v1-34 param1) self) + (set! (-> v1-34 param2) (the-as basic 1)) + ) + (let ((v1-36 (-> self node-list data 6))) + (set! (-> v1-36 param0) dark-eco-tower-callback) + (set! (-> v1-36 param1) self) + (set! (-> v1-36 param2) (the-as basic 2)) + ) + (let ((v1-38 (-> self node-list data 7))) + (set! (-> v1-38 param0) dark-eco-tower-callback) + (set! (-> v1-38 param1) self) + (set! (-> v1-38 param2) (the-as basic 3)) + ) + (let ((v1-40 (-> self node-list data 8))) + (set! (-> v1-40 param0) dark-eco-tower-callback) + (set! (-> v1-40 param1) self) + (set! (-> v1-40 param2) (the-as basic 4)) + ) + (let ((v1-42 (-> self node-list data 9))) + (set! (-> v1-42 param0) dark-eco-tower-callback) + (set! (-> v1-42 param1) self) + (set! (-> v1-42 param2) (the-as basic 5)) + ) + (let ((v1-44 (-> self node-list data 10))) + (set! (-> v1-44 param0) dark-eco-tower-callback) + (set! (-> v1-44 param1) self) + (set! (-> v1-44 param2) (the-as basic 6)) + ) + (set! (-> self jump-y) (* 4096.0 (res-lump-float arg0 'jump-y :default 13.0))) + (set! (-> self jump-z) (* 4096.0 (res-lump-float arg0 'jump-z :default 6.0))) + (set! (-> self creak-sound) (new 'process 'ambient-sound "creak-loop" *zero-vector* 0.0)) + (set-falloff-far! (-> self creak-sound) 163840.0) + (update-vol! (-> self creak-sound) 1.0) + (update-pitch-mod! (-> self creak-sound) 0.0) + (set! (-> self puffer?) #f) + (let ((v1-57 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (if (= (the-as uint v1-57) 1) + (set! (-> self puffer?) #t) + ) + ) + (cond + ((not (-> self puffer?)) + (setup-masks (-> self draw) 0 8) + (set! (-> self puffer-h) (the-as handle #f)) + ) + (else + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s5-3 (new 'stack-no-clear 'puffer-init-by-other-params))) + (set! (-> s5-3 scale) 0.8) + (set! (-> s5-3 jump-y) (* (-> self root scale x) (-> self jump-y))) + (set! (-> s5-3 jump-z) (* (-> self root scale x) (-> self jump-z))) + (vector<-cspace! (-> s5-3 pos) (-> self node-list data 13)) + (matrix->quaternion (-> s5-3 orient) (-> self node-list data 13 bone transform)) + (quaternion-copy! (-> s5-3 orient) (-> self root quat)) + (let ((v1-73 (entity-actor-lookup arg0 'alt-actor 0))) + (when v1-73 + (quaternion-copy! (-> s5-3 orient) (-> v1-73 quat)) + (set! (-> s5-3 jump-y) (-> self jump-y)) + (set! (-> s5-3 jump-z) (-> self jump-z)) + ) + ) + (set! (-> self puffer-h) + (ppointer->handle + (process-spawn mhcity-puffer :init puffer-init-by-other s5-3 :name "mhcity-puffer" :to self) + ) + ) + ) + ) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (go-virtual idle) + ) + +(deftype task-manager-destroy-darkeco (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (handles handle 64) + (orb-handles handle 8) + (orb-status uint32 8) + (counter uint32) + (initial-orb handle) + ) + ) + + +(defmethod set-time-limit ((this task-manager-destroy-darkeco)) + (local-vars (sv-16 res-tag)) + (let ((a0-2 (entity-by-name "tmanager-7"))) + (when a0-2 + (set! (-> this entity) (the-as entity-actor a0-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data a0-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-2)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (dotimes (v1-5 64) + (set! (-> this handles v1-5) (the-as handle #f)) + ) + (dotimes (v1-8 8) + (set! (-> this orb-handles v1-8) (the-as handle #f)) + (set! (-> this orb-status v1-8) (the-as uint 0)) + ) + (set-setting! 'city-sound '(darkeco1) 0.0 2) + (set! (-> this initial-orb) (the-as handle #f)) + (set! (-> this counter) (the-as uint 5)) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-eco-egg :init hud-init-by-other :name "hud-eco-egg" :to this)) + ) + (set-setting! 'music 'dstrdeco 0.0 0) + ((method-of-type task-manager set-time-limit) this) + (none) + ) + +(defmethod task-manager-method-26 ((this task-manager-destroy-darkeco)) + (when (task-node-open? (game-task-node city-destroy-darkeco-dark-punch)) + (when (< (vector-vector-distance *initial-orb-pos* (target-pos 0)) 409600.0) + (let ((a1-1 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-1 9) #f) + (set! (-> a1-1 8) #f) + (set! (-> a1-1 7) #f) + (set! (-> a1-1 6) #f) + (set! (-> a1-1 5) #f) + (set! (-> a1-1 4) #f) + (set! (-> a1-1 3) #f) + (set! (-> a1-1 2) 'mhctycst) + (set! (-> a1-1 1) 'mhcitya) + (set! (-> a1-1 0) 'ctywide-mh) + (want-levels *load-state* a1-1) + ) + (if (not (movie?)) + (gui-control-method-12 + *gui-control* + this + (gui-channel art-load) + (gui-action queue) + "city-get-dark-punch" + 0 + -99.0 + (new 'static 'sound-id) + ) + ) + ) + (when (not (-> this initial-orb)) + (let ((s5-1 (get-process *default-dead-pool* dark-eco-orb #x4000 1))) + (set! (-> this initial-orb) + (process->handle + (-> (when s5-1 + (let ((t9-7 (method-of-type dark-eco-orb activate))) + (t9-7 (the-as dark-eco-orb s5-1) this "dark-eco-orb" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 dark-eco-orb-init-by-other-pos-scale *initial-orb-pos* #x3f800000) + (-> s5-1 ppointer) + ) + 0 + ) + ) + ) + ) + ) + ) + (when (nonzero? (-> this actor-group)) + (let ((s5-2 0)) + (dotimes (s4-1 (length (-> this actor-group 1))) + (let ((a0-15 (-> this actor-group 1 data s4-1))) + (if (and (-> a0-15 actor) (logtest? (-> a0-15 actor extra perm status) (entity-perm-status dead))) + (+! s5-2 1) + ) + ) + ) + (set! (-> this counter) (the-as uint (- (length (-> this actor-group 1)) s5-2))) + (cond + ((zero? (-> this counter)) + (when (-> this hud-counter) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (set! (-> this hud-counter) (the-as handle #f)) + ) + ) + (else + (set! (-> *game-info* counter) (the float (-> this counter))) + ) + ) + (if (= s5-2 (length (-> this actor-group 1))) + (task-node-close! (game-task-node city-destroy-darkeco-orbs) 'event) + ) + ) + ) + (when (not (and *target* (focus-test? *target* grabbed))) + (when (nonzero? (-> this actor-group)) + (dotimes (s5-3 (length (-> this actor-group 0))) + (let ((s4-2 (-> this actor-group 0 data s5-3))) + (cond + ((and (-> s4-2 actor) + (= (-> s4-2 actor extra level display?) 'display) + (is-object-visible? (-> s4-2 actor extra level) (-> s4-2 actor vis-id)) + ) + (if (not (-> this handles s5-3)) + (set! (-> this handles s5-3) + (ppointer->handle (process-spawn dark-eco-tower (-> s4-2 actor) :name "dark-eco-tower" :to this)) + ) + ) + ) + (else + (when (-> this handles s5-3) + (deactivate (-> this handles s5-3 process 0)) + (set! (-> this handles s5-3) (the-as handle #f)) + ) + ) + ) + ) + ) + (dotimes (s5-4 (length (-> this actor-group 1))) + (let ((s4-3 (-> this actor-group 1 data s5-4))) + (when (-> s4-3 actor) + (if (logtest? (-> s4-3 actor extra perm status) (entity-perm-status dead)) + (set! (-> this orb-status s5-4) (the-as uint 1)) + ) + (cond + ((and (is-object-visible? (-> s4-3 actor extra level) (-> s4-3 actor vis-id)) + (zero? (-> this orb-status s5-4)) + ) + (if (not (-> this orb-handles s5-4)) + (set! (-> this orb-handles s5-4) + (ppointer->handle (process-spawn dark-eco-orb (-> s4-3 actor) :name "dark-eco-orb" :to this)) + ) + ) + ) + (else + (when (-> this orb-handles s5-4) + (deactivate (-> this orb-handles s5-4 process 0)) + (set! (-> this orb-handles s5-4) (the-as handle #f)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(deftype task-manager-dark-punch-training (task-manager) + ((gui-id sound-id) + ) + (:methods + (print-text (_type_ text-id) none) + ) + ) + + +;; WARN: Return type mismatch float vs none. +(defmethod print-text ((this task-manager-dark-punch-training) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-4 s5-1)) + (set! (-> v1-4 width) (the float 440)) + ) + (let ((v1-5 s5-1)) + (set! (-> v1-5 height) (the float 80)) + ) + (let ((v1-6 s5-1)) + (set! (-> v1-6 scale) 0.7) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* arg0 #f)) + (s4-0 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (none) + ) + +(defstate active (task-manager-dark-punch-training) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self gui-id) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + ) + :exit (behavior () + (send-event *target* 'end-mode 'darkjak) + ) + :trans (behavior () + (print-text self (text-id text-05e7)) + (if (and (time-elapsed? (-> self state-time) (seconds 5)) + *target* + (not (logtest? (focus-status dark) (-> *target* focus-status))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + (let ((t9-3 (-> (find-parent-state) trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +(deftype grind-electricity (process-drawable) + () + (:state-methods + idle + ) + ) + + +(set! (-> *lightning-spec-id-table* 48) (new 'static 'lightning-spec + :name "grind-elec-lightning" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +(defstate idle (grind-electricity) + :virtual #t + :trans (behavior () + (local-vars (sv-48 (pointer lightning-tracker)) (sv-52 sparticle-launcher)) + (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)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self root trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s2-0 s5-0)) + (let ((s4-0 s5-0)) + (let ((s3-0 *x-vector*)) + (let ((v1-2 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-2) + ) + (.lvf vf5 (&-> s3-0 quad)) + ) + (.lvf vf4 (&-> s4-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-0 quad) vf6) + ) + (let ((s2-1 s5-0)) + (let ((s4-1 s5-0)) + (let ((s3-1 *y-vector*)) + (let ((v1-3 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-3) + ) + (.lvf vf5 (&-> s3-1 quad)) + ) + (.lvf vf4 (&-> s4-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 (&-> s2-1 quad) vf6) + ) + (let ((s2-2 s5-0)) + (let ((s4-2 s5-0)) + (let ((s3-2 *z-vector*)) + (let ((v1-4 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-4) + ) + (.lvf vf5 (&-> s3-2 quad)) + ) + (.lvf vf4 (&-> s4-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-2 quad) vf6) + ) + (let ((s2-3 gp-0)) + (let ((s4-3 gp-0)) + (let ((s3-3 *x-vector*)) + (let ((v1-5 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-5) + ) + (.lvf vf5 (&-> s3-3 quad)) + ) + (.lvf vf4 (&-> s4-3 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-3 quad) vf6) + ) + (let ((s2-4 gp-0)) + (let ((s4-4 gp-0)) + (let ((s3-4 *y-vector*)) + (let ((v1-6 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-6) + ) + (.lvf vf5 (&-> s3-4 quad)) + ) + (.lvf vf4 (&-> s4-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-4 quad) vf6) + ) + (let ((s2-5 gp-0)) + (let ((s4-5 gp-0)) + (let ((s3-5 *z-vector*)) + (let ((v1-7 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-7) + ) + (.lvf vf5 (&-> s3-5 quad)) + ) + (.lvf vf4 (&-> s4-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-5 quad) vf6) + ) + (set! sv-48 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 48) + 0 + lightning-probe-callback + self + s5-0 + gp-0 + :name "lightning-tracker" + :to self + :unk 0 + ) + ) + (set! sv-52 (-> *part-id-table* 160)) + (when sv-48 + (set! (-> sv-48 0 user-time 0) 0) + (when sv-52 + (let ((v1-19 (get-field-spec-by-id sv-52 (sp-field-id spt-timer)))) + (if v1-19 + (set! (-> v1-19 initial-valuef) (the-as float (-> sv-48 0 duration))) + ) + ) + (let ((t9-10 sp-launch-particles-var) + (a0-20 *sp-particle-system-2d*) + (a1-10 sv-52) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s5-0 quad)) + (t9-10 a0-20 a1-10 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-11 sp-launch-particles-var) + (a0-21 *sp-particle-system-2d*) + (a1-11 sv-52) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (t9-11 a0-21 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this grind-electricity) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) + ) diff --git a/goal_src/jak3/levels/nest/mh-bat.gc b/goal_src/jak3/levels/nest/mh-bat.gc index 2a2c1d6f6e..c9278b55a7 100644 --- a/goal_src/jak3/levels/nest/mh-bat.gc +++ b/goal_src/jak3/levels/nest/mh-bat.gc @@ -7,3 +7,1831 @@ ;; DECOMP BEGINS +(defpartgroup group-mh-bat-charge-up + :id 635 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 2460 :flags (sp7) :period (seconds 40) :length (seconds 0.667)) + (sp-item 2461 :flags (sp7) :period (seconds 40) :length (seconds 0.835)) + (sp-item 2462 :flags (sp6) :period (seconds 40) :length (seconds 1)) + (sp-item 2463 :flags (sp6) :period (seconds 40) :length (seconds 1)) + ) + ) + +(defpart 2460 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 3)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.0033333334)) + (:scalevel-y (meters -0.013333334)) + (:fade-a 0.42666668) + (:accel-x (meters -0.001)) + (:friction 0.98 0.01) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +(defpart 2461 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 10) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 20.0) + (:b 128.0 128.0) + (:a 0.0) + (:scalevel-x (meters -0.02) (meters -0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.335)) + (:next-launcher 2464) + ) + ) + +(defpart 2464 + :init-specs ((:fade-a 0.0)) + ) + +(defpart 2462 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 128.0) + (:a 20.0 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.167)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +(defpart 2463 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.01)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 10.0 5.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + ) + ) + +(defpartgroup group-mh-bat-explosion + :id 636 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.75 0.75 0.75) + :parts ((sp-item 2465 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2466 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2467 :period (seconds 3) :length (seconds 0.05)) + (sp-item 2468 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 2469 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 2470 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 2471 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpartgroup group-mh-bat-jet-explosion + :id 637 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.3 0.3 0.3) + :parts ((sp-item 2465 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2466 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2467 :period (seconds 3) :length (seconds 0.05)) + (sp-item 2468 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 2469 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 2470 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 2471 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 2466 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 2472) + ) + ) + +(defpart 2472 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +(defpart 2471 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 2473) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2470 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 2473) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2473 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 2474)) + ) + +(defpart 2474 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2475) + ) + ) + +(defpart 2475 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 2476) + ) + ) + +(defpart 2476 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 2465 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 2477) + ) + ) + +(defpart 2477 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +(defpart 2469 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2478) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2478 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2479) + ) + ) + +(defpart 2479 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +(defpart 2467 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2480) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2480 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2481) + ) + ) + +(defpart 2481 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +(defpart 2468 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defskelgroup skel-mh-bat mh-bat mh-bat-lod0-jg -1 + ((mh-bat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 -2 8) + :shadow mh-bat-shadow-mg + ) + +(deftype mh-bat (enemy) + ((rotation-matrix matrix :inline) + (move-curve cubic-curve :inline) + (start-pos vector :inline) + (up-vector vector :inline) + (focus-bullseye-pos vector :inline) + (focus-xz-dir vector :inline :offset 752) + (target-velocity vector :inline) + (target-speed float) + (y-offset float) + (max-time-step float) + (orbit-angle float) + (orbit-angular-speed float) + (orbit-distance float) + (bank-angle float) + (pitch-angle float) + (anim-speed float) + (last-off-screen-time time-frame) + (nav-mesh nav-mesh) + (flap-interp float) + (shadow-id int32) + (move-dest vector :inline :overlay-at event-param-point) + ) + (:state-methods + retreat + attack-0 + attack-1 + ) + (:methods + (mh-bat-method-158 (_type_) vector) + (mh-bat-method-159 (_type_) none) + (set-scale! (_type_ float) none) + (probe-shadow (_type_) none) + ) + ) + + +(define *fact-info-mh-bat-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *mh-bat-enemy-info* (new 'static 'enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #t + :idle-anim-script #f + :idle-anim 5 + :notice-anim 5 + :hostile-anim 5 + :hit-anim 5 + :knocked-anim 5 + :knocked-land-anim 5 + :die-anim 5 + :die-falling-anim 5 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 4 + :sound-hit (static-sound-name "mh-bat-get-hit") + :sound-die (static-sound-name "mh-bat-die") + :notice-distance (meters 100) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1887.9647 + :max-angle 1828.4725 + :coll-rad 2253.2097 + :hit-sound (static-sound-name "mh-bat-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8247.761) + :geo-tform (new 'static 'vector :x -1.0 :w 2592.404) + :axial-slop 1887.9647 + :max-angle 1884.2693 + :coll-rad 2172.109 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 13791.578) + :geo-tform (new 'static 'vector :x -1.0 :w 6063.536) + :axial-slop 1887.9647 + :max-angle 2151.4558 + :coll-rad 2430.976 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -1.0 :w 6328.3564) + :geo-tform (new 'static 'vector :x 1.0 :w 21944.402) + :axial-slop 1887.9647 + :max-angle 2562.5303 + :coll-rad 1696.9728 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.2846 :z -0.9585 :w 7849.993) + :geo-tform (new 'static 'vector :x -0.1595 :y -0.9862 :z -0.0413 :w 6464.9995) + :axial-slop 1887.9647 + :max-angle 2870.841 + :coll-rad 1848.9344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8472 :z -0.5309 :w 1049.6501) + :geo-tform (new 'static 'vector :x 0.852 :y 0.2493 :z -0.4598 :w 35559.47) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8358 :z -0.5487 :w 10444.982) + :geo-tform (new 'static 'vector :x -0.7911 :y -0.552 :z -0.263 :w 13496.703) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.2855 :z 0.9582 :w 7833.354) + :geo-tform (new 'static 'vector :x 0.9534 :y 0.0133 :z -0.3009 :w 31748.514) + :axial-slop 1887.9647 + :max-angle 2864.961 + :coll-rad 1774.7968 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8392 :z 0.5436 :w 1057.5873) + :geo-tform (new 'static 'vector :x 0.9259 :y 0.1576 :z -0.3427 :w 22837.203) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.795 :z 0.6062 :w 10426.122) + :geo-tform (new 'static 'vector :x 0.904 :y 0.1843 :z -0.3851 :w 22428.13) + :axial-slop 1887.9647 + :max-angle 3766.3723 + :coll-rad 1318.5024 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6204 :z 0.784 :w 40801.75) + :geo-tform (new 'static 'vector :x 0.0112 :y 0.9036 :z -0.4279 :w 39265.93) + :axial-slop 1887.9647 + :max-angle 2403.9697 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9649 :z 0.2619 :w 8321.415) + :geo-tform (new 'static 'vector :x 0.0583 :y 0.979 :z 0.1943 :w 39636.37) + :axial-slop 1887.9647 + :max-angle 2680.7136 + :coll-rad 1060.864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8092 :z -0.5871 :w 4034.0503) + :geo-tform (new 'static 'vector :x 0.1021 :y 0.9505 :z 0.2931 :w 39452.543) + :axial-slop 1887.9647 + :max-angle 3055.8164 + :coll-rad 996.5568 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.6217 :z 0.783 :w 24744.848) + :geo-tform (new 'static 'vector :x -0.3088 :y 0.4058 :z 0.86 :w 32838.07) + :axial-slop 1887.9647 + :max-angle 2584.5579 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9715 :z -0.2362 :w 8353.983) + :geo-tform (new 'static 'vector :x -0.3226 :y -0.1866 :z 0.9278 :w 33548.844) + :axial-slop 1887.9647 + :max-angle 2685.8474 + :coll-rad 1008.0256 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8614 :z 0.5077 :w 3994.5286) + :geo-tform (new 'static 'vector :x -0.3154 :y -0.2796 :z 0.9066 :w 34789.88) + :axial-slop 1887.9647 + :max-angle 3281.1692 + :coll-rad 984.2688 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.6761 :z 0.7365 :w 40678.086) + :geo-tform (new 'static 'vector :x -0.1121 :y 0.9875 :z 0.1087 :w 25535.54) + :axial-slop 1887.9647 + :max-angle 2307.814 + :coll-rad 1013.76 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6369 :z 0.7707 :w 2816.1184) + :geo-tform (new 'static 'vector :x -0.2268 :y 0.9677 :z -0.1093 :w 25577.736) + :axial-slop 1887.9647 + :max-angle 3235.658 + :coll-rad 849.5104 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7205 :z 0.6933 :w 4994.6807) + :geo-tform (new 'static 'vector :x 0.1277 :y 0.9274 :z -0.3509 :w 25689.31) + :axial-slop 1887.9647 + :max-angle 3077.8438 + :coll-rad 928.5632 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6775 :z 0.7354 :w 24868.4) + :geo-tform (new 'static 'vector :x 0.9349 :y -0.1038 :z -0.3389 :w 34939.773) + :axial-slop 1887.9647 + :max-angle 2959.6604 + :coll-rad 1315.2256 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6375 :z -0.7702 :w 2830.2815) + :geo-tform (new 'static 'vector :x 0.9169 :y -0.2121 :z -0.3375 :w 30645.873) + :axial-slop 1887.9647 + :max-angle 3016.913 + :coll-rad 748.3392 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7178 :z -0.6959 :w 4934.4604) + :geo-tform (new 'static 'vector :x 0.9278 :y 0.1268 :z -0.3503 :w 25722.824) + :axial-slop 1887.9647 + :max-angle 2718.8884 + :coll-rad 839.2704 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 19514.164) + :geo-tform (new 'static 'vector :x 1.0 :w 1363.3673) + :axial-slop 1887.9647 + :max-angle 2641.8108 + :coll-rad 1934.1312 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 1606.342) + :geo-tform (new 'static 'vector :x 1.0 :w 1523.8759) + :axial-slop 1887.9647 + :max-angle 2748.9805 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 1523.8577) + :geo-tform (new 'static 'vector :x 0.9998) + :axial-slop 1887.9647 + :max-angle 3340.6248 + :coll-rad 1063.3217 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9998) + :axial-slop 1887.9647 + :max-angle 4079.8164 + :coll-rad 819.6096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0) + :axial-slop 1887.9647 + :max-angle 4675.866 + :coll-rad 1035.0592 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6594 :z -0.7516 :w 12366.753) + :geo-tform (new 'static 'vector :x 0.9085 :y -0.4097 :z -0.0797 :w 4672.098) + :axial-slop 1887.9647 + :max-angle 2759.9941 + :coll-rad 2022.1952 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0053 :w 4255.4893) + :geo-tform (new 'static 'vector :x -0.6493 :y -0.1997 :z 0.7335 :w 28478.05) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9915 :z 0.1286 :w 10408.628) + :geo-tform (new 'static 'vector :x -0.8244 :y -0.5619 :z 0.065 :w 15611.349) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1471.6927 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6605 :z 0.7505 :w 12360.744) + :geo-tform (new 'static 'vector :x 0.9954 :y 0.0188 :z -0.0925 :w 37012.13) + :axial-slop 1887.9647 + :max-angle 2989.7524 + :coll-rad 2006.6304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z -0.0013 :w 4262.1885) + :geo-tform (new 'static 'vector :x 0.9329 :y -0.0745 :z -0.3517 :w 23086.13) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1437.2864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9773 :z 0.2109 :w 9797.359) + :geo-tform (new 'static 'vector :x 0.9079 :y 0.0423 :z -0.4165 :w 20326.883) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 1.0 :w 21138.729) + :geo-tform (new 'static 'vector :x -0.6322 :y -0.3636 :z 0.684 :w 1500.7925) + :axial-slop 1887.9647 + :max-angle 1766.8142 + :coll-rad 1608.4991 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.3751 :z -0.9269 :w 5793.9287) + :geo-tform (new 'static 'vector :x -0.1097 :y -0.6822 :z 0.7226 :w 21710.604) + :axial-slop 1887.9647 + :max-angle 3980.7112 + :coll-rad 637.3376 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.3763 :z 0.9263 :w 5778.3457) + :geo-tform (new 'static 'vector :x 0.7524 :y 0.1215 :z 0.647 :w 18734.613) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 482.9184 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.1845 :z -0.9828 :w 3915.7214) + :geo-tform (new 'static 'vector :x -0.342 :y 0.753 :z -0.562 :w 32853.996) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 521.0112 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.1853 :z 0.9825 :w 3901.449) + :geo-tform (new 'static 'vector :x 0.6881 :y 0.2026 :z 0.6964 :w 18306.844) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 524.288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint 25 + :pre-tform (new 'static 'vector :x 0.0055 :z -0.9998 :w 3042.2903) + :geo-tform (new 'static 'vector :x -0.3492 :y 0.73 :z -0.5871 :w 34187.945) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 614.8096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint 25 + :pre-tform (new 'static 'vector :x 0.0055 :z 0.9998 :w 3029.875) + :geo-tform (new 'static 'vector :x 0.6216 :y 0.2236 :z 0.7505 :w 17720.426) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 705.3312 + ) + ) + ) + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +(set! (-> *mh-bat-enemy-info* fact-defaults) *fact-info-mh-bat-defaults*) + +(defmethod init-enemy-collision! ((this mh-bat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 10649.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 6144.0 0.0 10240.0) + ) + (set-vector! + (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere) + 0.0 + 6144.0 + 0.0 + 8192.0 + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; WARN: new jak 2 until loop case, check carefully +(defbehavior mh-bat-fly-code mh-bat ((arg0 (function object :behavior mh-bat))) + (ja-channel-push! 2 (seconds 0.1)) + (until #f + (ja-no-eval :group! mh-bat-fly-glide0-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (let ((a0-3 (-> self skel root-channel 1))) + (let ((f0-4 (-> self flap-interp))) + (set! (-> a0-3 frame-interp 1) f0-4) + (set! (-> a0-3 frame-interp 0) f0-4) + ) + (set! (-> a0-3 frame-group) (the-as art-joint-anim mh-bat-fly-fast0-ja)) + (set! (-> a0-3 param 0) 0.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim mh-bat-fly-fast0-ja) num-func-chan) + ) + (until (ja-done? 0) + (suspend) + (let ((s5-0 (cubic-curve-method-12 (-> self move-curve) (new 'stack-no-clear 'vector) 0.0)) + (s4-0 (vector-flatten! (new 'stack-no-clear 'vector) (-> self root transv) (-> self rotation-matrix fvec))) + ) + (vector-flatten! s5-0 s5-0 (the-as vector (-> self rotation-matrix))) + (set! (-> s5-0 y) (fmax 0.0 (-> s5-0 y))) + (seek! + (-> self flap-interp) + (lerp-scale 0.5 1.0 (vector-length s5-0) 0.0 163840.0) + (* 4.0 (seconds-per-frame)) + ) + (seek! + (-> self anim-speed) + (fmax + (lerp-scale 1.0 3.0 (vector-length s5-0) 0.0 327680.0) + (lerp-scale 0.5 4.0 (vector-length s4-0) 0.0 245760.0) + ) + (* 5.0 (seconds-per-frame)) + ) + ) + (ja :num! (seek! max (-> self anim-speed))) + (let ((a0-13 (-> self skel root-channel 1))) + (let ((f0-22 (-> self flap-interp))) + (set! (-> a0-13 frame-interp 1) f0-22) + (set! (-> a0-13 frame-interp 0) f0-22) + ) + (set! (-> a0-13 param 0) 0.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (if arg0 + (arg0) + ) + ) + #f + ) + +(defbehavior mh-bat-fly-post mh-bat () + (cubic-curve-method-9 + (-> self move-curve) + (-> self root trans) + (-> self root transv) + (-> self event-param-point) + (-> self target-velocity) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((gp-0 (-> self up-vector))) + (let ((s4-0 (-> self root transv))) + (cubic-curve-method-11 (-> self move-curve) s4-0 0.0) + (vector-length-max! s4-0 245760.0) + (set! (-> s4-0 y) (fmax -61440.0 (fmin 61440.0 (-> s4-0 y)))) + (vector-v++! (-> self root trans) s4-0) + (cubic-curve-method-12 (-> self move-curve) s5-0 0.0) + (vector-length-max! s5-0 327680.0) + (vector-v++! s4-0 s5-0) + ) + (let* ((v1-13 (vector-flatten! (new 'stack-no-clear 'vector) s5-0 (the-as vector (-> self rotation-matrix)))) + (f0-3 (lerp-scale 9102.223 -9102.223 (vector-dot (-> self rotation-matrix fvec) v1-13) 245760.0 -245760.0)) + ) + (seek! (-> self pitch-angle) f0-3 (* 32768.0 (seconds-per-frame))) + ) + (vector-rotate-around-axis! + gp-0 + (the-as quaternion *y-vector*) + (-> self pitch-angle) + (the-as vector (-> self rotation-matrix)) + ) + (let* ((v1-17 (vector-flatten! (new 'stack-no-clear 'vector) s5-0 *y-vector*)) + (f0-9 (lerp-scale + -15473.777 + 15473.777 + (vector-dot (the-as vector (-> self rotation-matrix)) v1-17) + 163840.0 + -163840.0 + ) + ) + ) + (seek! (-> self bank-angle) f0-9 (* 10922.667 (seconds-per-frame))) + ) + (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) (-> self bank-angle) (-> self rotation-matrix fvec)) + ) + ) + 0 + (enemy-simple-post) + (none) + ) + +(defbehavior mh-bat-chase-post mh-bat () + (mh-bat-method-159 self) + (mh-bat-fly-post) + (none) + ) + +(defstate dormant-aware (mh-bat) + :virtual #t + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) + (< (vector-vector-xz-distance (-> self root trans) (target-pos 0)) 368640.0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (and (and (nav-mesh-method-10 (-> self nav-mesh) gp-1 (target-pos 0) (the-as nav-poly #f)) + (< (vector-vector-xz-distance gp-1 (target-pos 0)) 4096.0) + ) + *target* + (focus-test? *target* pilot-riding) + ) + ) + ) + (go-virtual ambush) + ) + ) + ) + +(defstate ambush (mh-bat) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self start-pos quad) (-> self root trans quad)) + (set-vector! (-> self root transv) 0.0 -81920.0 0.0 0.0) + (set! (-> self orbit-angle) + (vector-vector-angle-safe + (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans)) + *z-vector* + ) + ) + (set! (-> self anim-speed) 0.0) + (set! (-> self y-offset) 24576.0) + (get-point-at-percent-along-path! (-> self path) (-> self event-param-point) 1.0 'interp) + (vector-! (-> self target-velocity) (-> self focus-pos) (-> self event-param-point)) + (set! (-> self target-velocity y) 0.0) + (vector-xz-normalize! (-> self target-velocity) 245760.0) + (logclear! (-> self mask) (process-mask actor-pause)) + ) + :exit (behavior () + (set-scale! self 1.0) + ) + :code (behavior () + (mh-bat-fly-code + (lambda :behavior mh-bat + () + (if (or (< (vector-vector-distance (-> self root trans) (-> self event-param-point)) 40960.0) + (< (vector-length (cubic-curve-method-12 (-> self move-curve) (new 'stack-no-clear 'vector) 0.0)) 65536.0) + ) + (go-virtual hostile) + ) + ) + ) + ) + :post (behavior () + (set-scale! self (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 30.0 540.0)) + (mh-bat-fly-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-2 (-> self focus-xz-dir))) + (forward-up->quaternion gp-1 a1-2 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +(defstate retreat (mh-bat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self event-param-point quad) (-> self start-pos quad)) + (vector-reset! (-> self target-velocity)) + ) + :code (behavior () + (mh-bat-fly-code (lambda :behavior mh-bat + () + (when (< (vector-vector-distance (-> self root trans) (-> self start-pos)) 8192.0) + (if (logtest? (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self mask) (process-mask actor-pause)) + ) + (go-dormant-aware self) + ) + ) + ) + ) + :post (behavior () + (set-scale! self (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 420.0 1500.0)) + (mh-bat-fly-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-2 (-> self focus-xz-dir))) + (forward-up->quaternion gp-1 a1-2 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +(defstate stare (mh-bat) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (mh-bat-fly-code (lambda :behavior mh-bat () (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (go-virtual retreat) + ) + ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + (go-hostile self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + ) + ) + ) + ) + :post (behavior () + (let ((gp-0 (-> self target-velocity))) + (vector-! gp-0 (-> self focus-pos) (-> self event-param-point)) + (vector-normalize! gp-0 1.0) + (vector-cross! gp-0 gp-0 *y-vector*) + (vector-normalize! gp-0 245760.0) + ) + (mh-bat-chase-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-6 (-> self focus-xz-dir))) + (forward-up->quaternion gp-1 a1-6 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +(defstate hostile (mh-bat) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self bank-angle) 0.0) + (set! (-> self pitch-angle) 0.0) + (set! (-> self orbit-distance) (* 4096.0 (rnd-float-range self 17.0 30.0))) + (set! (-> self orbit-angular-speed) (* 182.04445 (rnd-float-range self 35.0 55.0))) + ) + :code (behavior () + (mh-bat-fly-code + (lambda :behavior mh-bat () (if (and (time-elapsed? (-> self state-time) (seconds 2)) + (time-elapsed? (-> self last-off-screen-time) (seconds 1)) + (get-focus! self) + ) + (go-virtual attack-0) + ) + ) + ) + ) + :post (behavior () + (set! (-> self orbit-angle) + (the float + (sar (shl (the int (+ (-> self orbit-angle) (* (-> self orbit-angular-speed) (seconds-per-frame)))) 48) 48) + ) + ) + (let ((gp-0 (-> self target-velocity))) + (vector-! gp-0 (-> self focus-pos) (-> self event-param-point)) + (vector-normalize! gp-0 1.0) + (vector-cross! gp-0 gp-0 *y-vector*) + (vector-normalize! gp-0 245760.0) + ) + (mh-bat-chase-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-7 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0))) + (forward-up->quaternion gp-1 a1-7 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +(defstate attack-0 (mh-bat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self orbit-distance) (* 2.0 (-> self orbit-distance))) + (set! (-> self target-speed) 245760.0) + ) + :trans (behavior () + (let ((a0-0 (-> self target-velocity))) + (vector-! a0-0 (-> self focus-pos) (-> self event-param-point)) + (vector-normalize! a0-0 (-> self target-speed)) + ) + (seek! (-> self target-speed) 0.0 (* 245760.0 (seconds-per-frame))) + (seek! (-> self orbit-distance) 20480.0 (* 24576.0 (seconds-per-frame))) + ) + :code (behavior () + (mh-bat-fly-code (lambda :behavior mh-bat + () + (when (time-elapsed? (-> self state-time) (seconds 0.2)) + (if (or (>= 2 (the-as int (-> self focus aware))) (not (get-focus! self))) + (go-virtual hostile) + ) + ) + (if (< (acos (vector-dot (-> self focus-xz-dir) (-> self rotation-matrix fvec))) 8192.0) + (go-virtual attack-1) + ) + ) + ) + ) + :post (behavior () + (mh-bat-chase-post) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((a1-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-bullseye-pos) (-> self root trans))) + ) + (forward-up->quaternion gp-0 a1-1 (-> self up-vector)) + (forward-up->quaternion s5-0 s4-1 (-> self up-vector)) + ) + (quaternion-slerp! + gp-0 + gp-0 + s5-0 + (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 900.0) + ) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +(defstate attack-1 (mh-bat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let ((a1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (matrix-f-compose gp-0 a1-1) + ) + (vector<-cspace! (-> gp-0 trans) (joint-node mh-bat-lod0-jg jaw)) + ) + (if (logtest? (-> *part-group-id-table* 635 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 635) + :target self + :mat-joint 36 + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 635) :target self :mat-joint 36) + ) + ) + :trans (behavior () + (seek! (-> self anim-speed) 1.0 (* 4.0 (seconds-per-frame))) + (seek! (-> self target-speed) 0.0 (* 245760.0 (seconds-per-frame))) + (seek! (-> self orbit-distance) 20480.0 (* 24576.0 (seconds-per-frame))) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! mh-bat-attack0-windup-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))) + ) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-bat-lod0-jg jaw))) + (v1-23 (-> self focus-bullseye-pos)) + ) + (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 notify-handle) (process->handle self)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((a0-16 *game-info*) + (a1-12 (+ (-> a0-16 attack-id) 1)) + ) + (set! (-> a0-16 attack-id) a1-12) + (set! (-> gp-0 attack-id) a1-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 3.33) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-impulse-factor) 1.5) + (logior! (-> gp-0 options) (projectile-options po16)) + (set! (-> gp-0 pos quad) (-> a2-2 quad)) + (vector-normalize-copy! (-> gp-0 vel) (vector-! (new 'stack-no-clear 'vector) v1-23 a2-2) 532480.0) + ) + (spawn-projectile metalhead-shot gp-0 self *default-dead-pool*) + ) + (sound-play "mh-bat-shot") + (ja-no-eval :group! mh-bat-attack0-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))) + ) + (set! (-> self orbit-angle) (the float (sar (shl (the int (+ 32768.0 (-> self orbit-angle))) 48) 48))) + (vector-normalize-copy! (-> self root transv) (-> self rotation-matrix fvec) 49152.0) + (go-virtual hostile) + ) + :post (behavior () + (mh-bat-chase-post) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-bullseye-pos) (-> self root trans)))) + (vector-normalize! s5-1 1.0) + (forward-up->quaternion gp-0 s5-1 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 (* 4.0 (seconds-per-frame))) + ) + ) + ) + +(defstate knocked-recover (mh-bat) + :virtual #t + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + (deactivate-ragdoll! self) + ) + :code (behavior () + (cond + ((handle->process (-> self ragdoll-proc)) + (ja-channel-push! 1 0) + (ja-no-eval :group! mh-bat-fly-fast0-ja :num! (seek! max 2.0) :frame-num 0.0) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +(defmethod mh-bat-method-158 ((this mh-bat)) + (local-vars (at-0 int) (at-1 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> this nav-mesh)) + (v1-1 (-> this root trans)) + (gp-0 (-> this root transv)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((a0-2 s4-0)) + (.lvf vf1 (&-> gp-0 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-2 quad) vf1) + ) + (let ((s3-0 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> s3-0 vertex)) v1-1 (the-as vector (-> s5-0 bounds))) + (set! (-> s3-0 vertex1 x) 40960000.0) + (set! (-> s3-0 data 20) (the-as uint 3)) + (let ((a2-0 (nav-mesh-method-45 s5-0 s3-0))) + (when a2-0 + (clamp-vector-to-mesh-cross-gaps + s5-0 + (the-as vector (-> s3-0 vertex)) + a2-0 + s4-0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (.lvf vf1 (&-> s4-0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-1 f0-2) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> gp-0 quad) vf1) + gp-0 + ) + ) + ) + ) + ) + ) + ) + +(defmethod mh-bat-method-159 ((this mh-bat)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-rotate-y! s5-0 *z-vector* (-> this orbit-angle)) + (vector-xz-normalize! s5-0 (- (-> this orbit-distance))) + (vector+! (-> this event-param-point) (-> this focus-pos) s5-0) + ) + (+! (-> this event-param-point y) (-> this y-offset)) + (let* ((s5-1 (new 'stack-no-clear 'vector)) + (a1-3 (nav-mesh-method-10 (-> this nav-mesh) s5-1 (-> this event-param-point) (the-as nav-poly #f))) + ) + (cond + (a1-3 + (vector-! s5-1 s5-1 (the-as vector (-> this nav-mesh bounds))) + (project-point-onto-plane-of-poly-local (-> this nav-mesh) a1-3 s5-1 (new 'stack-no-clear 'vector) s5-1) + (vector+! s5-1 s5-1 (the-as vector (-> this nav-mesh bounds))) + (if (< (-> this event-param-point y) (+ 24576.0 (-> s5-1 y))) + (+! (-> this y-offset) (* 57344.0 (seconds-per-frame))) + (seek! (-> this y-offset) 24576.0 (* 32768.0 (seconds-per-frame))) + ) + (set! (-> this event-param-point x) (-> s5-1 x)) + (set! (-> this event-param-point z) (-> s5-1 z)) + ) + (else + (seek! (-> this y-offset) 24576.0 (* 65536.0 (seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +(defmethod set-scale! ((this mh-bat) (arg0 float)) + (set-vector! (-> this root scale) arg0 arg0 arg0 1.0) + 0 + (none) + ) + +(defmethod probe-shadow ((this mh-bat)) + (cond + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + ) + (when (= (logand (-> this shadow-id) 7) (logand (-> *display* frame-clock integral-frame-counter) 15)) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (-> this draw shadow-ctrl settings shadow-dir)) + (f30-0 81920.0) + ) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) + (let ((v1-17 s4-0)) + (set! (-> v1-17 radius) 3276.8) + (set! (-> v1-17 collide-with) (collide-spec backgnd)) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f0-1 0.0) + (let ((v1-21 (-> this draw shadow-ctrl))) + (logclear! (-> v1-21 settings flags) (shadow-flags disable-draw)) + ) + 0 + (-> s4-0 best-other-tri intersect) + (let ((a1-3 (-> this root trans))) + (-> a1-3 y) + (let ((f1-2 (* f0-1 f30-0))) + (shadow-control-method-14 + (-> this draw shadow-ctrl) + a1-3 + s5-0 + (fmax 32768.0 (* 409600.0 f0-1)) + (+ -12288.0 f1-2) + (+ 12288.0 f1-2) + ) + ) + ) + ) + (else + (let ((v1-33 (-> this draw shadow-ctrl))) + (logior! (-> v1-33 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + ) + ) + (else + (let ((v1-36 (-> this draw shadow-ctrl))) + (logior! (-> v1-36 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + 0 + (none) + ) + +(defmethod within-gspot-range? ((this mh-bat)) + #f + ) + +(defmethod enemy-method-50 ((this mh-bat) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (zero? v1-0) (= v1-0 2)) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-4 prim-core action) (collide-action)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ((= v1-0 1) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 prim-core collide-with) (collide-spec backgnd)) + ) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch ragdoll-flag vs vector. +(defmethod ragdoll-spawn! ((this mh-bat) (arg0 symbol) (arg1 symbol)) + (let ((t9-0 (method-of-type enemy ragdoll-spawn!))) + (t9-0 this arg0 arg1) + ) + (the-as + vector + (when (-> this enemy-info ragdoll-info) + (let ((v1-4 (handle->process (-> this ragdoll-proc)))) + (when v1-4 + (let ((v0-1 (logior (-> (the-as ragdoll-proc v1-4) ragdoll ragdoll-flags) (ragdoll-flag rf11)))) + (set! (-> (the-as ragdoll-proc v1-4) ragdoll ragdoll-flags) v0-1) + v0-1 + ) + ) + ) + ) + ) + ) + +(defmethod enemy-common-post ((this mh-bat)) + (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-off-screen-time)) + ) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + (when (< 1 (the-as int (-> this focus aware))) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans s5-0 0) quad)) + (set! (-> this focus-bullseye-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-! (-> this focus-xz-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this focus-xz-dir y) 0.0) + (vector-xz-normalize! (-> this focus-xz-dir) 1.0) + ) + ) + ) + (probe-shadow this) + ((method-of-type enemy enemy-common-post) this) + (none) + ) + +(defmethod event-handler ((this mh-bat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + ) + (('event-flap) + (sound-play-by-name + (static-sound-name "mh-wing-flap") + (new-sound-id) + (the int (* 1024.0 (-> this flap-interp))) + 0 + 0 + (sound-group) + (-> this root trans) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod get-inv-mass ((this mh-bat)) + 0.5 + ) + +(defmethod coin-flip? ((this mh-bat)) + #f + ) + +(defmethod init-enemy! ((this mh-bat)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-bat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *mh-bat-enemy-info*) + (set-scale! this 1.0) + (set! (-> this root pause-adjust-distance) 368640.0) + (let ((v1-9 (-> this neck))) + (set! (-> v1-9 up) (the-as uint 1)) + (set! (-> v1-9 nose) (the-as uint 2)) + (set! (-> v1-9 ear) (the-as uint 0)) + (set-vector! (-> v1-9 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-9 ignore-angle) 30947.555) + ) + (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 nav-mesh) (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0)) + (if (not (-> this nav-mesh)) + (go process-drawable-art-error "no nav-mesh") + ) + (let ((s5-1 (new 'static 'boxed-array :type uint32 #x8 #xb #x1f #x22))) + (dotimes (s4-1 (-> s5-1 length)) + (let ((s3-0 (-> this node-list data (-> s5-1 s4-1)))) + (set! (-> s3-0 param0) (lambda ((arg0 cspace) (arg1 transformq)) + (let ((f0-0 (the-as float (-> arg0 param1)))) + (vector-float*! (-> arg1 scale) (-> arg1 scale) f0-0) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + ) + (set! (-> s3-0 param1) (the-as basic (rnd-float-range this 0.02 0.4))) + ) + ) + ) + (if (not (task-node-closed? (game-task-node nest-eggs-resolution))) + (logior! (-> this mask) (process-mask no-kill)) + ) + (let ((s5-2 (new 'static 'array int32 4 0 0 0 0))) + (set! (-> this shadow-id) (-> s5-2 0)) + (+! (-> s5-2 0) (rand-vu-int-range 5 10)) + ) + (set-vector! (-> this draw color-emissive) 0.1 0.1 0.1 0.0) + (set! (-> this flap-interp) 0.0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/nest/mh-centipede-part.gc b/goal_src/jak3/levels/nest/mh-centipede-part.gc index 07e29915b4..727e21f547 100644 --- a/goal_src/jak3/levels/nest/mh-centipede-part.gc +++ b/goal_src/jak3/levels/nest/mh-centipede-part.gc @@ -5,5 +5,1520 @@ ;; name in dgo: mh-centipede-part ;; dgos: LNSTOBB +(define-extern *range-mhcent-splash-color* curve-color-fast) +(define-extern *range-mhcent-splash-alpha* curve2d-fast) +(define-extern *range-mhcent-splash-scale-x* curve2d-fast) +(define-extern *range-mhcent-splash-scale-y* curve2d-fast) +(define-extern *curve-mhcent-splash-alpha* curve2d-fast) +(define-extern *curve-mhcent-splash-scale-x* curve2d-fast) +(define-extern *curve-mhcent-splash-scale-y* curve2d-fast) +(define-extern *range-mh-centipede-shot-explo-color* curve-color-fast) +(define-extern *range-mh-centipede-shot-explo-alpha* curve2d-fast) +(define-extern *range-mh-centipede-shot-explo-scale-x* curve2d-fast) +(define-extern *range-mh-centipede-shot-explo-scale-y* curve2d-fast) +(define-extern *curve-mh-centipede-shot-explo-alpha* curve2d-fast) +(define-extern *curve-mh-centipede-shot-explo-scale-x* curve2d-fast) +(define-extern *curve-mh-centipede-shot-explo-scale-y* curve2d-fast) + ;; DECOMP BEGINS +;; WARN: Return type mismatch float vs none. +(defun birth-func-ground-dirt-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (set! (-> arg1 omega) (-> arg2 launchrot y)) + (none) + ) + +(defun spt-func-ground-dirt-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 2493) s4-0) + ) + ) + (none) + ) + +(defun spt-func-ground-dirt-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 2494) s4-0) + ) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 100)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 70)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 25)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 41) 70)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 25)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +(defpartgroup group-mh-centipede-before-breach + :id 641 + :duration (seconds 0.017) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2495 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2496 :fade-after (meters 200) :falloff-to (meters 200)) + ) + ) + +(defpart 2495 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 0.5) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:accel-y (meters 0.00033333333) (meters 0.001)) + (:friction 0.96 0.02) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2496 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-before-breach-rocks) + (:num 1.0) + (:x (meters 0) (meters 10)) + (:scale-x (meters 0.4) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.023333333) (meters 0.023333333)) + (:rotvel-z (degrees -5) (degrees 10)) + (:accel-y (meters -0.001)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-mh-centipede-before-breach-rocks) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-before-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defun spt-func-part-mh-centipede-before-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (check-drop-group-center arg0 arg1 arg2) + (none) + ) + +(defpartgroup group-mh-centipede-breach + :id 642 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2497 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2498 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2499 :fade-after (meters 200) :falloff-to (meters 200)) + ) + ) + +(defpart 2497 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 2.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2498 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-dirt) + (:num 4.0) + (:x (meters 0) (meters 6)) + (:y (meters 3)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-breach-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dirt arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpart 2499 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-rocks) + (:num 4.0) + (:x (meters 3) (meters 2)) + (:y (meters 0.5)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-mh-centipede-breach-rocks) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defun spt-func-part-mh-centipede-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce1 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +(defpart 2493 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-rocks-bounce1) + (:num 1.0) + (:scale-x (meters 2) (meters 1) :store) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x40ae00 + #x40ad00 + #x40ac00 + #x40ab00 + #x40aa00 + #x40a900 + #x40a800 + #x40a700 + #x40a600 + #x40a500 + #x40a400 + #x40a300 + #x40a200 + #x40a100 + #x408c00 + #x408b00 + ) + ) + (:func 'spt-func-part-mh-centipede-breach-rocks-bounce1) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-breach-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defun spt-func-part-mh-centipede-breach-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce2 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defun spt-func-ground-dirt-bounce3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (cond + ((or (< (-> arg1 omega) (-> arg2 launchrot y)) (< 0.0 (-> arg1 vel-sxvel y))) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + ) + (else + (set! (-> arg1 acc x) 0.0) + (set! (-> arg1 acc y) 0.0) + (set! (-> arg1 acc z) 0.0) + (set! (-> arg1 vel-sxvel x) (* 0.7 (-> arg1 vel-sxvel x))) + (set! (-> arg1 vel-sxvel z) (* 0.7 (-> arg1 vel-sxvel z))) + (set! (-> arg2 launchrot y) (-> arg1 omega)) + ) + ) + (none) + ) + +(defpart 2494 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-rocks-bounce2) + (:num 1.0) + (:scale-x '*sp-temp*) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-ground-dirt-bounce3) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-breach-rocks-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpartgroup group-mh-centipede-crater-mark + :id 643 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 2500 :flags (is-3d sp3 sp7))) + ) + +(defpart 2500 + :init-specs ((:texture (crack01 desert-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:scale-y (meters 2) (meters 2)) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.016666668) (meters 0.5)) + (:scalevel-y (meters 0.016666668) (meters 0.033333335)) + (:fade-a 2.56 0.85333335) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 left-multiply-quat)) + (:next-time (seconds 0.085)) + (:next-launcher 2501) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 2501 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 2502) + ) + ) + +(defpart 2502 + :init-specs ((:fade-a -0.08533333)) + ) + +(defpartgroup group-mh-centipede-dirt-fall-off + :id 644 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2503 :fade-after (meters 200) :falloff-to (meters 200))) + ) + +(defpart 2503 + :init-specs ((:texture (ceiling-dust lwassig-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:scale-x (meters 5) (meters 2)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 60.0 20.0) + (:b 30.0 10.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters -0.00033333333) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x6a200100 #x6a200100 #x405c00)) + (:next-time (seconds 0.335)) + (:next-launcher 2504) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2504 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.5)) (:next-launcher 2505)) + ) + +(defpart 2505 + :init-specs ((:fade-a -0.053333335 -0.053333335)) + ) + +(defpartgroup group-mh-centipede-impact + :id 645 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2506 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2507 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2508 :fade-after (meters 200) :falloff-to (meters 200)) + ) + ) + +(defpart 2506 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 2.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2507 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-impact-dirt) + (:num 10.0) + (:x (meters 0) (meters 6)) + (:y (meters 3)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-impact-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dirt arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpart 2508 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-impact-rocks) + (:num 4.0) + (:x (meters 3) (meters 2)) + (:y (meters 2)) + (:scale-x (meters 1) (meters 2) :store) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-mh-centipede-impact-rocks) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-impact-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defun spt-func-part-mh-centipede-impact-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce1 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +(defpart 2509 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-impact-rocks-bounce1) + (:num 1.0) + (:scale-x '*sp-temp*) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 70.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x40ae00 + #x40ad00 + #x40ac00 + #x40ab00 + #x40aa00 + #x40a900 + #x40a800 + #x40a700 + #x40a600 + #x40a500 + #x40a400 + #x40a300 + #x40a200 + #x40a100 + #x408c00 + #x408b00 + ) + ) + (:func 'spt-func-part-mh-centipede-impact-rocks-bounce1) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-impact-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defun spt-func-part-mh-centipede-impact-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce2 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +(defpartgroup group-mh-centipede-impact-dust-up + :id 646 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2510 :fade-after (meters 200) :falloff-to (meters 200))) + ) + +(defpart 2510 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 1.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:vel-y (meters 0.16666667) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.02)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06533334 -0.06533334) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95 0.01) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-blood ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 81) 40)) + (s3-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (s4-0 (logand 0 (rand-uint31-gen *random-generator*))) + (v1-5 (+ (logand 0 (rand-uint31-gen *random-generator*)) 120)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 (the-as int s4-0)))) + (set! (-> arg2 rotate-z) (the float (- s5-0 (the-as int v1-5)))) + ) + (none) + ) + +(defpartgroup group-mh-centipede-death + :id 647 + :flags (sp0) + :bounds (static-bspherem 0 0 0 50) + :parts ((sp-item 2511 :period (seconds 30) :length (seconds 0.135)) + (sp-item 2512 :period (seconds 30) :length (seconds 0.135)) + ) + ) + +(defpart 2511 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-explosion-lots) + (:num 10.0) + (:x (meters -3) (meters 6)) + (:y (meters -3) (meters 6)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 3) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0026666666) (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x406500 #x404a00)) + (:next-time (seconds 0.5)) + (:next-launcher 2513) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-explosion-lots ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-blood arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpart 2513 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +(defpart 2512 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-explosion) + (:num 0.5) + (:x (meters -3) (meters 6)) + (:y (meters -3) (meters 6)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 3) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:omega (degrees 0)) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0026666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x406500 #x404a00)) + (:func 'check-mh-centipede-explosion-level) + (:next-time (seconds 0.5)) + (:next-launcher 2513) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-explosion ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-blood arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpartgroup part-mh-centipede-explosion-splats + :id 648 + :duration (seconds 5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 2514 :period (seconds 20) :length (seconds 0.2)) + (sp-item 2515 :period (seconds 20) :length (seconds 0.067) :offset 125) + (sp-item 2516 :flags (is-3d) :period (seconds 20) :length (seconds 0.067)) + (sp-item 2517 :flags (is-3d) :period (seconds 20) :length (seconds 0.5) :offset 150) + (sp-item 2518 :period (seconds 20) :length (seconds 0.167) :offset 20) + ) + ) + +(defpart 2514 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.06666667) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-mhcent-splash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 20.0 :y 40.0 :w 128.0) + (new 'static 'vector :x 90.0 :y 128.0 :w 128.0) + (new 'static 'vector :x 90.0 :y 128.0 :w 128.0) + (new 'static 'vector :x 90.0 :y 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mhcent-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mhcent-splash-scale-x* (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 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mhcent-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mhcent-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mhcent-splash-scale-x* (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 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mhcent-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 2.0 :z 0.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y -5.0000005 :z -1.6666666 :w 1.0) + ) + ) + ) + +(define *part-mh-centipede-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.65) :lifetime-offset (seconds 0.1)) + ) + +(set! (-> *part-id-table* 2514 init-specs 13 initial-valuef) + (the-as float *part-mh-centipede-splash-curve-settings*) + ) + +(set! (-> *part-mh-centipede-splash-curve-settings* color-start) *range-mhcent-splash-color*) + +(set! (-> *part-mh-centipede-splash-curve-settings* alpha-start) *range-mhcent-splash-alpha*) + +(set! (-> *part-mh-centipede-splash-curve-settings* scale-x-start) *range-mhcent-splash-scale-x*) + +(set! (-> *part-mh-centipede-splash-curve-settings* scale-y-start) *range-mhcent-splash-scale-y*) + +(set! (-> *part-mh-centipede-splash-curve-settings* r-scalar) #f) + +(set! (-> *part-mh-centipede-splash-curve-settings* g-scalar) #f) + +(set! (-> *part-mh-centipede-splash-curve-settings* b-scalar) #f) + +(set! (-> *part-mh-centipede-splash-curve-settings* a-scalar) *curve-mhcent-splash-alpha*) + +(set! (-> *part-mh-centipede-splash-curve-settings* scale-x-scalar) *curve-mhcent-splash-scale-x*) + +(set! (-> *part-mh-centipede-splash-curve-settings* scale-y-scalar) *curve-mhcent-splash-scale-y*) + +(defpart 2516 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-blood) + (:num 1.0 2.0) + (:x (meters -5) (meters 10)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.01) (meters 0.02)) + (:scalevel-y (meters 0.01) (meters 0.02)) + (:fade-a -0.10666667) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 2519) + ) + ) + +(defpart 2519 + :init-specs ((:scalevel-x (meters 0.001) (meters 0.00033333333)) (:scalevel-y (meters 0.001) (meters 0.00033333333))) + ) + +(defpart 2518 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-blood) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.1) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2517 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-blood) + (:num 0.5 1.0) + (:x (meters 1) (meters 10)) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0 128.0) + (:scalevel-x (meters 0.0026666666) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2125) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 2519) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun check-mh-centipede-explosion-level ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (cond + ((logtest? (-> *part-group-id-table* 648 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 648)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 648)) + ) + ) + ) + ) + 0 + (none) + ) + +(defpartgroup group-mh-centipede-shot-trail + :id 649 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2520 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 2521 :flags (sp6))) + ) + +(defpart 2521 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -0.8) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +(defpart 2520 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0 3.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 32.0 32.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.2) + (:fade-g -1.6) + (:fade-b -3.2) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.135)) + (:next-launcher 2522) + ) + ) + +(defpart 2522 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.10666667 -0.10666667)) + ) + +(defpartgroup group-mh-centipede-shot-explosion + :id 650 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2523 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2524 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2525 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2526 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2527 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2528 :falloff-to (meters 400) :period (seconds 30) :length (seconds 0.035)) + (sp-item 2529 :falloff-to (meters 400) :period (seconds 30) :length (seconds 0.067)) + (sp-item 2530 :falloff-to (meters 400) :period (seconds 30) :length (seconds 0.167) :offset 100) + ) + ) + +(defpart 2529 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-shot-explosion-dirt) + (:num 20.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.225)) + (:vel-y (meters 0.033333335) (meters 0.13333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.4)) + (:next-launcher 2531) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2531 + :init-specs ((:rotvel-z (degrees -0.2) (degrees 0.4)) (:fade-a -0.256) (:friction 0.95 0.04) (:func 'nothing)) + ) + +(defun spt-birth-func-part-mh-centipede-shot-explosion-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dirt arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpart 2530 + :init-specs ((:birth-func 'spt-birth-func-part-mh-centipede-shot-explosion-dust) + (:num 2.0) + (:x (meters 0) (meters 5)) + (:y (meters 8) (meters 5)) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.001)) + (:friction 0.94 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x6a200100 #x405c00)) + (:next-time (seconds 0.5)) + (:next-launcher 2532) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2532 + :init-specs ((:fade-a -0.03047619 -0.03047619)) + ) + +(defun spt-birth-func-part-mh-centipede-shot-explosion-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dust arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpart 2525 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +(defpart 2523 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +(defpart 2528 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-shot-explosion-bits) + (:num 10.0) + (:x (meters 0) (meters 4)) + (:scale-x (meters 0.2) (meters 0.4)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.0013333333) (meters -0.00066666666)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-z (degrees 0) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defun spt-birth-func-part-mh-centipede-shot-explosion-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +(defpart 2524 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2526 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 2527 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(if #t + (set! *range-mh-centipede-shot-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mh-centipede-shot-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mh-centipede-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *range-mh-centipede-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mh-centipede-shot-explo-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mh-centipede-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(if #t + (set! *curve-mh-centipede-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +(define *part-mh-centipede-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +(set! (-> *part-id-table* 2527 init-specs 16 initial-valuef) + (the-as float *part-mh-centipede-shot-explosion-texture-curve-settings*) + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* color-start) + *range-mh-centipede-shot-explo-color* + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* alpha-start) + *range-mh-centipede-shot-explo-alpha* + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-x-start) + *range-mh-centipede-shot-explo-scale-x* + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-y-start) + *range-mh-centipede-shot-explo-scale-y* + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* r-scalar) #f) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* g-scalar) #f) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* b-scalar) #f) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* a-scalar) + *curve-mh-centipede-shot-explo-alpha* + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-x-scalar) + *curve-mh-centipede-shot-explo-scale-x* + ) + +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-y-scalar) + *curve-mh-centipede-shot-explo-scale-y* + ) + +(defpartgroup group-beast-mh-centipede-shot-glow + :id 651 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 2533 :flags (sp6))) + ) + +(defpart 2533 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2534 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 110.0) + (:g 1.0) + (:b 255.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-14)) + ) + ) + +(defpart 2535 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 8)) + (:scale-y :copy scale-x) + (:r 110.0) + (:g 1.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) diff --git a/goal_src/jak3/levels/nest/mh-centipede.gc b/goal_src/jak3/levels/nest/mh-centipede.gc index 5aca698b99..f6374f896b 100644 --- a/goal_src/jak3/levels/nest/mh-centipede.gc +++ b/goal_src/jak3/levels/nest/mh-centipede.gc @@ -5,5 +5,3441 @@ ;; name in dgo: mh-centipede ;; dgos: LNSTOBB +;; +++nest-hunt-speech-instance-flag +(defenum nest-hunt-speech-instance-flag + :type uint64 + :bitfield #t + (nhs0 0) + (nhs1 1) + (nhs2 2) + (nhs3 3) + (nhs4 4) + (nhs5 5) + (nhs6 6) + (nhs7 7) + ) +;; ---nest-hunt-speech-instance-flag + + +;; +++nest-hunt-speech-info-flag +(defenum nest-hunt-speech-info-flag + :type uint8 + :bitfield #t + (nhs0 0) + (nhs1 1) + (nhs2 2) + ) +;; ---nest-hunt-speech-info-flag + + +;; +++mh-centipede-flag +(defenum mh-centipede-flag + :type uint32 + :bitfield #t + (mc0 0) + (mc1 1) + (mc2 2) + (mc3 3) + (mc4 4) + (mc5 5) + (mc6 6) + (mc7 7) + (mc8 8) + (mc9 9) + ) +;; ---mh-centipede-flag + + ;; DECOMP BEGINS +(define *mh-centipede-sphere-1* (new 'static 'sphere :x -3276800.0 :z 2048000.0 :r 8192000.0)) + +(define *mh-centipede-sphere-2* (new 'static 'sphere :x 6144000.0 :z 2048000.0 :r 1310720.0)) + +(defun nest-hunt-find-sphere ((arg0 vector)) + (cond + ((< (vector-vector-distance *mh-centipede-sphere-1* arg0) (-> *mh-centipede-sphere-1* r)) + *mh-centipede-sphere-1* + ) + ((< (vector-vector-distance *mh-centipede-sphere-2* arg0) (-> *mh-centipede-sphere-2* r)) + *mh-centipede-sphere-2* + ) + (else + (the-as sphere #f) + ) + ) + ) + +(defun nest-hunt-same-sphere ((arg0 sphere) (arg1 vector)) + (and arg0 (= arg0 (nest-hunt-find-sphere arg1))) + ) + +(defun nest-hunt-volume ((arg0 sphere)) + (if (nest-hunt-same-sphere arg0 (target-pos 0)) + 1.0 + 0.1 + ) + ) + +(defun nest-hunt-shake-amp ((arg0 vector)) + (if (nest-hunt-same-sphere (the-as sphere arg0) (target-pos 0)) + 1.0 + 0.01 + ) + ) + +(define *nest-hunt-speech-list* (new 'static 'inline-array talker-speech-class 36 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "sig224" + :channel (gui-channel sig) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig225" + :channel (gui-channel sig) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig226" + :channel (gui-channel sig) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig227" + :channel (gui-channel sig) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig228" + :channel (gui-channel sig) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig229" + :channel (gui-channel sig) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig230" + :channel (gui-channel sig) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig231" + :channel (gui-channel sig) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig232" + :channel (gui-channel sig) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig233" + :channel (gui-channel sig) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig234" + :channel (gui-channel sig) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig235" + :channel (gui-channel sig) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig236" + :channel (gui-channel sig) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig237" + :channel (gui-channel sig) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig238" + :channel (gui-channel sig) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig239" + :channel (gui-channel sig) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig240" + :channel (gui-channel sig) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig241" + :channel (gui-channel sig) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig242" + :channel (gui-channel sig) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig243" + :channel (gui-channel sig) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig244" + :channel (gui-channel sig) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig245" + :channel (gui-channel sig) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig246" + :channel (gui-channel sig) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig247" + :channel (gui-channel sig) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig248" + :channel (gui-channel sig) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig249" + :channel (gui-channel sig) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig250" + :channel (gui-channel sig) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig251" + :channel (gui-channel sig) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig252" + :channel (gui-channel sig) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig253" + :channel (gui-channel sig) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig254" + :channel (gui-channel sig) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig255" + :channel (gui-channel sig) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig256" + :channel (gui-channel sig) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig257" + :channel (gui-channel sig) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig258" + :channel (gui-channel sig) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +(deftype nest-hunt-speech-instance (structure) + ((speech uint16) + (probability float) + (flags nest-hunt-speech-instance-flag) + (play-count uint32) + ) + ) + + +(deftype nest-hunt-speech-info (structure) + ((speeches (array nest-hunt-speech-instance)) + (play-time time-frame) + (current-random time-frame) + (minimum-interval time-frame) + (random-interval time-frame) + (last-played int8) + (flags nest-hunt-speech-info-flag) + ) + ) + + +(deftype nest-hunt-speech-group (structure) + ((play-time time-frame) + (game-counter-last float) + (info (array nest-hunt-speech-info)) + ) + ) + + +(define *nest-hunt-speech* (new 'static 'nest-hunt-speech-group + :info (new 'static 'boxed-array :type nest-hunt-speech-info + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #x1 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x2 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x3 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x4 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x6 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x11 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x12 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1b :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x5 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1d :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1c :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x19 :probability 1.0) + ) + :minimum-interval (seconds 10) + :random-interval (seconds 3) + :flags (nest-hunt-speech-info-flag nhs0 nhs1) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance + :speech #xd + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs4) + ) + (new 'static 'nest-hunt-speech-instance :speech #x7 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1e :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x8 :probability 1.0) + (new 'static 'nest-hunt-speech-instance + :speech #x21 + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs3) + ) + (new 'static 'nest-hunt-speech-instance + :speech #x1a + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs3) + ) + ) + :minimum-interval (seconds 20) + :random-interval (seconds 3) + :flags (nest-hunt-speech-info-flag nhs0) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #x9 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #xb :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x22 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x23 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x20 :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 2) + :flags (nest-hunt-speech-info-flag nhs0) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #xa :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #xf :probability 1.0) + ) + :minimum-interval (seconds 10) + :random-interval (seconds 2) + :flags (nest-hunt-speech-info-flag nhs0) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #xc :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #xe :probability 1.0) + (new 'static 'nest-hunt-speech-instance + :speech #x10 + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs4) + ) + (new 'static 'nest-hunt-speech-instance + :speech #x13 + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs4) + ) + ) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #x14 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x15 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x16 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x17 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x18 :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (nest-hunt-speech-info-flag nhs0) + ) + ) + ) + ) + +(defun reset-nest-hunt-speeches ((arg0 float)) + (set! (-> *nest-hunt-speech* game-counter-last) arg0) + (set! (-> *nest-hunt-speech* play-time) 0) + (dotimes (v1-2 (-> *nest-hunt-speech* info length)) + (let ((a0-3 (-> *nest-hunt-speech* info v1-2))) + (dotimes (a1-2 (-> a0-3 speeches length)) + (set! (-> a0-3 speeches a1-2 play-count) (the-as uint 0)) + ) + (set! (-> a0-3 play-time) 0) + (set! (-> a0-3 current-random) 0) + (set! (-> a0-3 last-played) -1) + ) + ) + #f + ) + +;; WARN: Function nest-hunt-play-speech has a return type of none, but the expression builder found a return statement. +(defun nest-hunt-play-speech ((arg0 int) (arg1 sphere)) + (let ((gp-0 (-> *nest-hunt-speech* info arg0))) + (if (zero? (-> gp-0 speeches length)) + (return 0) + ) + (if (and (logtest? (-> gp-0 flags) (nest-hunt-speech-info-flag nhs1)) + (or (not arg1) (>= (vector-vector-distance arg1 (target-pos 0)) (-> arg1 r))) + ) + (return 0) + ) + (if (logtest? (-> gp-0 flags) (nest-hunt-speech-info-flag nhs0)) + (set! (-> gp-0 play-time) (-> *nest-hunt-speech* play-time)) + ) + (if (not (time-elapsed? (-> gp-0 play-time) (+ (-> gp-0 minimum-interval) (-> gp-0 current-random)))) + (return 0) + ) + (let ((f30-0 0.0) + (s5-1 (-> gp-0 speeches 0 play-count)) + ) + (dotimes (v1-23 (-> gp-0 speeches length)) + (let ((a0-10 (-> gp-0 speeches v1-23))) + (cond + ((or (< s5-1 (-> a0-10 play-count)) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs1)) (nonzero? (-> gp-0 play-time))) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs2)) (zero? (-> gp-0 play-time))) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs0)) (> (-> a0-10 play-count) 0)) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs3)) + (!= (-> *game-info* counter) (-> *nest-hunt-speech* game-counter-last)) + ) + (or (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs4)) (< 4.0 (-> *game-info* counter))) + (and (not (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs5))) (= (-> gp-0 last-played) v1-23)) + ) + ) + (logclear! (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs6)) + ) + ((= (-> a0-10 play-count) s5-1) + (+! f30-0 (-> a0-10 probability)) + (logior! (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs6)) + ) + (else + (set! s5-1 (-> a0-10 play-count)) + (set! f30-0 (-> a0-10 probability)) + (logior! (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs6)) + ) + ) + ) + ) + (let ((f0-5 (* f30-0 (rand-vu)))) + (dotimes (s4-1 (-> gp-0 speeches length)) + (let ((s3-1 (-> gp-0 speeches s4-1))) + (cond + ((or (not (logtest? (-> s3-1 flags) (nest-hunt-speech-instance-flag nhs6))) (< s5-1 (-> s3-1 play-count))) + ) + ((or (>= (-> s3-1 probability) f0-5) + (logtest? (-> s3-1 flags) (nest-hunt-speech-instance-flag nhs1)) + (and (logtest? (-> s3-1 flags) (nest-hunt-speech-instance-flag nhs3)) (zero? (-> s3-1 play-count))) + ) + (when (nonzero? (talker-spawn-func + (-> *nest-hunt-speech-list* (-> s3-1 speech)) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + ) + (set! (-> s3-1 play-count) (+ s5-1 1)) + (set-time! (-> *nest-hunt-speech* play-time)) + (set-time! (-> gp-0 play-time)) + (set! (-> gp-0 current-random) + (the-as time-frame (the int (* (rand-vu) (the float (-> gp-0 random-interval))))) + ) + (set! (-> gp-0 last-played) s4-1) + ) + (return 0) + ) + (else + (set! f0-5 (- f0-5 (-> gp-0 speeches s4-1 probability))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(define *mh-centipede-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 163840.0) + :top-plane (new 'static 'plane :y 1.0 :w -163840.0) + ) + ) + ) + +(defskelgroup skel-mh-centipede-eco-crystal-light eco-crystal-light eco-crystal-light-lod0-jg eco-crystal-light-idle-ja + ((eco-crystal-light-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.5) + :origin-joint-index 3 + ) + +(deftype rod-spawner (process-drawable) + ((rod handle) + (minimap connection-minimap) + ) + (:state-methods + idle + wait-for-children + hidden + ) + ) + + +(defstate wait-for-children (rod-spawner) + :virtual #t + :trans (behavior () + (if (not (-> self child)) + (deactivate self) + ) + ) + :code sleep-code + ) + +(defstate idle (rod-spawner) + :virtual #t + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set-time! (-> self state-time)) + (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v1-8 (-> self entity extra perm))) + (logior! (-> v1-8 status) (entity-perm-status bit-5)) + (set! (-> self root trans x) (* 4096.0 (the float (-> v1-8 user-int16 0)))) + (set! (-> self root trans z) (* 4096.0 (the float (-> v1-8 user-int16 1)))) + ) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (set-vector! (-> gp-0 move-dist) 0.0 -204800.0 0.0 1.0) + (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (+! (-> gp-0 start-pos y) 102400.0) + (let ((v1-17 gp-0)) + (set! (-> v1-17 radius) 409.6) + (set! (-> v1-17 collide-with) (collide-spec backgnd)) + (set! (-> v1-17 ignore-process0) #f) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (let ((f0-15 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (cond + ((>= f0-15 0.0) + (let ((a0-22 (-> self root trans))) + (let ((v1-21 (-> gp-0 start-pos))) + (let ((a1-2 (-> gp-0 move-dist))) + (let ((a2-1 f0-15)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-2 quad)) + ) + (.lvf vf4 (&-> v1-21 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-22 quad) vf6) + ) + (+! (-> self root trans y) 4096.0) + ) + (else + (format 0 "~A failed to find ground~%" (-> self name)) + ) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags taf3 taf5)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (set! (-> self rod) (process->handle (task-arrow-spawn gp-1 self))) + ) + ) + ) + :exit (behavior () + (send-event (handle->process (-> self rod)) 'die) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + :trans (behavior () + (let ((f0-0 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 28672.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let* ((v1-6 (-> *game-info* sub-task-list (game-task-node nest-hunt-get-crystal))) + (a0-4 (handle->process (if (-> v1-6 manager) + (-> v1-6 manager manager) + (the-as handle #f) + ) + ) + ) + ) + (when a0-4 + (when (send-event a0-4 'complete) + (talker-spawn-func (-> *talker-speech* 133) *entity-pool* (target-pos 0) (the-as region #f)) + (cleanup-for-death self) + (go-virtual wait-for-children) + ) + ) + ) + ) + ) + (let* ((f0-2 (* 24.272593 (the float (- (current-time) (-> self state-time))))) + (f30-0 (- f0-2 (* (the float (the int (/ f0-2 65536.0))) 65536.0))) + ) + (quaternion-set! (-> self root quat) 0.0 (sin f30-0) 0.0 (cos f30-0)) + ) + ) + :code sleep-code + :post ja-post + ) + +(defstate hidden (rod-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('appear) + (let ((a1-1 (the-as object (-> block param 0))) + (a0-3 (the-as object (-> block param 1))) + (v1-3 (-> self entity extra perm)) + ) + (logior! (-> v1-3 status) (entity-perm-status bit-5)) + (set! (-> v1-3 user-int16 0) (the int (* 0.00024414062 (-> (the-as vector a1-1) x)))) + (set! (-> v1-3 user-int16 1) (the int (* 0.00024414062 (-> (the-as vector a1-1) z)))) + (set! (-> v1-3 user-int16 2) (the int (* 0.00024414062 (-> (the-as vector a0-3) x)))) + (set! (-> v1-3 user-int16 3) (the int (* 0.00024414062 (-> (the-as vector a0-3) z)))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + ) + (('apply-pos-from-entity) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (ja-post) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + ) + :trans (behavior () + '() + ) + :code sleep-code + ) + +(defmethod init-from-entity! ((this rod-spawner) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-mh-centipede-eco-crystal-light" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> this rod) (the-as handle #f)) + (set! (-> this event-hook) (-> (method-of-object this hidden) event)) + (set! (-> this minimap) #f) + (cond + ((task-node-closed? (game-task-node nest-hunt-fight)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) + ) + (else + (go (method-of-object this hidden)) + ) + ) + ) + +(deftype mh-centipede-shot (projectile) + ((trail-part sparticle-launch-control) + ) + ) + + +(defmethod relocate ((this mh-centipede-shot) (offset int)) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (call-parent-method this offset) + ) + +(defmethod projectile-method-25 ((this mh-centipede-shot)) + (if (nonzero? (-> this trail-part)) + (push-back (-> this trail-part) (-> this root trans)) + ) + 0 + (none) + ) + +(defmethod setup-collision! ((this mh-centipede-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-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 + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> 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 init-proj-settings! ((this mh-centipede-shot)) + (with-pp + (set! (-> this attack-mode) 'eco-dark) + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 2520) 10.0) + ) + ) + (set! (-> this sound-id) (new-sound-id)) + ((method-of-type projectile init-proj-settings!) this) + 0 + (none) + ) + ) + +(defstate moving (mh-centipede-shot) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type projectile moving) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (logtest? (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + no-touch + blocked + on-water + impact-surface + touch-background + stuck + touch-ceiling-sticky + glance + probe-hit + ) + (-> self root status) + ) + (go-impact! self) + ) + ) + ) + +(defstate impact (mh-centipede-shot) + :virtual #t + :enter (behavior () + (sound-play-by-name + (static-sound-name "cent-fire-bomb") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (nest-hunt-find-sphere (-> self root trans))))) + 0 + 0 + (sound-group) + (-> self root trans) + ) + (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 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 650)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 1.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 0.333) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (ppointer->process (-> self parent))) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 10)) (not (-> self child))) + (deactivate self) + (go empty-state) + ) + ) + :code sleep-code + ) + +(deftype mh-centipede-crater-pt (structure) + ((collision-pt vector :inline) + (normal vector :inline) + (found? symbol) + (angle float) + ) + ) + + +(deftype mh-centipede-crater-pt-array (structure) + ((points mh-centipede-crater-pt 20 :inline) + (origin vector :inline) + (radius float) + (current-point int32) + ) + (:methods + (init! (_type_ vector float) none) + (mh-centipede-crater-pt-array-method-10 (_type_) none) + (mh-centipede-crater-pt-array-method-11 (_type_ process) none) + ) + ) + + +(defmethod init! ((this mh-centipede-crater-pt-array) (arg0 vector) (arg1 float)) + (set! (-> this origin quad) (-> arg0 quad)) + (set! (-> this radius) arg1) + (set! (-> this current-point) 0) + 0 + (none) + ) + +;; WARN: Function (method 10 mh-centipede-crater-pt-array) has a return type of none, but the expression builder found a return statement. +(defmethod mh-centipede-crater-pt-array-method-10 ((this mh-centipede-crater-pt-array)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (if (>= (-> this current-point) 20) + (return 0) + ) + (let ((gp-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (-> this points (-> this current-point))) + ) + (set! (-> s5-0 found?) #f) + (let* ((f0-0 3449.2632) + (f30-0 (* f0-0 (the float (-> this current-point)))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-3 (+ f30-0 (rand-vu-float-range (* -0.43 f0-0) (* 0.43 f0-0))))) + (set! (-> s5-0 angle) f0-3) + (sincos! s3-0 f0-3) + ) + (set! (-> s3-0 z) (* (-> s3-0 y) (-> this radius) (rand-vu-float-range 0.7 0.9))) + (set! (-> s3-0 y) 32768.0) + (set! (-> s3-0 x) (* (-> s3-0 x) (-> this radius) (rand-vu-float-range 0.7 0.9))) + (vector+! (-> gp-0 start-pos) (-> this origin) s3-0) + ) + (set-vector! (-> gp-0 move-dist) 0.0 -65536.0 0.0 1.0) + (let ((v1-13 gp-0)) + (set! (-> v1-13 radius) 409.6) + (set! (-> v1-13 collide-with) (collide-spec backgnd pusher)) + (set! (-> v1-13 ignore-process0) #f) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 action-mask) (collide-action solid)) + ) + (+! (-> this current-point) 1) + (let ((f0-16 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (when (>= f0-16 0.0) + (let ((a1-5 (-> s5-0 collision-pt))) + (let ((v1-19 (-> gp-0 start-pos))) + (let ((a0-15 (-> gp-0 move-dist))) + (let ((a2-0 f0-16)) + (.mov vf7 a2-0) + ) + (.lvf vf5 (&-> a0-15 quad)) + ) + (.lvf vf4 (&-> v1-19 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-5 quad) vf6) + ) + (+! (-> s5-0 collision-pt y) 204.8) + (set! (-> s5-0 found?) #t) + (vector-normalize-copy! (-> s5-0 normal) (-> gp-0 best-other-tri normal) 1.0) + (let ((s3-1 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'inline-array 'vector 4)) + ) + (vector-cross! s3-1 (-> s5-0 normal) (vector-get-unique! (new 'stack-no-clear 'vector) (-> s5-0 normal))) + (vector-normalize! s3-1 10240.0) + (set! (-> s4-1 0 quad) (-> s3-1 quad)) + (vector-cross! (-> s4-1 1) s3-1 (-> s5-0 normal)) + (vector-negate! (-> s4-1 2) s3-1) + (vector-cross! (-> s4-1 3) (-> s5-0 normal) s3-1) + (vector-float*! s3-1 (-> s5-0 normal) 3072.0) + (dotimes (v1-28 4) + (vector+! (-> s4-1 v1-28) (-> s4-1 v1-28) s3-1) + (vector+! (-> s4-1 v1-28) (-> s4-1 v1-28) (-> s5-0 collision-pt)) + ) + (vector-float*! (-> gp-0 move-dist) s3-1 -2.0) + (let ((s3-2 (new 'stack-no-clear 'collide-query))) + (let ((a1-19 (new 'stack-no-clear 'bounding-box))) + (let* ((f0-21 409.6) + (f1-9 3072.0) + (f1-11 (* f1-9 f1-9)) + (f2-0 10240.0) + (f0-22 (+ f0-21 (sqrtf (+ f1-11 (* f2-0 f2-0))))) + (v1-38 (new 'stack-no-clear 'vector)) + ) + (set-vector! v1-38 f0-22 f0-22 f0-22 1.0) + (vector+! (-> a1-19 max) (-> s5-0 collision-pt) v1-38) + (vector-! (-> a1-19 min) (-> s5-0 collision-pt) v1-38) + ) + (set! (-> s3-2 collide-with) (collide-spec backgnd pusher)) + (set! (-> s3-2 ignore-process0) #f) + (set! (-> s3-2 ignore-process1) #f) + (set! (-> s3-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> s3-2 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> s3-2 bbox)) (the-as pointer a1-19) 32) + ) + (fill-using-bounding-box *collide-cache* s3-2) + ) + (dotimes (s3-3 4) + (set! (-> gp-0 start-pos quad) (-> s4-1 s3-3 quad)) + (when (< (probe-using-line-sphere *collide-cache* gp-0) 0.0) + (set! (-> s5-0 found?) #f) + (return 0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; WARN: Function (method 11 mh-centipede-crater-pt-array) has a return type of none, but the expression builder found a return statement. +(defmethod mh-centipede-crater-pt-array-method-11 ((this mh-centipede-crater-pt-array) (arg0 process)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 x) 0.0) + (set! (-> s4-0 y) 409.6) + (set! (-> s4-0 z) 0.0) + (set! (-> s4-0 w) 1.0) + (let ((s3-0 (new 'stack-no-clear 'matrix))) + (dotimes (s2-0 4) + (+! (-> this current-point) -1) + (if (< (-> this current-point) 0) + (return 0) + ) + (let ((s1-0 (-> this points (-> this current-point)))) + (when (-> s1-0 found?) + (set! (-> s3-0 uvec quad) (-> s1-0 normal quad)) + (vector-cross! + (-> s3-0 rvec) + (-> s3-0 uvec) + (vector-! (new 'stack-no-clear 'vector) (-> s1-0 collision-pt) (-> this origin)) + ) + (vector-normalize! (-> s3-0 rvec) 1.0) + (vector-cross! (-> s3-0 fvec) (-> s3-0 rvec) (-> s3-0 uvec)) + (let ((s0-0 (matrix->quaternion (new 'stack-no-clear 'quaternion) s3-0))) + (quaternion-rotate-local-y! s0-0 s0-0 49152.0) + (quaternion->matrix s3-0 s0-0) + ) + (vector+! (-> s3-0 trans) (-> s1-0 collision-pt) s4-0) + (let ((v1-23 + (if (logtest? (-> *part-group-id-table* 643 flags) (sp-group-flag sp13)) + (part-tracker-spawn part-tracker-subsampler :to arg0 :group (-> *part-group-id-table* 643) :mat-joint s3-0) + (part-tracker-spawn part-tracker :to arg0 :group (-> *part-group-id-table* 643) :mat-joint s3-0) + ) + ) + ) + (send-event (ppointer->process v1-23) 'clock arg0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +(defskelgroup skel-mh-centipede mh-centipede mh-centipede-lod0-jg mh-centipede-idle-ja + ((mh-centipede-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 37) + :shadow mh-centipede-shadow-mg + :origin-joint-index 49 + ) + +(defskelgroup skel-mh-centipede-explode mh-centipede mh-centipede-explode-lod0-jg mh-centipede-explode-idle-ja + ((mh-centipede-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +(define *mh-centipede-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(deftype mh-centipede-anim (structure) + ((anim int32) + (speed float) + (radius float) + (vulnerable-start float) + (vulnerable-end float) + ) + ) + + +(deftype mh-centipede (process-focusable) + ((root collide-shape-moving :override) + (launch-position vector :inline) + (landing-position vector :inline) + (flags mh-centipede-flag) + (incoming-attack-id uint32) + (hit-points float) + (appearance-order int8) + (before-breach-part sparticle-launch-control) + (breach-part sparticle-launch-control) + (dirt-fall-part sparticle-launch-control) + (impact-part sparticle-launch-control) + (impact-dust-part sparticle-launch-control) + (out-of-ground-crater mh-centipede-crater-pt-array :inline) + (into-ground-crater mh-centipede-crater-pt-array :inline) + (wait-time time-frame) + (pre-breach-time time-frame) + (breach-anims (array mh-centipede-anim)) + (shoot-anims (array mh-centipede-anim)) + (current-anim mh-centipede-anim) + (nose-smack-time time-frame) + (tail-smack-time time-frame) + (timeout time-frame) + (prev-anim-frame float) + (current-target-position vector :inline) + (prev-target-position vector :inline) + (prev-time time-frame) + (rumble-sound sound-id) + (rumble-sound-playing symbol) + (ground-sound sound-id) + (ground-sound-playing symbol) + (legs-sound sound-id) + (legs-sound-playing symbol) + (minimap connection-minimap) + (mm-handle handle) + (effect-sphere sphere) + ) + (:state-methods + hidden + wait-on-minimap + wait-off-minimap + pre-breach + breach + shooting + die + test + ) + (:methods + (mh-centipede-method-36 (_type_) none) + (probe-ground (_type_ vector) symbol) + (mh-centipede-method-38 (_type_ symbol) symbol) + (mh-centipede-method-39 (_type_) symbol) + (death-explosion (_type_ int) none) + (mh-centipede-method-41 (_type_) symbol) + (fire-shot (_type_) none) + ) + ) + + +(deftype mh-centipede-minimap-dot (process-drawable) + ((parent (pointer mh-centipede) :override) + (minimap connection-minimap) + ) + (:state-methods + idle + ) + ) + + +(defstate idle (mh-centipede-minimap-dot) + :virtual #t + :enter (behavior () + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 137) (the-as int #f) (the-as vector #t) 0)) + ) + :exit (behavior () + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) + :trans (behavior () + (vector<-cspace! (-> self root trans) (-> (ppointer->process (-> self parent)) node-list data 5)) + ) + :code sleep-code + ) + +(defbehavior mh-centipede-minimap-dot-init-by-other mh-centipede-minimap-dot () + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-centipede" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (go-virtual idle) + ) + +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this mh-centipede)) + (the-as search-info-flag 120) + ) + +(defmethod get-trans ((this mh-centipede) (arg0 int)) + "Get the `trans` for this process." + (cond + ((or (= arg0 2) (= arg0 3)) + (let ((gp-0 (new 'static 'vector))) + (cond + ((logtest? (-> this flags) (mh-centipede-flag mc5)) + (set! (-> gp-0 quad) (-> this landing-position quad)) + (+! (-> gp-0 y) 8192.0) + ) + (else + (vector<-cspace! gp-0 (-> this node-list data 5)) + ) + ) + gp-0 + ) + ) + (else + ((method-of-type process-focusable get-trans) this arg0) + ) + ) + ) + +(defmethod mh-centipede-method-36 ((this mh-centipede)) + (set! (-> this effect-sphere) (nest-hunt-find-sphere (-> this root trans))) + (when (!= (-> this prev-time) (current-time)) + (set-time! (-> this prev-time)) + (set! (-> this prev-target-position quad) (-> this current-target-position quad)) + (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + ) + (nest-hunt-play-speech 1 (-> this effect-sphere)) + 0 + (none) + ) + +(defmethod probe-ground ((this mh-centipede) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (+! (-> s5-0 start-pos y) 20480.0) + (let ((v1-3 s5-0)) + (set! (-> v1-3 radius) 409.6) + (set! (-> v1-3 collide-with) (collide-spec backgnd)) + (set! (-> v1-3 ignore-process0) #f) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-7 0.0) + (let ((v1-6 (-> s5-0 start-pos))) + (let ((a0-10 (-> s5-0 move-dist))) + (let ((a1-2 f0-7)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-6 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> arg0 quad) vf6) + #t + ) + (else + #f + ) + ) + ) + ) + ) + ) + +(defmethod mh-centipede-method-38 ((this mh-centipede) (arg0 symbol)) + (local-vars (sv-288 nav-control) (sv-304 vector) (sv-320 vector) (sv-336 nav-control)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (if (and (not arg0) (< (rand-vu) 0.5)) + (set! arg0 #t) + ) + (logclear! (-> this flags) (mh-centipede-flag mc8)) + (when (nonzero? (-> this nav)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (if arg0 + (set! (-> this current-anim) (-> this shoot-anims (rand-vu-int-count (-> this shoot-anims length)))) + (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) + ) + (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) + (set! (-> s4-0 rvec quad) (-> (camera-matrix) fvec quad)) + (set! (-> s4-0 rvec y) 0.0) + (vector-normalize! (-> s4-0 rvec) 1.0) + (set! (-> s4-0 uvec quad) (-> (camera-matrix) rvec quad)) + (set! (-> s4-0 uvec y) 0.0) + (vector-normalize! (-> s4-0 uvec) 1.0) + (set! (-> s4-0 fvec quad) (-> s4-0 rvec quad)) + (vector-normalize! (-> s4-0 fvec) 327680.0) + (vector+! (-> s4-0 fvec) (-> s4-0 fvec) (target-pos 0)) + (let ((s3-3 (closest-point-on-mesh (-> this nav) (-> this landing-position) (-> s4-0 fvec) (the-as nav-poly #f))) + (s1-0 (new 'stack-no-clear 'vector)) + (s2-2 (new 'stack-no-clear 'vector)) + ) + (let ((f0-6 10240.0)) + (if (< (* f0-6 f0-6) (vector-vector-xz-distance-squared (-> s4-0 fvec) (-> this landing-position))) + (return #f) + ) + ) + (set! sv-288 (-> this nav)) + (let ((a1-7 s3-3) + (s0-0 s1-0) + ) + (let ((a3-1 s2-2) + (v1-30 (-> this landing-position)) + ) + (project-point-onto-plane-of-poly-local + (-> sv-288 state mesh) + a1-7 + s0-0 + a3-1 + (vector-! (new 'stack-no-clear 'vector) v1-30 (the-as vector (-> sv-288 state mesh bounds))) + ) + ) + (vector+! s0-0 s0-0 (the-as vector (-> sv-288 state mesh bounds))) + ) + 0 + (set! (-> this landing-position y) (-> s1-0 y)) + (when (or (probe-ground this (-> this landing-position)) (not arg0)) + (dotimes (s1-1 10) + (let ((s0-1 (-> s4-0 fvec))) + (set! sv-304 (-> s4-0 rvec)) + (set! sv-320 (-> s4-0 uvec)) + (let* ((f30-2 (- (tan 0.0))) + (v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-40 (the-as number (logior #x3f800000 v1-39))) + (f0-16 (+ f30-2 (* (+ -1.0 (the-as float v1-40)) (+ (tan 0.0) (tan 0.0))))) + ) + (.lvf vf2 (&-> sv-320 quad)) + (.lvf vf1 (&-> sv-304 quad)) + (let ((v1-44 f0-16)) + (.mov vf3 v1-44) + ) + ) + (.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 (&-> s0-1 quad) vf4) + ) + (vector-normalize! (-> s4-0 fvec) (* 3.0 (-> this current-anim radius))) + (let ((s0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (set! (-> s4-0 fvec y) 0.0) + (set! (-> s0-2 poly) s3-3) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this landing-position) (-> s0-2 poly) (-> s4-0 fvec) s0-2) + (when (not (-> s0-2 found-boundary)) + (vector+! (-> s4-0 fvec) (-> this landing-position) (-> s4-0 fvec)) + (set! sv-336 (-> this nav)) + (let ((a1-13 (-> s0-2 poly)) + (s0-3 (-> this launch-position)) + ) + (let ((a3-3 s2-2) + (v1-52 (-> s4-0 fvec)) + ) + (project-point-onto-plane-of-poly-local + (-> sv-336 state mesh) + a1-13 + s0-3 + a3-3 + (vector-! (new 'stack-no-clear 'vector) v1-52 (the-as vector (-> sv-336 state mesh bounds))) + ) + ) + (vector+! s0-3 s0-3 (the-as vector (-> sv-336 state mesh bounds))) + ) + 0 + (when (probe-ground this (-> this launch-position)) + (when arg0 + (logior! (-> this flags) (mh-centipede-flag mc8)) + (set! (-> this landing-position quad) (-> this launch-position quad)) + ) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +(defmethod mh-centipede-method-39 ((this mh-centipede)) + (local-vars (sv-288 vector)) + (logclear! (-> this flags) (mh-centipede-flag mc8)) + (when (nonzero? (-> this nav)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) + (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) + (set! (-> s5-0 rvec quad) (-> (camera-matrix) fvec quad)) + (set! (-> s5-0 rvec y) 0.0) + (vector-normalize! (-> s5-0 rvec) 1.0) + (set! (-> s5-0 uvec quad) (-> (camera-matrix) rvec quad)) + (set! (-> s5-0 uvec y) 0.0) + (vector-normalize! (-> s5-0 uvec) 1.0) + (let* ((s4-2 (-> s5-0 fvec)) + (s3-0 (-> s5-0 rvec)) + (s2-0 (-> s5-0 uvec)) + (f30-1 (- (tan 0.0))) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (vector+float*! s4-2 s3-0 s2-0 (+ f30-1 (* (+ -1.0 (the-as float v1-16)) (+ (tan 0.0) (tan 0.0))))) + ) + (vector-normalize! (-> s5-0 fvec) 409600.0) + (vector+! (-> s5-0 fvec) (-> s5-0 fvec) (camera-pos)) + (let ((s4-5 (closest-point-on-mesh (-> this nav) (-> this landing-position) (-> s5-0 fvec) (the-as nav-poly #f))) + (s2-1 (new 'stack-no-clear 'vector)) + (s3-3 (new 'stack-no-clear 'vector)) + ) + (let ((f0-12 (vector-vector-xz-distance-squared (camera-pos) (-> this landing-position))) + (f1-1 245760.0) + ) + (if (or (< f0-12 (* f1-1 f1-1)) + (let ((f0-13 (vector-vector-xz-distance-squared (target-pos 0) (-> this landing-position))) + (f1-4 245760.0) + ) + (< f0-13 (* f1-4 f1-4)) + ) + ) + (return #f) + ) + ) + (let ((s0-0 (-> this nav)) + (a1-7 s4-5) + (s1-2 s2-1) + ) + (let ((a3-1 s3-3) + (v1-27 (-> this landing-position)) + ) + (project-point-onto-plane-of-poly-local + (-> s0-0 state mesh) + a1-7 + s1-2 + a3-1 + (vector-! (new 'stack-no-clear 'vector) v1-27 (the-as vector (-> s0-0 state mesh bounds))) + ) + ) + (vector+! s1-2 s1-2 (the-as vector (-> s0-0 state mesh bounds))) + ) + 0 + (set! (-> this landing-position y) (-> s2-1 y)) + (when (probe-ground this (-> this landing-position)) + (dotimes (s2-2 10) + (let* ((s1-3 (-> s5-0 fvec)) + (s0-1 (-> s5-0 uvec)) + (f30-2 -1.0) + (f28-1 2.0) + (v1-35 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-36 (the-as number (logior #x3f800000 v1-35))) + ) + (vector-float*! s1-3 s0-1 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-36))))) + ) + (let ((s1-5 (-> s5-0 fvec)) + (s0-2 (-> s5-0 fvec)) + ) + (set! sv-288 (-> s5-0 rvec)) + (let* ((f30-3 -1.0) + (f28-2 2.0) + (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-42 (the-as number (logior #x3f800000 v1-41))) + (f0-24 (+ f30-3 (* f28-2 (+ -1.0 (the-as float v1-42))))) + ) + (vector+float*! s1-5 s0-2 sv-288 f0-24) + ) + ) + (vector-normalize! (-> s5-0 fvec) (* 3.0 (-> this current-anim radius))) + (let ((s1-7 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (set! (-> s1-7 poly) s4-5) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this landing-position) (-> s1-7 poly) (-> s5-0 fvec) s1-7) + (when (not (-> s1-7 found-boundary)) + (vector+! (-> s5-0 fvec) (-> this landing-position) (-> s5-0 fvec)) + (let ((s0-3 (-> this nav)) + (a1-13 (-> s1-7 poly)) + (s1-8 (-> this launch-position)) + ) + (let ((a3-3 s3-3) + (v1-51 (-> s5-0 fvec)) + ) + (project-point-onto-plane-of-poly-local + (-> s0-3 state mesh) + a1-13 + s1-8 + a3-3 + (vector-! (new 'stack-no-clear 'vector) v1-51 (the-as vector (-> s0-3 state mesh bounds))) + ) + ) + (vector+! s1-8 s1-8 (the-as vector (-> s0-3 state mesh bounds))) + ) + 0 + (if (probe-ground this (-> this launch-position)) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +(defmethod death-explosion ((this mh-centipede) (arg0 int)) + (local-vars + (sv-848 process) + (sv-864 + (function skeleton-group int joint-exploder-tuning joint-exploder-static-params object :behavior joint-exploder) + ) + ) + (let ((s4-0 (get-field-spec-by-id (-> *part-id-table* 2512) (sp-field-id spt-omega))) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (let* ((v1-2 s5-0) + (a3-0 (-> this node-list data arg0 bone transform)) + (a0-5 (-> a3-0 rvec quad)) + (a1-3 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-2 rvec quad) a0-5) + (set! (-> v1-2 uvec quad) a1-3) + (set! (-> v1-2 fvec quad) a2-0) + (set! (-> v1-2 trans quad) a3-1) + ) + (vector<-cspace! (-> s5-0 trans) (-> this node-list data arg0)) + (cond + (s4-0 + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> s5-0 trans quad)) + (vector-float*! (-> s3-1 move-dist) (-> this root dynam gravity-normal) -163840.0) + (let ((v1-8 s3-1)) + (set! (-> v1-8 radius) 1228.8) + (set! (-> v1-8 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) + (set! (-> v1-8 ignore-process0) this) + (set! (-> v1-8 ignore-process1) #f) + (set! (-> v1-8 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-8 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* s3-1))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 trans) + (meters 0.2) + (new 'static 'rgba :r #x40 :g #xff :b #xff :a #x80) + ) + (cond + ((>= f30-0 0.0) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s3-1 best-other-tri intersect) + (meters 0.3) + (new 'static 'rgba :r #x40 :g #xff :b #xff :a #x80) + ) + (set! (-> s4-0 initial-valuef) + (fmin (+ 819.2 (-> s3-1 best-other-tri intersect y)) (+ -1228.8 (-> s5-0 trans y))) + ) + ) + (else + (set! (-> s4-0 initial-valuef) (+ -81920.0 (-> s5-0 trans y))) + ) + ) + ) + ) + ) + (else + (format 0 "no spec for mh-centipede death particle~%") + ) + ) + (let ((v1-22 + (if (logtest? (-> *part-group-id-table* 647 flags) (sp-group-flag sp13)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 647) :mat-joint s5-0) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 647) :mat-joint s5-0) + ) + ) + ) + (send-event (ppointer->process v1-22) 'clock this) + ) + (let ((s2-0 (new 'stack 'joint-exploder-tuning (the-as uint 0))) + (s1-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> this root quat))) + (s4-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-3 quad) (-> this root trans quad)) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> this root scale quad)) + (set! (-> this root trans quad) (-> s5-0 trans quad)) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000 0))) + (when s5-1 + (let ((t9-16 (method-of-type joint-exploder activate))) + (t9-16 (the-as joint-exploder s5-1) this "joint-exploder" (the-as pointer #x70004000)) + ) + (let ((s0-0 run-function-in-process)) + (set! sv-848 s5-1) + (set! sv-864 joint-exploder-init-by-other) + (let ((a2-16 (art-group-get-by-name *level* "skel-mh-centipede-explode" (the-as (pointer level) #f))) + (a3-10 10) + (t1-0 *mh-centipede-exploder-params*) + ) + ((the-as (function object object object object object object none) s0-0) sv-848 sv-864 a2-16 a3-10 s2-0 t1-0) + ) + ) + (-> s5-1 ppointer) + ) + ) + (quaternion-copy! (-> this root quat) s1-0) + (set! (-> this root trans quad) (-> s4-3 quad)) + (set! (-> this root scale quad) (-> s3-2 quad)) + ) + ) + ) + 0 + (none) + ) + +;; WARN: Return type mismatch symbol vs object. +(defbehavior mh-centipede-active-handler mh-centipede ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v1-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (case arg2 + (('touched) + (let ((s4-0 (the-as touching-shapes-entry (-> arg3 param 0)))) + (cond + ((not s4-0) + ) + ((type? arg0 vehicle) + (when (not (logtest? (-> self flags) (mh-centipede-flag mc6))) + (let ((s2-0 (-> s4-0 head))) + (when s2-0 + (let ((s3-0 (get-touched-prim s2-0 (-> self root) s4-0)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (when s3-0 + (get-intersect-point s5-1 s2-0 (-> self root) s4-0) + (vector-! s5-1 s5-1 (the-as vector (-> s3-0 prim-core))) + (set! (-> s5-1 y) 0.0) + (.lvf vf1 (&-> s5-1 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-13 vf1) + (let ((f0-1 v1-13) + (f1-0 1.0) + ) + (if (< f0-1 (* f1-0 f1-0)) + (set! (-> s5-1 x) 1.0) + ) + ) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 y) 0.1) + (when (send-event arg0 'attack #f (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) + (damage 4.0) + (vehicle-damage-factor 0.8325) + (vehicle-impulse-factor (* 1.25 (-> (the-as vehicle arg0) info info mass))) + (shield-damage 1.0) + (knock (knocked-type dark-shot)) + (attacker-velocity s5-1) + ) + ) + ) + ) + (logior! (-> self flags) (mh-centipede-flag mc6)) + (nest-hunt-play-speech 5 (-> self effect-sphere)) + ) + ) + ) + ) + ) + ) + ((prims-touching? s4-0 (-> self root) (the-as uint -1)) + (if (send-event + (if (type? arg0 process-focusable) + arg0 + ) + 'attack + (-> arg3 param 0) + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 4.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (knock (knocked-type dark-shot)) + ) + ) + ) + (nest-hunt-play-speech 5 (-> self effect-sphere)) + ) + ) + ) + ) + #t + ) + (('attack) + (if (type? arg0 vehicle) + (return (the-as object #f)) + ) + (if (or (< (ja-aframe-num 0) (-> self current-anim vulnerable-start)) + (< (-> self current-anim vulnerable-end) (ja-aframe-num 0)) + ) + (return (the-as object #f)) + ) + (let ((f0-14 1.0) + (v1-50 (the-as attack-info (-> arg3 param 1))) + ) + (when (or (not (logtest? (-> v1-50 mask) (attack-mask id))) (!= (-> self incoming-attack-id) (-> v1-50 id))) + (if (logtest? (-> v1-50 mask) (attack-mask id)) + (set! (-> self incoming-attack-id) (-> v1-50 id)) + ) + (if (logtest? (attack-mask damage) (-> v1-50 mask)) + (set! f0-14 (-> v1-50 damage)) + ) + (if (and (-> self next-state) (= (-> self next-state name) 'shooting)) + (set! f0-14 (* 0.5 f0-14)) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! f0-14 (* 0.6666667 f0-14)) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f0-14))) + (set! (-> *game-info* health-bar) (-> self hit-points)) + (cond + ((= (-> self hit-points) 0.0) + (go-virtual die) + ) + ((= f0-14 0.0) + ) + ((< (-> self hit-points) 20.0) + (nest-hunt-play-speech 3 (-> self effect-sphere)) + ) + (else + (nest-hunt-play-speech 2 (-> self effect-sphere)) + ) + ) + ) + ) + #t + ) + ) + ) + ) + +(defmethod mh-centipede-method-41 ((this mh-centipede)) + (and (task-node-closed? (game-task-node nest-hunt-introduction)) + (> (-> this appearance-order) 0) + (= (-> this appearance-order) (the int (-> *game-info* counter))) + ) + ) + +(defmethod fire-shot ((this mh-centipede)) + (local-vars (sv-192 sound-id)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> (target-pos 0) quad)) + (vector<-cspace! s3-0 (-> this node-list data 77)) + (let ((s1-0 sound-play-by-name) + (sname (static-sound-name "cent-fire-spit")) + ) + (set! sv-192 (new-sound-id)) + (let ((a2-0 (the int (* 1024.0 (nest-hunt-volume (-> this effect-sphere))))) + (a3-0 0) + (t0-0 0) + (t1-0 0) + (t2-0 s3-0) + ) + (s1-0 (the-as sound-name sname) sv-192 a2-0 a3-0 t0-0 (the-as sound-group t1-0) t2-0) + ) + ) + (vector-! s4-0 (-> this current-target-position) (-> this prev-target-position)) + (set! (-> s4-0 y) 0.0) + (let* ((f30-1 (vector-length s4-0)) + (s1-1 s4-0) + (s0-1 s4-0) + (f28-0 (lerp-scale 20480.0 81920.0 f30-1 0.0 4505.6)) + (f26-0 20480.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (vector-float*! s1-1 s0-1 (/ (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-10)))) f30-1)) + ) + (vector+! s2-0 s2-0 s4-0) + (let* ((f30-2 (-> s2-0 y)) + (f28-1 -16384.0) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> s2-0 y) (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-15))))) + ) + (vector-! s4-0 s2-0 s3-0) + ) + (vector-normalize! s4-0 (* 36864.0 (-> pp clock frames-per-second))) + (set! (-> gp-0 ent) (-> this entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> s3-0 quad)) + (set! (-> gp-0 vel quad) (-> s4-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 handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle this)) + (let* ((v1-30 *game-info*) + (a0-27 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-27) + (set! (-> gp-0 attack-id) a0-27) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 3.33) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-impulse-factor) (* 0.3003003 (-> pp clock frames-per-second))) + (logior! (-> gp-0 options) (projectile-options po16)) + (spawn-projectile mh-centipede-shot gp-0 (ppointer->process (-> this parent)) *default-dead-pool*) + ) + 0 + (none) + ) + ) + +(defstate hidden (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (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 + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (when (and (time-elapsed? (-> self state-time) (seconds 0.1)) (mh-centipede-method-41 self)) + (set! (-> *game-info* health-bar-owner) (process->handle self)) + (set! (-> *game-info* health-bar) (-> self hit-points)) + (go-virtual wait-off-minimap) + ) + ) + :code sleep-code + ) + +(defstate wait-on-minimap (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set-time! (-> self timeout)) + (set! (-> self wait-time) (the-as time-frame (the int (* 900.0 (you-suck-scale *game-info* #f 0))))) + (vector<-cspace! (-> self root trans) (joint-node mh-centipede-lod0-jg head)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-14 (-> self root root-prim))) + (set! (-> v1-14 prim-core collide-as) (collide-spec)) + (set! (-> v1-14 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 138) (the-as int #f) (the-as vector #t) 0)) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (when (time-elapsed? (-> self state-time) (-> self wait-time)) + (if (or (mh-centipede-method-38 self #f) (mh-centipede-method-38 self #t)) + (go-virtual wait-off-minimap) + (set! (-> self state-time) (-> self state-time)) + ) + ) + (when (time-elapsed? (-> self timeout) (seconds 15)) + (if (mh-centipede-method-39 self) + (go-virtual wait-off-minimap) + (set! (-> self timeout) (-> self timeout)) + ) + ) + ) + :code sleep-code + ) + +(defstate wait-off-minimap (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self wait-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-10 (-> self root root-prim))) + (set! (-> v1-10 prim-core collide-as) (collide-spec)) + (set! (-> v1-10 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (when (time-elapsed? (-> self state-time) (-> self wait-time)) + (if (or (mh-centipede-method-38 self #f) (mh-centipede-method-38 self #t) (mh-centipede-method-39 self)) + (go-virtual pre-breach) + (set! (-> self state-time) (-> self state-time)) + ) + ) + ) + :code sleep-code + ) + +(defstate pre-breach (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (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 + (let* ((gp-0 lerp-scale) + (s5-0 819.2) + (s4-0 0.0) + (a2-0 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-0 204800.0) + (a3-0 (* f0-0 f0-0)) + (f0-2 2048000.0) + (f0-5 (* (gp-0 s5-0 s4-0 a2-0 a3-0 (* f0-2 f0-2)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (activate! *camera-smush-control* f0-5 37 600 1.0 1.1 (-> *display* camera-clock)) + ) + (init! (-> self out-of-ground-crater) (-> self launch-position) 32768.0) + (init! (-> self into-ground-crater) (-> self landing-position) 32768.0) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (cond + ((not (time-elapsed? (-> self state-time) (-> self pre-breach-time))) + ) + ((logtest? (-> self flags) (mh-centipede-flag mc8)) + (go-virtual shooting) + ) + (else + (go-virtual breach) + ) + ) + (let ((f30-0 (/ (the float (- (current-time) (-> self state-time))) (the float (-> self pre-breach-time))))) + (sound-play-by-name + (static-sound-name "cent-rumble") + (-> self rumble-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (set! (-> self rumble-sound-playing) #t) + (let ((f30-1 (* f30-0 f30-0))) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int (* 1024.0 (* f30-1 (nest-hunt-volume (-> self effect-sphere))))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + ) + ) + (set! (-> self ground-sound-playing) #t) + (if (nonzero? (-> self before-breach-part)) + (spawn (-> self before-breach-part) (-> self launch-position)) + ) + (dotimes (gp-2 2) + (mh-centipede-crater-pt-array-method-10 (-> self out-of-ground-crater)) + (mh-centipede-crater-pt-array-method-10 (-> self into-ground-crater)) + ) + ) + :code sleep-code + ) + +(defstate breach (mh-centipede) + :virtual #t + :event mh-centipede-active-handler + :enter (behavior () + (nest-hunt-play-speech 0 (-> self effect-sphere)) + (set-time! (-> self state-time)) + (set! (-> self root trans quad) (-> self launch-position quad)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self landing-position) (-> self launch-position)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + ) + (quaternion-normalize! (-> self root quat)) + (let* ((gp-2 lerp-scale) + (s5-0 1638.4) + (s4-0 0.0) + (a2-1 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-4 204800.0) + (a3-1 (* f0-4 f0-4)) + (f0-6 2048000.0) + (f30-1 (* (gp-2 s5-0 s4-0 a2-1 a3-1 (* f0-6 f0-6)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-1 75 900 1.1 1.07 (-> *display* camera-clock)) + ) + (logclear! (-> self flags) (mh-centipede-flag mc0 mc1 mc2 mc3 mc4 mc5 mc6)) + (ja-channel-push! 1 0) + (ja :group! (-> self draw art-group data (-> self current-anim anim)) :num! min) + (set! (-> self mm-handle) + (ppointer->handle (process-spawn mh-centipede-minimap-dot :name "mh-centipede-minimap-dot" :to self)) + ) + ) + :exit (behavior () + (let ((a0-1 (handle->process (-> self mm-handle)))) + (when a0-1 + (deactivate a0-1) + (set! (-> self mm-handle) (the-as handle #f)) + ) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (ja :num! (seek! max (-> self current-anim speed))) + (if (ja-done? 0) + (go-virtual wait-on-minimap) + ) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc0))) + (when (nonzero? (-> self breach-part)) + (let ((f30-0 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) + (lerp-scale f30-0 (* 0.1 f30-0) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + ) + (spawn (-> self breach-part) (-> self launch-position)) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-0) + ) + ) + (mh-centipede-crater-pt-array-method-11 (-> self out-of-ground-crater) self) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg tail3)) y) + (-> self launch-position y) + ) + (logior! (-> self flags) (mh-centipede-flag mc0)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc1))) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg tail3)) y) + (+ 8192.0 (-> self landing-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc1)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc2))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg tail3)) y) + (-> self landing-position y) + ) + (set-time! (-> self tail-smack-time)) + (logior! (-> self flags) (mh-centipede-flag mc2)) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + ) + ) + (else + ) + ) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc3))) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (when (>= (-> gp-0 y) (+ -12288.0 (-> self launch-position y))) + (logior! (-> self flags) (mh-centipede-flag mc3)) + (sound-play-by-name + (static-sound-name "cent-out") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-0 + ) + (set! (-> self legs-sound-playing) #t) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc4))) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-1 + ) + (set! (-> self legs-sound-playing) #t) + (if (< (+ 14336.0 (-> self launch-position y)) (-> gp-1 y)) + (logior! (-> self flags) (mh-centipede-flag mc4)) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc5))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 12288.0 (-> self launch-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc5)) + (set-time! (-> self nose-smack-time)) + (sound-play-by-name + (static-sound-name "cent-in") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (sound-play-by-name + (static-sound-name "cent-rumble") + (-> self rumble-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self rumble-sound-playing) #t) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + (let* ((gp-5 lerp-scale) + (s5-6 1638.4) + (s4-6 0.0) + (a2-9 (vector-vector-distance-squared (-> self landing-position) (target-pos 0))) + (f0-33 204800.0) + (a3-7 (* f0-33 f0-33)) + (f0-35 2048000.0) + (f30-8 (* (gp-5 s5-6 s4-6 a2-9 a3-7 (* f0-35 f0-35)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-8 60 600 0.995 1.07 (-> *display* camera-clock)) + ) + ) + ) + (else + (when (-> self legs-sound-playing) + (sound-stop (-> self legs-sound)) + (set! (-> self legs-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int + (* 1024.0 (* (nest-hunt-volume (-> self effect-sphere)) + (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self nose-smack-time))) 0.0 600.0) + ) + ) + ) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + ) + (mh-centipede-crater-pt-array-method-11 (-> self into-ground-crater) self) + (when (and (nonzero? (-> self impact-part)) (not (logtest? (-> self flags) (mh-centipede-flag mc2)))) + (let ((f30-10 (-> *part-id-table* 2507 init-specs 2 initial-valuef)) + (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) + ) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) + (lerp-scale f30-10 (* 0.05 f30-10) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + ) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) + (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) + ) + (spawn (-> self impact-part) (-> self landing-position)) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) f30-10) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) f28-1) + ) + ) + (if (and (nonzero? (-> self impact-dust-part)) + (logtest? (-> self flags) (mh-centipede-flag mc2)) + (not (time-elapsed? (-> self tail-smack-time) (seconds 0.2))) + ) + (spawn (-> self impact-dust-part) (-> self landing-position)) + ) + ) + ) + (when (nonzero? (-> self dirt-fall-part)) + (let ((gp-7 (new 'static 'boxed-array :type uint8 + #xb + #xe + #x1c + #x24 + #x2c + #x34 + #x3c + #x44 + #x11 + #x14 + #x1f + #x27 + #x2f + #x37 + #x3f + #x47 + ) + ) + (s5-8 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-8 3) + (vector<-cspace! + s5-8 + (-> self node-list data (-> gp-7 (mod (the-as int (rand-uint31-gen *random-generator*)) (-> gp-7 length)))) + ) + (spawn (-> self dirt-fall-part) s5-8) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate shooting (mh-centipede) + :virtual #t + :event mh-centipede-active-handler + :enter (behavior () + (nest-hunt-play-speech 0 (-> self effect-sphere)) + (set-time! (-> self state-time)) + (set! (-> self root trans quad) (-> self launch-position quad)) + (let* ((gp-0 lerp-scale) + (s5-0 1638.4) + (s4-0 0.0) + (a2-0 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-0 204800.0) + (a3-0 (* f0-0 f0-0)) + (f0-2 2048000.0) + (f30-1 (* (gp-0 s5-0 s4-0 a2-0 a3-0 (* f0-2 f0-2)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-1 75 900 1.1 1.07 (-> *display* camera-clock)) + ) + (logclear! (-> self flags) (mh-centipede-flag mc0 mc1 mc2 mc3 mc4 mc5 mc6)) + (ja-channel-push! 1 0) + (ja :group! (-> self draw art-group data (-> self current-anim anim)) :num! min) + (set! (-> self prev-anim-frame) (ja-aframe-num 0)) + (set! (-> self mm-handle) + (ppointer->handle (process-spawn mh-centipede-minimap-dot :name "mh-centipede-minimap-dot" :to self)) + ) + ) + :exit (behavior () + (let ((a0-1 (handle->process (-> self mm-handle)))) + (when a0-1 + (deactivate a0-1) + (set! (-> self mm-handle) (the-as handle #f)) + ) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (ja :num! (seek! max (-> self current-anim speed))) + (let ((f30-0 (ja-aframe-num 0))) + (if (or (and (< (-> self prev-anim-frame) 25.0) (>= f30-0 25.0)) + (and (< (-> self prev-anim-frame) 35.0) (>= f30-0 35.0)) + (and (< (-> self prev-anim-frame) 40.0) (>= f30-0 40.0)) + ) + (fire-shot self) + ) + (set! (-> self prev-anim-frame) f30-0) + ) + (if (ja-done? 0) + (go-virtual wait-on-minimap) + ) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self launch-position)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + ) + (quaternion-normalize! (-> self root quat)) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc0))) + (when (nonzero? (-> self breach-part)) + (let ((f30-1 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) + (lerp-scale f30-1 (* 0.1 f30-1) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + ) + (spawn (-> self breach-part) (-> self launch-position)) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-1) + ) + ) + (mh-centipede-crater-pt-array-method-11 (-> self out-of-ground-crater) self) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 16384.0 (-> self launch-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc0)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc1))) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 8192.0 (-> self landing-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc1)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc2))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (-> self landing-position y) + ) + (set-time! (-> self tail-smack-time)) + (logior! (-> self flags) (mh-centipede-flag mc2)) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + ) + ) + ) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc3))) + (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (when (>= (-> gp-2 y) (+ -12288.0 (-> self launch-position y))) + (logior! (-> self flags) (mh-centipede-flag mc3)) + (sound-play-by-name + (static-sound-name "cent-out") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-2 + ) + (set! (-> self legs-sound-playing) #t) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc4))) + (let ((gp-3 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-3 + ) + (set! (-> self legs-sound-playing) #t) + (if (< (+ 14336.0 (-> self launch-position y)) (-> gp-3 y)) + (logior! (-> self flags) (mh-centipede-flag mc4)) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc5))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 12288.0 (-> self launch-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc5)) + (set-time! (-> self nose-smack-time)) + (sound-play-by-name + (static-sound-name "cent-in") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (sound-play-by-name + (static-sound-name "cent-rumble") + (-> self rumble-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self rumble-sound-playing) #t) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + (let* ((gp-7 lerp-scale) + (s5-6 1638.4) + (s4-6 0.0) + (a2-10 (vector-vector-distance-squared (-> self landing-position) (target-pos 0))) + (f0-43 204800.0) + (a3-8 (* f0-43 f0-43)) + (f0-45 2048000.0) + (f30-9 (* (gp-7 s5-6 s4-6 a2-10 a3-8 (* f0-45 f0-45)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-9 60 600 0.995 1.07 (-> *display* camera-clock)) + ) + ) + ) + (else + (when (-> self legs-sound-playing) + (sound-stop (-> self legs-sound)) + (set! (-> self legs-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int + (* 1024.0 (* (nest-hunt-volume (-> self effect-sphere)) + (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self nose-smack-time))) 0.0 600.0) + ) + ) + ) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + ) + (mh-centipede-crater-pt-array-method-11 (-> self into-ground-crater) self) + (when (and (nonzero? (-> self impact-part)) (not (logtest? (-> self flags) (mh-centipede-flag mc2)))) + (let ((f30-11 (-> *part-id-table* 2507 init-specs 2 initial-valuef)) + (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) + ) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) + (lerp-scale f30-11 (* 0.05 f30-11) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + ) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) + (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) + ) + (spawn (-> self impact-part) (-> self landing-position)) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) f30-11) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) f28-1) + ) + ) + (if (and (nonzero? (-> self impact-dust-part)) + (logtest? (-> self flags) (mh-centipede-flag mc2)) + (not (time-elapsed? (-> self tail-smack-time) (seconds 0.2))) + ) + (spawn (-> self impact-dust-part) (-> self landing-position)) + ) + ) + ) + (when (nonzero? (-> self dirt-fall-part)) + (let ((gp-9 (new 'static 'boxed-array :type uint8 + #xb + #xe + #x1c + #x24 + #x2c + #x34 + #x3c + #x44 + #x11 + #x14 + #x1f + #x27 + #x2f + #x37 + #x3f + #x47 + ) + ) + (s5-8 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-8 3) + (vector<-cspace! + s5-8 + (-> self node-list data (-> gp-9 (mod (the-as int (rand-uint31-gen *random-generator*)) (-> gp-9 length)))) + ) + (spawn (-> self dirt-fall-part) s5-8) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defstate die (mh-centipede) + :virtual #t + :enter (behavior () + (let* ((v1-2 (-> *game-info* sub-task-list (game-task-node nest-hunt-fight))) + (a0-2 (handle->process (if (-> v1-2 manager) + (-> v1-2 manager manager) + (the-as handle #f) + ) + ) + ) + ) + (if a0-2 + (send-event a0-2 'centipede-died (-> self launch-position)) + ) + ) + (set-time! (-> self state-time)) + (let* ((gp-0 lerp-scale) + (s5-0 1638.4) + (s4-0 0.0) + (a2-1 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-0 204800.0) + (a3-0 (* f0-0 f0-0)) + (f0-2 2048000.0) + (f30-1 (* (gp-0 s5-0 s4-0 a2-1 a3-0 (* f0-2 f0-2)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-1 75 900 1.1 1.07 (-> *display* camera-clock)) + ) + (if (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + ) + (if (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + ) + (if (-> self legs-sound-playing) + (sound-stop (-> self legs-sound)) + ) + (let ((v1-32 (-> self root root-prim))) + (set! (-> v1-32 prim-core collide-as) (collide-spec)) + (set! (-> v1-32 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (death-explosion self 5) + (death-explosion self 25) + (death-explosion self 33) + (death-explosion self 41) + (death-explosion self 49) + (death-explosion self 57) + (death-explosion self 65) + (sound-play-by-name + (static-sound-name "cent-out") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (nest-hunt-play-speech 4 (-> self effect-sphere)) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (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) 'get-vehicle) + (let ((a0-3 (the-as vehicle (send-event-function *target* a1-0)))) + (if a0-3 + (vehicle-method-106 a0-3) + ) + ) + ) + (when (and (time-elapsed? (-> self state-time) (seconds 1)) (not (-> self child))) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + (deactivate self) + ) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + ) + (when *camera* + (let ((s5-0 (-> *camera* slave))) + (when s5-0 + (new 'stack-no-clear 'vector) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! gp-0 (joint-node mh-centipede-lod0-jg mouth)) + (set! (-> gp-0 y) (fmax (-> gp-0 y) (+ 16384.0 (-> self landing-position y)))) + (vector-! gp-0 gp-0 (-> s5-0 0 trans)) + (vector-normalize! gp-0 1.0) + (forward-down->inv-matrix (the-as matrix (-> s5-0 0 tracking)) gp-0 (new 'static 'vector :y -1.0)) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +(defstate test (mh-centipede) + :virtual #t + :enter (behavior () + (ja :group! mh-centipede-breach-2-ja :num! min) + (set-time! (-> self state-time)) + (set! (-> self root trans y) (-> self entity extra trans y)) + (set! (-> self draw shadow-ctrl) *mh-centipede-shadow-control*) + (logclear! (-> self flags) (mh-centipede-flag mc7)) + (when (!= (-> self entity) (entity-by-name "mh-centipede-7")) + (cleanup-for-death self) + (deactivate self) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-hold? 1 x)) + (go-virtual test) + ) + (when (not (logtest? (-> self flags) (mh-centipede-flag mc7))) + (when (mh-centipede-method-38 self #f) + (ja :group! mh-centipede-shoot-ja :num! min) + (set! (-> self root trans quad) (-> self launch-position quad)) + (logior! (-> self flags) (mh-centipede-flag mc7)) + ) + ) + (ja :num! (loop! 0.125)) + (format *stdebug* "frame ~f~%" (ja-aframe-num 0)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +(defmethod deactivate ((this mh-centipede)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this before-breach-part)) + (kill-particles (-> this before-breach-part)) + ) + (if (nonzero? (-> this breach-part)) + (kill-particles (-> this breach-part)) + ) + (if (nonzero? (-> this dirt-fall-part)) + (kill-particles (-> this dirt-fall-part)) + ) + (if (nonzero? (-> this impact-part)) + (kill-particles (-> this impact-part)) + ) + (if (nonzero? (-> this impact-dust-part)) + (kill-particles (-> this impact-dust-part)) + ) + (if (-> this rumble-sound-playing) + (sound-stop (-> this rumble-sound)) + ) + (if (-> this ground-sound-playing) + (sound-stop (-> this ground-sound)) + ) + (if (-> this legs-sound-playing) + (sound-stop (-> this legs-sound)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch process-focusable vs mh-centipede. +(defmethod relocate ((this mh-centipede) (offset int)) + (if (nonzero? (-> this before-breach-part)) + (&+! (-> this before-breach-part) offset) + ) + (if (nonzero? (-> this breach-part)) + (&+! (-> this breach-part) offset) + ) + (if (nonzero? (-> this dirt-fall-part)) + (&+! (-> this dirt-fall-part) offset) + ) + (if (nonzero? (-> this impact-part)) + (&+! (-> this impact-part) offset) + ) + (if (nonzero? (-> this impact-dust-part)) + (&+! (-> this impact-dust-part) offset) + ) + (the-as mh-centipede ((method-of-type process-focusable relocate) this offset)) + ) + +;; WARN: Return type mismatch int vs object. +(defmethod init-from-entity! ((this mh-centipede) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) + (set! (-> s4-0 total-prims) (the-as uint 9)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> s3-0 transform-index) 34) + (set-vector! (-> s3-0 local-sphere) -3.6864002 0.0 -98.304 118246.195) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-14 transform-index) 5) + (set-vector! (-> v1-14 local-sphere) 46.6944 -7090.1763 -374.784 21871.41) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 1105.92 -20860.11 45.4656 34929.87) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-18 transform-index) 26) + (set-vector! (-> v1-18 local-sphere) -1062.912 -10449.715 11.0592 37866.7) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-20 transform-index) 34) + (set-vector! (-> v1-20 local-sphere) -366.1824 -3607.7568 3.6864002 34341.273) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-22 transform-index) 42) + (set-vector! (-> v1-22 local-sphere) 889.65125 -8613.888 -138.8544 33735.477) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-24 transform-index) 50) + (set-vector! (-> v1-24 local-sphere) -471.85922 -7038.5664 -77.4144 30895.719) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-26 transform-index) 58) + (set-vector! (-> v1-26 local-sphere) -305.9712 -4273.766 4158.2593 24832.82) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-28 transform-index) 66) + (set-vector! (-> v1-28 local-sphere) -1778.0737 -7170.0483 -785.20325 21710.44) + ) + (set! (-> s4-0 nav-radius) 81920.0) + (let ((v1-30 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-centipede" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (set! (-> this root pause-adjust-distance) 409600.0) + (let ((s4-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) + (when s4-2 + (change-to s4-2 this) + (set! (-> this root trans quad) (-> s4-2 bounds quad)) + (if (nonzero? (-> this nav)) + (closest-point-on-mesh (-> this nav) (-> this root trans) (-> this root trans) (the-as nav-poly #f)) + ) + ) + ) + (set! (-> this flags) (mh-centipede-flag)) + (set! (-> this incoming-attack-id) (the-as uint 0)) + (set! (-> this hit-points) 100.0) + (set! (-> this before-breach-part) (create-launch-control (-> *part-group-id-table* 641) this)) + (set! (-> this breach-part) (create-launch-control (-> *part-group-id-table* 642) this)) + (set! (-> this dirt-fall-part) (create-launch-control (-> *part-group-id-table* 644) this)) + (set! (-> this impact-part) (create-launch-control (-> *part-group-id-table* 645) this)) + (set! (-> this impact-dust-part) (create-launch-control (-> *part-group-id-table* 646) this)) + (set! (-> this breach-anims) + (new 'static 'boxed-array :type mh-centipede-anim + (new 'static 'mh-centipede-anim + :anim 5 + :speed 0.25 + :radius 63078.4 + :vulnerable-start 13.0 + :vulnerable-end 30.0 + ) + (new 'static 'mh-centipede-anim + :anim 6 + :speed 0.15 + :radius 63488.0 + :vulnerable-start 10.0 + :vulnerable-end 30.0 + ) + ) + ) + (set! (-> this shoot-anims) + (new 'static 'boxed-array :type mh-centipede-anim (new 'static 'mh-centipede-anim + :anim 7 + :speed 0.25 + :radius 73728.0 + :vulnerable-start 13.0 + :vulnerable-end 48.0 + ) + ) + ) + (set! (-> this current-anim) (-> this breach-anims 0)) + (set! (-> this appearance-order) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-74 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-74 (nonzero? (-> sv-16 elt-count))) + (let ((v1-75 (-> v1-74 0))) + (set! (-> this appearance-order) (-> v1-75 length)) + (dotimes (a0-78 (-> v1-75 length)) + (when (= arg0 (-> v1-75 data a0-78 actor)) + 0 + (goto cfg-14) + ) + (+! (-> this appearance-order) -1) + ) + ) + (format 0 "ERROR: could not find self in actor-group for ~S~%" (-> this name)) + (label cfg-14) + ) + (else + (format 0 "ERROR: could not find actor-group for ~S~%" (-> this name)) + ) + ) + ) + (set! (-> this rumble-sound) (new-sound-id)) + (set! (-> this rumble-sound-playing) #f) + (set! (-> this ground-sound) (new-sound-id)) + (set! (-> this ground-sound-playing) #f) + (set! (-> this legs-sound) (new-sound-id)) + (set! (-> this legs-sound-playing) #f) + (set! (-> this draw shadow-ctrl) *mh-centipede-shadow-control*) + (set! (-> this minimap) #f) + (set! (-> this mm-handle) (the-as handle #f)) + (set-time! (-> this prev-time)) + (set! (-> this prev-target-position quad) (-> (target-pos 0) quad)) + (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + (set! (-> this effect-sphere) #f) + (go (method-of-object this hidden)) + 0 + ) + +(defmethod draw ((this hud-mh-centipede)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 452.0 (* 130.0 (-> this offset)))) + 130 + ) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 0 37) + (set! (-> this sprites 4 scale-x) (* 0.164 (the float (-> this values 1 current)))) + (cond + ((< 75 (-> this values 1 current)) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ((< 50 (-> this values 1 current)) + (set! (-> this sprites 4 color x) + (the int (lerp-scale 0.0 128.0 (the float (-> this values 1 current)) 75.0 50.0)) + ) + (set! (-> this sprites 4 color y) + (the int (lerp-scale 255.0 128.0 (the float (-> this values 1 current)) 75.0 50.0)) + ) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ((< 25 (-> this values 1 current)) + (set! (-> this sprites 4 color x) + (the int (lerp-scale 128.0 255.0 (the float (-> this values 1 current)) 50.0 25.0)) + ) + (set! (-> this sprites 4 color y) + (the int (lerp-scale 128.0 0.0 (the float (-> this values 1 current)) 50.0 25.0)) + ) + (set! (-> this sprites 4 color z) 0) + 0 + ) + (else + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) 1 36) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) -59 36) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -4 36) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 5 15) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this hud-mh-centipede)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + (cond + ((handle->process (-> *game-info* health-bar-owner)) + (set! (-> this values 1 target) (the int (-> *game-info* health-bar))) + ) + (else + (set! (-> this values 1 target) 0) + 0 + ) + ) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this hud-mh-centipede)) + (set! (-> this level) (level-get *level* 'nsta)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-mhcentipede-01 lnstobb-minimap))) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 4 tid) (the-as texture-id (get-texture hud-mhcentipede-meter-01 lnstobb-minimap))) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 1.3) + (set! (-> this sprites 4 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 3 tid) (the-as texture-id (get-texture hud-small-frame-01 lnstobb-minimap))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 flags) (hud-sprite-flags hsf0 hsf2)) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-small-frame-01 lnstobb-minimap))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set! (-> this sprites 2 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-small-frame-02 lnstobb-minimap))) + (set! (-> this sprites 1 scale-x) 14.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set! (-> this sprites 1 flags) (hud-sprite-flags hsf2)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags shadow kerning large)) + 0 + (none) + ) + +(deftype task-manager-mh-centipede (task-manager) + ((vehicle-handle handle) + (manager-entity entity-actor) + (check-timer time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (last-centipede-position vector :inline) + (last-target-position vector :inline) + ) + (:methods + (init-actor-group! (_type_) none) + ) + ) + + +(defstate active (task-manager-mh-centipede) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self check-timer) 0) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + ) + :exit (behavior () + (remove-setting! 'pilot-exit) + (remove-setting! 'pilot-death) + ) + :code (behavior () + (local-vars (v1-11 object)) + (while (begin + (set! (-> self vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 14)) + (not (handle->process (-> self vehicle-handle))) + ) + (format *stdebug* "mh-centipede task manager waiting for scorpion~%") + (suspend) + ) + (sig-rider-spawn (the-as vehicle (handle->process (-> self vehicle-handle))) #t) + (until v1-11 + (suspend) + (set! v1-11 (and *target* (= (send-event *target* 'query 'mode) 'pilot))) + ) + (sleep-code) + ) + ) + +(defmethod taskman-event-handler ((this task-manager-mh-centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('centipede-died) + (set! (-> this last-centipede-position quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (let ((gp-0 (the-as object (-> this last-target-position)))) + (set! (-> (the-as vector gp-0) quad) (-> (target-pos 0) quad)) + gp-0 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-mh-centipede)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (time-elapsed? (-> this check-timer) (seconds 0.1)) + (if (not (-> this manager-entity)) + (init-actor-group! this) + ) + (let ((v1-9 0)) + (when (> (-> this actor-group-count) 0) + (dotimes (a0-6 (-> this actor-group 0 length)) + (if (not (logtest? (-> this actor-group 0 data a0-6 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (+! v1-9 1) + ) + ) + ) + (set! (-> *game-info* counter) (the float v1-9)) + (when (zero? v1-9) + (let ((s5-0 (entity-by-name "rod-spawner-1"))) + (when s5-0 + (entity-birth-no-kill s5-0) + (send-event + (if s5-0 + (-> s5-0 extra process) + ) + 'appear + (-> this last-centipede-position) + (-> this last-target-position) + ) + ) + ) + (send-event this 'complete) + ) + ) + (set-time! (-> this check-timer)) + ) + (when (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (let* ((s5-1 (handle->process (-> this vehicle-handle))) + (a0-22 (if (type? s5-1 process-focusable) + (the-as vehicle s5-1) + ) + ) + ) + (if (and a0-22 (focus-test? a0-22 dead)) + (send-event this 'fail) + ) + ) + ) + (none) + ) + +(defmethod init-actor-group! ((this task-manager-mh-centipede)) + (local-vars (sv-16 res-tag)) + (let* ((s5-0 "mh-centipede-7") + (a0-2 (entity-by-name s5-0)) + ) + (cond + (a0-2 + (set! (-> this manager-entity) (the-as entity-actor a0-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data a0-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + ) + (else + (format 0 "ERROR: ~S: ~S entity missing actor-group!~%" (game-task->string (-> this node-info task)) s5-0) + ) + ) + ) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-mh-centipede :init hud-init-by-other :name "hud-mh-centipede" :to this)) + ) + ) + (else + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-mh-centipede)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (none) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this task-manager-mh-centipede)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this manager-entity) #f) + (set! (-> this actor-group-count) 0) + (set-setting! 'extra-bank '((nest1 nest3) (nest2 nest4)) 0.0 0) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + (set-setting! 'scarf 'abs 1.0 0) + (set-setting! 'goggles 'abs 1.0 0) + (set-setting! 'music 'nesthunt 0.0 0) + (set-setting! 'cloth #f 0.0 0) + (set-setting! 'armor #f 0.0 0) + (reset-nest-hunt-speeches 1.0) + (none) + ) + +(deftype task-manager-nstb-crystal (task-manager) + ((vehicle-handle handle) + ) + ) + + +(defstate active (task-manager-nstb-crystal) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + ) + :exit (behavior () + (remove-setting! 'pilot-exit) + (remove-setting! 'pilot-death) + ) + :code (behavior () + (local-vars (v1-11 object)) + (while (begin + (set! (-> self vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 14)) + (not (handle->process (-> self vehicle-handle))) + ) + (format *stdebug* "nstb-crystal task manager waiting for scorpion~%") + (suspend) + ) + (sig-rider-spawn (the-as vehicle (handle->process (-> self vehicle-handle))) #t) + (until v1-11 + (suspend) + (set! v1-11 (and *target* (= (send-event *target* 'query 'mode) 'pilot))) + ) + (sleep-code) + ) + ) + +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-nstb-crystal)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (let* ((s5-0 (handle->process (-> this vehicle-handle))) + (a0-8 (if (type? s5-0 process-focusable) + (the-as vehicle s5-0) + ) + ) + ) + (if (and a0-8 (focus-test? a0-8 dead)) + (send-event this 'fail) + ) + ) + ) + (none) + ) + +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-nstb-crystal)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set-setting! 'extra-bank '((nest1 nest3) (nest2 nest4)) 0.0 0) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + (set-setting! 'scarf 'abs 1.0 0) + (set-setting! 'goggles 'abs 1.0 0) + (none) + ) diff --git a/goal_src/jak3/levels/sewer/mh-wasp-part.gc b/goal_src/jak3/levels/sewer/mh-wasp-part.gc index 9e8d60c796..f061527b12 100644 --- a/goal_src/jak3/levels/sewer/mh-wasp-part.gc +++ b/goal_src/jak3/levels/sewer/mh-wasp-part.gc @@ -7,3 +7,513 @@ ;; DECOMP BEGINS +(defpart 5009 + :init-specs ((:texture (gun-enemy-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 5010 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 5011 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpart 5012 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +(defpart 5013 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -360) (degrees 720)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +(defpartgroup group-mh-wasp-shot-hit + :id 1525 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5014 :period (seconds 2) :length (seconds 0.017)) + (sp-item 5015 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017)) + (sp-item 5016 :period (seconds 2) :length (seconds 0.017)) + (sp-item 5017 :fade-after (meters 50) :falloff-to (meters 50) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +(defpart 5017 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 20.0 10.0) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 96.0) + (:b 128.0 128.0) + (:a 64.0 32.0) + (:vel-y (meters 0.06666667) (meters 0.013333334)) + (:scalevel-x (meters -0.001) (meters -0.00033333333)) + (:rotvel-z (degrees -2.4) 1 (degrees 4.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.42666668) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 5018) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 5019 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 32.0 8.0) + (:a 96.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:scalevel-x (meters -0.0005) (meters -0.0005)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.64) + (:fade-b -0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.335)) + (:next-launcher 5018) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 5018 + :init-specs ((:fade-a -0.48 -0.48)) + ) + +(defpart 5015 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 128.0) + (:rotvel-z (degrees -0.1)) + (:fade-a -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 5020) + ) + ) + +(defpart 5020 + :init-specs ((:scale-x (meters 2) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 128.0 128.0) + (:next-time (seconds 0.017)) + (:next-launcher 5020) + ) + ) + +(defpart 5016 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 128.0 128.0) + (:a 48.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.1333334) + (:fade-b -2.1333334) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + (:next-time (seconds 0.067)) + (:next-launcher 5021) + ) + ) + +(defpart 5021 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.53333336) + (:fade-a -0.8) + ) + ) + +(defpart 5014 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.185)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.05)) + (:next-launcher 5022) + ) + ) + +(defpart 5022 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.0875)) + (:scalevel-y :copy scalevel-x) + (:fade-b -6.4) + ) + ) + +(defpartgroup group-mh-wasp-shot-die + :id 1526 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +(defpart 5023 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +(defpartgroup group-mh-wasp-gun-smoke + :id 1527 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5024 :flags (sp7))) + ) + +(defpart 5024 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 64.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.10666667) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-mh-wasp-gun-casing + :id 1528 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5025 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 5026 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 5026 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 32.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.56) + (:fade-g -2.56) + (:fade-b 2.56) + (:fade-a -0.32) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.167)) + (:next-launcher 5027) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5027 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667)) + ) + +(defpart 5025 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:z (meters -0.4)) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.15) (meters 0.02)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:fade-b -8.0) + (:accel-y (meters -0.0016666667) (meters -0.0016666667)) + (:friction 0.9 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.05)) + (:next-launcher 5028) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5028 + :init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96)) + ) + +(defpartgroup group-mh-wasp-engine + :id 1529 + :duration (seconds 0.017) + :flags (sp0 sp7) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5029 :flags (is-3d sp7)) + (sp-item 5030 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + (sp-item 5031 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + (sp-item 5032 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + (sp-item 5033 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + ) + ) + +(defpart 5029 + :init-specs ((:texture (mech-flame sewa-sprite)) + (:num 1.0) + (:y (meters 0)) + (:z (meters -1.2) (meters 0.1)) + (:scale-x (meters 0.6)) + (:scale-y (meters 2.6)) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:b :copy g) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +(defpart 5033 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -0.3)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 16.0 8.0) + (:omega (degrees 2718)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +(defpart 5030 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5) + (:y (meters 0) (meters -0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 1) (meters 0.6)) + (:r 192.0) + (:g 64.0) + (:b 0.0) + (:a 0.0 16.0) + (:vel-y (meters -0.1) (meters -0.016666668)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y (meters 0.006666667)) + (:fade-r -2.0) + (:fade-g 2.0) + (:fade-b 5.0) + (:fade-a 0.32) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters 0.00016666666) (meters 0.00033333333)) + (:friction 0.94) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.085)) + (:next-launcher 5034) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 5034 + :init-specs ((:r 64.0 64.0) + (:g 64.0 64.0) + (:b 64.0 64.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.064 -0.128) + ) + ) + +(defpart 5031 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1 0.1) + (:y (meters 0.25) (meters -0.5)) + (:scale-x (meters 0.05)) + (:scale-y (meters 0.5)) + (:r 192.0 64.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters -0.033333335) (meters -0.026666667)) + (:scalevel-x (meters 0.001)) + (:scalevel-y (meters -0.017)) + (:fade-g 0.0) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.1)) + (:next-launcher 5035) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 5035 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0))) + ) + +(defpart 5032 + :init-specs ((:num 1.0) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-y (meters -0.1) (meters -0.016666668)) + (:fade-r 32.768) + (:fade-g 26.623999) + (:fade-b 28.671999) + (:accel-x (meters 0) (meters 0.0016666667)) + (:friction 0.94) + (:timer (seconds 0.335)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.167)) + (:next-launcher 5036) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 5036 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096)) + ) diff --git a/goal_src/jak3/levels/sewer/mh-wasp.gc b/goal_src/jak3/levels/sewer/mh-wasp.gc index 86b8e305ff..8d0ed61432 100644 --- a/goal_src/jak3/levels/sewer/mh-wasp.gc +++ b/goal_src/jak3/levels/sewer/mh-wasp.gc @@ -7,3 +7,1311 @@ ;; DECOMP BEGINS +(defpartgroup group-mh-wasp-explosion + :id 1530 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.25 0.25 0.25) + :parts ((sp-item 5037 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 5038 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 5039 :period (seconds 3) :length (seconds 0.05)) + (sp-item 5040 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 5041 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 5042 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 5043 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +(defpart 5038 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 5044) + ) + ) + +(defpart 5044 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +(defpart 5043 + :init-specs ((:texture (explosion-wave sewa-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 5045) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5042 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 5045) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5045 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 5046)) + ) + +(defpart 5046 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 5047) + ) + ) + +(defpart 5047 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 5048) + ) + ) + +(defpart 5048 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +(defpart 5037 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 5049) + ) + ) + +(defpart 5049 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +(defpart 5041 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 5050) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5050 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 5051) + ) + ) + +(defpart 5051 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +(defpart 5039 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 5052) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5052 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 5053) + ) + ) + +(defpart 5053 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +(defpart 5040 + :init-specs ((:texture (flamingstick sewa-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(deftype mh-wasp-shot (metalhead-shot) + () + ) + + +(defmethod play-impact-sound ((this mh-wasp-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "wasp-shot-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "wasp-shot-hit") + ) + ) + ) + 0 + (none) + ) + +(defmethod init-proj-settings! ((this mh-wasp-shot)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'mh-wasp-shot) + (set! (-> this max-speed) 491520.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this timeout) (seconds 1.375)) + 0 + (none) + ) + +(deftype mh-wasp (hover-enemy) + ((gun-jmod joint-mod-rotate-local :inline) + (entity-group actor-group) + (smoke-part sparticle-launch-control) + (engine-part sparticle-launch-control) + (old-gravity float :offset 1024) + (knocked-anim int32) + (knocked-recover-anim int32) + (last-fire-time time-frame) + (bridge-index int32) + (gun-x-angle float) + (gun-x-angle-final float) + (path-u float) + (path-du float) + (path-du-final float) + (path-dest float) + (sound-id sound-id) + (attack-wait-min float) + (attack-wait-max float) + (attack-miss-dist-min float) + (attack-miss-dist-max float) + (attack-miss-dist-curr float) + ) + (:state-methods + attack + die-now + die-explode + ) + (:methods + (fire-shot (_type_ projectile-init-by-other-params int int float) none) + ) + ) + + +(defskelgroup skel-mh-wasp neo-wasp neo-wasp-lod0-jg -1 + ((neo-wasp-lod0-mg (meters 20)) (neo-wasp-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7.5) + :shadow neo-wasp-shadow-mg + :origin-joint-index 3 + ) + +(defskelgroup skel-mh-wasp-explode neo-wasp neo-wasp-explode-lod0-jg neo-wasp-explode-idle-ja + ((neo-wasp-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7.5) + :origin-joint-index 3 + ) + +(define *mh-wasp-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +(define *fact-info-mh-wasp-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +(define *mh-wasp-enemy-info* (new 'static 'enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script #f + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 12 + :knocked-anim 10 + :knocked-land-anim 11 + :die-anim 14 + :die-falling-anim 15 + :victory-anim 4 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 7 + :look-at-joint 7 + :bullseye-joint 4 + :sound-hit (static-sound-name "wasp-hit") + :sound-die (static-sound-name "wasp-die") + :notice-distance (meters 70) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 55) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 101580.8 + :knocked-hard-vy-lo 60620.8 + :knocked-hard-vy-hi 95027.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 10) + :shadow-min-y (meters -20) + :shadow-locus-dist (meters 150) + :gem-joint 7 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +(set! (-> *mh-wasp-enemy-info* fact-defaults) *fact-info-mh-wasp-defaults*) + +(defmethod event-handler ((this mh-wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (= (-> this hit-points) 0.0) + (go (method-of-object this die-explode)) + (go (method-of-object this knocked)) + ) + ) + (else + ((method-of-type hover-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod knocked-handler ((this mh-wasp) (arg0 vector)) + (let ((s4-0 (-> this root))) + (case (-> this incoming knocked-type) + (((knocked-type explode-or-darkjak)) + (let ((gp-1 (-> this root transv))) + (let ((a1-1 (handle->process (-> this incoming attacker-handle)))) + (if a1-1 + (vector-! gp-1 (-> (the-as process-drawable a1-1) root trans) (-> this root trans)) + (vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans)) + ) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate90-around-y! gp-1 gp-1) + (if (< 0.0 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans)) + (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) + ) + ) + (vector-negate! gp-1 gp-1) + ) + (let ((f30-1 (rnd-float-range this 0.0 1.0)) + (s5-1 (-> this enemy-info)) + ) + (vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1)) + (set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1)) + ) + ) + ) + (else + (call-parent-method this arg0) + ) + ) + ) + ) + +(defmethod go-idle2 ((this mh-wasp)) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go (method-of-object this ambush)) + (go (method-of-object this notice)) + ) + ) + +(defmethod go-hostile ((this mh-wasp)) + (go (method-of-object this hostile)) + ) + +(defmethod go-best-state ((this mh-wasp)) + (go-hostile this) + ) + +(defmethod enemy-common-post ((this mh-wasp)) + (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) + ((method-of-type hover-enemy enemy-common-post) this) + (none) + ) + +(defstate ambush (mh-wasp) + :virtual #t + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag alert)) + (logior! (-> self enemy-flags) (enemy-flag cam-attack-mode)) + (hover-enemy-method-159 self #f) + (set-time! (-> self scale-timer)) + (cond + ((not (logtest? (-> self fact enemy-options) (enemy-option user0))) + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (hover-enemy-method-162 self 0.0) + ) + (else + (hover-enemy-method-162 self 1.0) + ) + ) + (hover-enemy-method-165 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (not (logtest? (-> self fact enemy-options) (enemy-option user0))) + (time-elapsed? (-> self state-time) (seconds 2)) + ) + (hover-enemy-method-161 self) + (go-virtual hostile) + ) + ) + :code hover-enemy-fly-code + :post (behavior () + (local-vars (v1-19 enemy-flag)) + (when (not (logtest? (-> self fact enemy-options) (enemy-option user0))) + (let ((f0-1 (the float (- (current-time) (-> self scale-timer)))) + (f1-0 600.0) + ) + (when (< f0-1 f1-0) + (let ((f30-0 (fmin 1.0 (/ (+ 30.0 f0-1) f1-0)))) + (hover-enemy-method-162 self f30-0) + (when (and (not (logtest? (-> self enemy-flags) (enemy-flag vulnerable))) (>= f30-0 1.0)) + (let ((v1-18 (-> self enemy-flags))) + (if (logtest? v1-18 (enemy-flag vulnerable-backup)) + (set! v1-19 (logior v1-18 (enemy-flag vulnerable))) + (set! v1-19 (logclear v1-18 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-19) + ) + ) + ) + ) + ) + (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) + (hover-enemy-hostile-post) + ) + ) + +(defstate notice (mh-wasp) + :virtual #t + :post (behavior () + (let ((t9-0 (-> (method-of-type hover-enemy notice) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) + ) + ) + +(defstate hostile (mh-wasp) + :virtual #t + :trans (behavior () + (let ((gp-0 (ja-group)) + (f0-0 (ja-aframe-num 0)) + ) + (when (and (= gp-0 neo-wasp-idle-ja) + (or (and (>= f0-0 0.0) (>= 1.0 f0-0)) + (and (>= f0-0 16.0) + (>= (the float (+ (-> (the-as art-joint-anim neo-wasp-idle-ja) frames num-frames) -1)) (ja-frame-num 0)) + ) + ) + ) + (if (and (time-elapsed? + (-> self last-fire-time) + (the int (* 300.0 (rand-vu-float-range (-> self attack-wait-min) (-> self attack-wait-max)))) + ) + (get-focus! self) + ) + (go-virtual attack) + ) + ) + ) + ) + ) + +(defstate attack (mh-wasp) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('event-attack) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (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 notify-handle) (the-as handle #f)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-9 *game-info*) + (a0-7 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-7) + (set! (-> gp-0 attack-id) a0-7) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (fire-shot self gp-0 19 17 -1.0) + (fire-shot self gp-0 23 21 1.0) + ) + (sound-play "wasp-fire" :position (-> self root trans)) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (sound-play "wasp-warn" :position (-> self root trans)) + (ja-no-eval :group! (-> self draw art-group data (-> self hover-info shoot-anim)) + :num! (seek!) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-time! (-> self last-fire-time)) + (set! (-> self restart-fly-anims) #t) + (go-hostile self) + ) + :post (behavior () + (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) + (a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (new 'stack-no-clear 'vector))) + (set! (-> v1-4 quad) (-> self focus-pos quad)) + (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) + (vector-! gp-0 v1-4 a0-2) + ) + (vector-normalize! gp-0 1.0) + (set! (-> self gun-x-angle-final) (- (vector-x-angle gp-0))) + ) + (quaternion-vector-angle! (-> self gun-jmod rotation) *x-vector* (-> self gun-x-angle)) + (seek! + (-> self attack-miss-dist-curr) + (-> self attack-miss-dist-max) + (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) + ) + (hover-enemy-hostile-post) + ) + ) + +(defstate knocked-recover (mh-wasp) + :virtual #t + :event enemy-event-handler + :code (behavior () + (local-vars (v1-35 enemy-flag) (v1-37 enemy-flag) (v1-39 enemy-flag)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! (-> self draw art-group data (-> self knocked-recover-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self restart-fly-anims) #t) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-34 (-> self enemy-flags))) + (if (logtest? v1-34 (enemy-flag vulnerable-backup)) + (set! v1-35 (logior v1-34 (enemy-flag vulnerable))) + (set! v1-35 (logclear v1-34 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-35) + (let ((v1-36 (-> self enemy-flags))) + (if (logtest? v1-36 (enemy-flag attackable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag attackable))) + (set! v1-37 (logclear v1-36 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-38) + (set! v1-39 (logior (enemy-flag trackable) v1-38)) + (set! v1-39 (logclear v1-38 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (hover-nav-control-method-20 (-> self hover)) + (go-hostile self) + ) + ) + +(defstate die-explode (mh-wasp) + :virtual #t + :event enemy-event-handler + :code (behavior () + (on-dying self) + (set! (-> self hit-points) 0.0) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-stop (-> self sound-id)) + (sound-play "wasp-explode") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-mh-wasp-explode" (the-as (pointer level) #f)) + 22 + gp-1 + *mh-wasp-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 1530 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1530)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1530)) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defstate die-now (mh-wasp) + :virtual #t + :event enemy-event-handler + :code (behavior () + (on-dying self) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self hit-points) 0.0) + (do-effect (-> self skel effect) (the-as string 'death-default) 0.0 -1) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (cleanup-for-death self) + ) + :post transform-post + ) + +(defmethod get-focus! ((this mh-wasp)) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (let* ((a0-4 (-> this root)) + (s4-1 (vector+! (new 'stack-no-clear 'vector) (-> a0-4 trans) (-> a0-4 transv))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this focus-pos))) + (s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat s5-0 0))) + (s3-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) + ) + (if (and (and s5-0 (not (logtest? (-> s5-0 focus-status) (focus-status disable dead ignore grabbed)))) + (< 0.0 (vector-dot s2-1 s3-2)) + (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) + (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-104 this (-> this focus-pos) 5461.3335)) + ) + s5-0 + ) + ) + ) + ) + ) + +(defmethod knocked-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + (cond + ((rnd-chance? this 0.5) + (set! (-> this knocked-anim) 10) + (set! (-> this knocked-recover-anim) 11) + ) + (else + (set! (-> this knocked-anim) 12) + (set! (-> this knocked-recover-anim) 13) + ) + ) + (ja-channel-push! 1 0) + (let ((a1-3 (-> this draw art-group data (-> this knocked-anim))) + (a0-5 (-> this skel root-channel 0)) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) + (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-3) num-func-seek!) + ) + #t + ) + +(defmethod knocked-land-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) + ) + (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim v1-4) num-func-seek!) + ) + #t + ) + +(defmethod enemy-method-88 ((this mh-wasp) (arg0 enemy-knocked-info)) + (-> this root) + (>= (-> arg0 on-surface-count) 1) + ) + +(defmethod within-gspot-range? ((this mh-wasp)) + #f + ) + +(defmethod go-die ((this mh-wasp)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (go (method-of-object this die-now)) + ) + ((-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) + ) + (else + (go (method-of-object this die)) + ) + ) + ) + +(defmethod fire-shot ((this mh-wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 int) (arg3 float)) + (vector<-cspace! (-> arg0 pos) (-> this node-list data arg1)) + (let ((s3-1 + (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data arg1 bone transform uvec) 1.0) + (* 273.06668 arg3) + ) + ) + (a1-8 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data arg1 bone transform fvec) 1.0) + ) + ) + (vector-orient-by-quat! (-> arg0 vel) a1-8 s3-1) + ) + (vector-normalize! (-> arg0 vel) 491520.0) + (spawn-projectile mh-wasp-shot arg0 this *default-dead-pool*) + 0 + (none) + ) + +(defmethod hover-enemy-method-163 ((this mh-wasp)) + (let ((s4-0 (-> this main-joint-movement 1)) + (s5-0 (-> this main-joint-movement 2)) + (gp-0 + (lambda ((arg0 mh-wasp) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int)) + (local-vars (sv-192 float) (sv-208 vector) (sv-224 vector)) + (set! sv-192 arg2) + (let ((s0-0 arg3)) + (set! sv-224 arg4) + (let ((s1-0 arg5) + (s3-0 arg6) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) arg1)) + (s5-0 (new 'stack-no-clear 'matrix)) + (a1-3 (matrix-with-scale->quaternion (new 'stack-no-clear 'quaternion) (-> arg1 bone transform))) + ) + (set! sv-208 (new 'stack-no-clear 'vector)) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (-> arg0 scale) + (quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192) + (quaternion->matrix s5-0 (the-as quaternion sv-208)) + (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (scale-matrix! s5-0 s2-1 s5-0) + (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) + (t9-6 vector-inv-orient-by-quat!) + (a0-10 (new 'stack-no-clear 'vector)) + (a2-4 (-> arg0 root quat)) + (v0-6 (t9-6 a0-10 sv-224 a2-4)) + (f30-0 (* 1638400.0 (seconds-per-frame))) + (f28-0 + (seek + (-> arg0 thrust s3-0) + (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) + (fmax 0.0 (-> v0-6 y)) + (fabs (* 0.2 (-> v0-6 z))) + (fmax 0.0 (-> s1-1 y)) + ) + (* 0.2 f30-0) + ) + ) + ) + (let ((f20-0 (lerp-scale 819.2 4096.0 f28-0 1638.4 f30-0)) + (f26-0 (lerp-scale 4915.2 11468.8 f28-0 1638.4 f30-0)) + ) + (lerp-scale 0.0 -4915.2 f28-0 1638.4 f30-0) + (let ((f22-0 (lerp-scale 0.5 1.5 f28-0 1638.4 f30-0)) + (f24-0 (lerp-scale 0.1 1.0 f28-0 1638.4 f30-0)) + ) + (lerp-scale 0.1 1.0 f28-0 1638.4 f30-0) + (let ((f1-10 (lerp-scale 0.02 0.6 f28-0 1638.4 f30-0)) + (f2-6 (fmin 1.0 (-> s2-1 x))) + (f0-15 (fmin 1.0 (-> s2-1 y))) + ) + (set! (-> *part-id-table* 5029 init-specs 4 initial-valuef) (* f20-0 f2-6)) + (set! (-> *part-id-table* 5029 init-specs 5 initial-valuef) (* f26-0 f0-15)) + (set! (-> *part-id-table* 5033 init-specs 3 initial-valuef) (* f22-0 f2-6)) + (set! (-> *part-id-table* 5030 init-specs 1 initial-valuef) (* f24-0 f0-15)) + (set! (-> *part-id-table* 5031 init-specs 1 initial-valuef) (* f1-10 f0-15)) + (set! (-> *part-id-table* 5032 init-specs 0 initial-valuef) (* f24-0 f0-15)) + (set! (-> arg0 thrust s3-0) f28-0) + (let ((f0-16 (* f26-0 f0-15))) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-16)) + ) + ) + ) + ) + (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (spawn-from-mat (-> arg0 engine-part) s5-0) + (let ((f0-18 (lerp-scale 0.75 1.0 f28-0 1638.4 f30-0))) + (sound-play-by-name + (static-sound-name "wasp-jets") + (-> arg0 sound-id) + (the int (* 1024.0 f0-18)) + 0 + 0 + (sound-group) + (-> arg0 root trans) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + (gp-0 + this + (-> this node-list data (-> this hover-info engine-left)) + (-> this hover-info thrust-rotate-left) + -1.0 + s5-0 + s4-0 + 0 + ) + (gp-0 + this + (-> this node-list data (-> this hover-info engine-right)) + (-> this hover-info thrust-rotate-right) + 1.0 + s5-0 + s4-0 + 1 + ) + ) + 0 + (none) + ) + +(defmethod init-enemy-collision! ((this mh-wasp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 10) 0))) + (set! (-> s5-0 total-prims) (the-as uint 11)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 15564.8) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 0) + (set-vector! (-> v1-14 local-sphere) 0.0 5324.8 -2048.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 0) + (set-vector! (-> v1-16 local-sphere) 0.0 3276.8 -2048.0 4915.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 0) + (set-vector! (-> v1-18 local-sphere) 0.0 7372.8 -2048.0 4915.2) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core action) (collide-action semi-solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 1228.8 3481.6) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core action) (collide-action semi-solid)) + (set! (-> v1-22 transform-index) 7) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core action) (collide-action semi-solid)) + (set! (-> v1-24 transform-index) 9) + (set-vector! (-> v1-24 local-sphere) 0.0 1638.4 0.0 2048.0) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core action) (collide-action semi-solid)) + (set! (-> v1-26 transform-index) 10) + (set-vector! (-> v1-26 local-sphere) -819.2 0.0 0.0 1638.4) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core action) (collide-action semi-solid)) + (set! (-> v1-28 transform-index) 12) + (set-vector! (-> v1-28 local-sphere) 0.0 -1638.4 0.0 2048.0) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core action) (collide-action semi-solid)) + (set! (-> v1-30 transform-index) 13) + (set-vector! (-> v1-30 local-sphere) 819.2 0.0 0.0 1638.4) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core action) (collide-action semi-solid)) + (set! (-> v1-32 transform-index) 15) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-35 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-35 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-35 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod deactivate ((this mh-wasp)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this engine-part)) + (kill-particles (-> this engine-part)) + ) + (sound-stop (-> this sound-id)) + ((method-of-type hover-enemy deactivate) this) + (none) + ) + +;; WARN: Return type mismatch hover-enemy vs mh-wasp. +(defmethod relocate ((this mh-wasp) (offset int)) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this engine-part)) + (&+! (-> this engine-part) offset) + ) + (the-as mh-wasp ((method-of-type hover-enemy relocate) this offset)) + ) + +(defmethod hover-enemy-method-170 ((this mh-wasp)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-wasp" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +(defmethod get-enemy-info ((this mh-wasp)) + *mh-wasp-enemy-info* + ) + +(defmethod get-hover-info ((this mh-wasp)) + (new 'static 'hover-enemy-info + :fly-forward-anim 7 + :fly-backward-anim 8 + :fly-left-anim 6 + :fly-right-anim 5 + :shoot-anim 9 + :main-joint 3 + :gun-base 15 + :engine-left 10 + :engine-right 13 + :thrust-rotate-left 16384.0 + :thrust-rotate-right -16384.0 + :hover-y-offset 26624.0 + :hover-xz-offset 61440.0 + :use-flying-death #f + :fly-x-anim-seek 1.3 + :fly-z-anim-seek 1.3 + ) + ) + +(defmethod get-hover-params ((this mh-wasp)) + (new 'static 'hover-nav-params + :max-speed 57344.0 + :max-acceleration 81920.0 + :max-rotation-rate 14563.556 + :friction 0.05 + ) + ) + +(defmethod init-enemy! ((this mh-wasp)) + (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) + (hover-enemy-method-170 this) + (init-enemy-defaults! this (get-enemy-info this)) + (hover-enemy-method-176 this) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) (rnd-float-range this 0.9 1.3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (init (-> this gun-jmod) this (the-as uint (-> this hover-info gun-base)) (joint-mod-base-flags attached)) + (set! (-> this gun-x-angle) 0.0) + (set! (-> this gun-x-angle-final) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-29 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (if (and v1-29 (= (-> sv-16 elt-count) 1)) + (set! (-> this entity-group) (the-as actor-group (-> (the-as (pointer uint32) v1-29)))) + (set! (-> this entity-group) #f) + ) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-33 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) + (cond + ((and v1-33 (= (-> sv-32 elt-count) 2)) + (set! (-> this attack-wait-min) (-> v1-33 0)) + (set! (-> this attack-wait-max) (-> v1-33 1)) + ) + (else + (set! (-> this attack-wait-min) 1.0) + (set! (-> this attack-wait-max) 3.0) + ) + ) + ) + (let ((f30-0 4096.0)) + (set! sv-48 (new 'static 'res-tag)) + (let ((v1-40 (res-lump-data (-> this entity) 'min-max pointer :tag-ptr (& sv-48)))) + (set! (-> this attack-miss-dist-min) (* f30-0 (if (and v1-40 (> (the-as int (-> sv-48 elt-count)) 0)) + (-> (the-as (pointer float) v1-40)) + -1.0 + ) + ) + ) + ) + ) + (let ((f30-1 4096.0)) + (set! sv-64 (new 'static 'res-tag)) + (let ((v1-44 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) + (set! (-> this attack-miss-dist-max) (* f30-1 (if (and v1-44 (< 1 (the-as int (-> sv-64 elt-count)))) + (-> v1-44 1) + 1.0 + ) + ) + ) + ) + ) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1527) this)) + (set! (-> this engine-part) (create-launch-control (-> *part-group-id-table* 1529) this)) + (add-connection + *part-engine* + this + 7 + this + 468 + (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) + ) + (add-connection + *part-engine* + this + 7 + this + 468 + (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) + ) + (add-connection *part-engine* this 7 this 2204 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/sewer/needle-fish.gc b/goal_src/jak3/levels/sewer/needle-fish.gc index 2799237873..d450692c61 100644 --- a/goal_src/jak3/levels/sewer/needle-fish.gc +++ b/goal_src/jak3/levels/sewer/needle-fish.gc @@ -5,5 +5,727 @@ ;; name in dgo: needle-fish ;; dgos: SEA +(declare-type needle-fish nav-enemy) + ;; DECOMP BEGINS +(defskelgroup skel-needle-fish needle-fish needle-fish-lod0-jg -1 + ((needle-fish-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3) + ) + +(defskelgroup skel-needle-fish-needle needle-fish needle-fish-needle-lod0-jg needle-fish-needle-idle-ja + ((needle-fish-needle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + ) + +(deftype needle-fish-shot (projectile-bounce) + ((scale float) + ) + ) + + +(defmethod projectile-method-25 ((this needle-fish-shot)) + (let ((f0-0 (-> this scale))) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) + ) + (seek! (-> this scale) 0.0 (seconds-per-frame)) + (ja-post) + 0 + (none) + ) + +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this needle-fish-shot) (arg0 projectile-options)) + (with-pp + (case arg0 + (((projectile-options po0 po1)) + (when (nonzero? (-> this sound-id)) + (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) (-> this sound-id)) + (let ((a1-1 (-> this root trans))) + (let ((s5-1 pp)) + (when (= a1-1 #t) + (if (and s5-1 (type? s5-1 process-drawable) (nonzero? (-> (the-as process-drawable s5-1) root))) + (set! a1-1 (-> (the-as process-drawable s5-1) root trans)) + (set! a1-1 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-0 params trans) a1-1) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) + ) + ) + (none) + ) + ) + +(defmethod setup-collision! ((this needle-fish-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 819.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; WARN: Return type mismatch float vs none. +(defmethod init-proj-settings! ((this needle-fish-shot)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-needle-fish-needle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) + (t9-2 this) + ) + (let ((a1-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0))) + (forward-up->quaternion (-> this root quat) a1-3 *y-vector*) + ) + (set! (-> this attack-mode) 'needle-fish-shot) + (set! (-> this max-speed) 163840.0) + (set-gravity-length (-> this root dynam) 245760.0) + (set! (-> this scale) 1.0) + (none) + ) + +;; WARN: Return type mismatch (pointer process) vs (pointer needle-fish-shot). +(defun spawn-needle-fish-projectile ((arg0 needle-fish) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((a1-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 arg3))) + (set! (-> s5-0 ent) (-> arg0 entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options)) + (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 notify-handle) (process->handle arg0)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 target-handle) (the-as handle #f)) + (set! (-> s5-0 target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 ignore-handle) (process->handle arg0)) + (let* ((v1-11 *game-info*) + (a0-12 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-12) + (set! (-> s5-0 attack-id) a0-12) + ) + (set! (-> s5-0 timeout) (seconds 4)) + (set! (-> s5-0 pos quad) (-> arg1 quad)) + (vector-normalize-copy! (-> s5-0 vel) a1-2 arg3) + ) + (the-as (pointer needle-fish-shot) (spawn-projectile needle-fish-shot s5-0 arg0 *default-dead-pool*)) + ) + ) + +(deftype needle-fish-chain-physics (chain-physics) + () + ) + + +(defmethod apply-gravity ((this needle-fish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) + (with-pp + (vector-float*! + arg0 + (-> this gravity) + (* 4096.0 (-> pp clock time-adjust-ratio) (lerp-scale 0.01 0.1 (the float arg1) 0.0 5.0)) + ) + (vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) 0.2) + 0 + (none) + ) + ) + +(defmethod chain-physics-method-14 ((this needle-fish-chain-physics) (arg0 vector) (arg1 int)) + (vector-float*! + arg0 + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) + (lerp-scale 0.4 0.9 (the float arg1) 0.0 4.0) + ) + 0 + (none) + ) + +(defmethod chain-physics-method-16 ((this needle-fish-chain-physics) (arg0 int)) + (if (zero? arg0) + 0.0 + 5461.3335 + ) + ) + +(define *needle-fish-spike-tbl* + (new 'static 'boxed-array :type int32 22 31 30 9 20 32 19 16 41 36 34 42 8 21 38 33 37 40 18 17 43 35) + ) + +(define *needle-fish-chain-setup* (new 'static 'boxed-array :type chain-physics-setup + (new 'static 'chain-physics-setup :joint-index 26) + (new 'static 'chain-physics-setup :joint-index 27) + (new 'static 'chain-physics-setup :joint-index 28) + (new 'static 'chain-physics-setup :joint-index 29) + ) + ) + +(deftype needle-fish (nav-enemy) + ((scared-timer time-frame) + (tail needle-fish-chain-physics) + (tail-initialized symbol) + (tail-clock float) + (tail-blend float) + ) + (:state-methods + attack + explode + ) + ) + + +(define *fact-info-needle-fish-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +(define *needle-fish-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 5 + :param1 5 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 3 + :hostile-anim 4 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 4 + :sound-hit (static-sound-name "needle-fish-hit") + :sound-die (static-sound-name "needle-fish-die") + :notice-distance (meters 20) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.96 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 4) + :run-acceleration (meters 0.1) + :run-turning-acceleration (meters 20) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 2) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +(set! (-> *needle-fish-nav-enemy-info* fact-defaults) *fact-info-needle-fish-defaults*) + +(defmethod init-enemy-collision! ((this needle-fish)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 6144.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-13 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 5734.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defun needle-fish-joint-mod-tail ((arg0 cspace) (arg1 transformq)) + (let* ((s4-0 (-> arg0 param1)) + (f0-0 4.0) + (t9-0 sin) + (f1-0 65536.0) + (f2-0 (-> (the-as needle-fish s4-0) tail-clock)) + (f0-3 (t9-0 (* f1-0 (/ (- f2-0 (* (the float (the int (/ f2-0 f0-0))) f0-0)) f0-0)))) + (f0-4 (* 4551.1113 f0-3)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* f0-4))) + (quaternion-normalize! (quaternion*! s3-0 (-> arg1 quat) a2-1)) + ) + (quaternion-slerp! (-> arg1 quat) (-> arg1 quat) s3-0 (-> (the-as needle-fish s4-0) tail-blend)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +(defstate active (needle-fish) + :virtual #t + :post nav-enemy-simple-post + ) + +(defstate notice (needle-fish) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-virtual hostile) + ) + ) + +(defstate stare (needle-fish) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! needle-fish-swim0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +(defstate hostile (needle-fish) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (cond + ((and (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 81920.0) (get-focus! self)) + (go-virtual attack) + ) + ((< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 24576.0) + (go-stare self) + ) + ) + ) + ) + :post (behavior () + (let ((v1-0 (new 'stack-no-clear 'vector)) + (a0-0 (-> self focus-pos)) + ) + (vector-! v1-0 (-> self root trans) a0-0) + (let ((f0-0 (vector-length v1-0)) + (f1-0 16384.0) + ) + (when (< f1-0 f0-0) + (vector-float*! v1-0 v1-0 (/ (+ -4096.0 f1-0) f0-0)) + (vector+! v1-0 a0-0 v1-0) + (let ((a0-2 (-> self nav state))) + (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-2 target-pos quad) (-> v1-0 quad)) + ) + 0 + ) + ) + ) + (nav-enemy-method-187 self) + ) + ) + +(defstate attack (needle-fish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (let ((v1-3 (-> self focus aware))) + (if (or (>= 2 (the-as int v1-3)) (= v1-3 (enemy-aware ea4)) (not (get-focus! self))) + (go-stare self) + ) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 12288.0) + (go-virtual explode) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! needle-fish-spikes0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! needle-fish-swim-spikes0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-chase-post) + ) + ) + +(defstate explode (needle-fish) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "nfish-explode") + (dotimes (gp-1 (-> *needle-fish-spike-tbl* length)) + (let* ((a1-1 (-> self node-list data (-> *needle-fish-spike-tbl* gp-1))) + (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) a1-1)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> self root trans))) + ) + (vector-normalize! s4-1 1.0) + (spawn-needle-fish-projectile self s5-1 s4-1 163840.0) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-2 spawn-quat)) + (set! (-> gp-2 radius) 20480.0) + (set! (-> gp-2 scale) 1.0) + (set! (-> gp-2 group) (-> *part-group-id-table* 221)) + (set! (-> gp-2 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-2 damage) 2.0) + (set! (-> gp-2 damage-scale) 1.0) + (set! (-> gp-2 vehicle-damage-factor) 1.0) + (set! (-> gp-2 vehicle-impulse-factor) 1.0) + (set! (-> gp-2 ignore-proc) (process->handle #f)) + (explosion-spawn gp-2 (the-as process-drawable *default-pool*)) + ) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod enemy-method-108 ((this needle-fish) (arg0 process-focusable)) + (< (current-time) (-> this scared-timer)) + ) + +(defmethod go-stare ((this needle-fish)) + (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 2.0 4.0))))) + (go-flee this) + ) + +(defmethod event-handler ((this needle-fish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (go (method-of-object this explode)) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defmethod send-attack-on-jump-or-knocked ((this needle-fish) (arg0 process) (arg1 event-message-block)) + (if (= arg0 *target*) + (go (method-of-object this explode)) + ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ) + ) + +(defmethod enemy-common-post ((this needle-fish)) + (when (not (-> this tail-initialized)) + (set! (-> this tail-initialized) #t) + (initialize-chain-joints (-> this tail)) + ) + (update (-> this tail) this) + (let ((a0-4 (handle->process (-> this focus handle)))) + (if a0-4 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-4) 3) quad)) + ) + ) + (+! (-> this tail-clock) + (* (lerp-scale 1.0 10.0 (vector-length (-> this root transv)) 0.0 16384.0) (seconds-per-frame)) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; WARN: Return type mismatch nav-enemy vs needle-fish. +(defmethod relocate ((this needle-fish) (offset int)) + (if (nonzero? (-> this tail)) + (&+! (-> this tail) offset) + ) + (the-as needle-fish ((method-of-type nav-enemy relocate) this offset)) + ) + +(defmethod init-enemy! ((this needle-fish)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-needle-fish" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *needle-fish-nav-enemy-info*) + (set! (-> this tail) (new 'process 'needle-fish-chain-physics)) + (chain-physics-initialize this (-> this tail) 25 1638.4 *needle-fish-chain-setup*) + (set! (-> this tail-initialized) #f) + (set! (-> this tail-clock) 0.0) + (set! (-> this tail-blend) 1.0) + (let ((a0-6 (-> this node-list data 25))) + (set! (-> a0-6 param0) needle-fish-joint-mod-tail) + (set! (-> a0-6 param1) this) + ) + (set-vector! (-> this root scale) 1.0 0.5 1.0 1.0) + (set! (-> this scared-timer) 0) + (setup-masks (-> this draw) 3 0) + 0 + (none) + ) + +(deftype sew-needle-fish (needle-fish) + () + ) diff --git a/goal_src/jak3/levels/sewer/sew-laser-turret.gc b/goal_src/jak3/levels/sewer/sew-laser-turret.gc index f2ed9dc17f..6f47ac3be7 100644 --- a/goal_src/jak3/levels/sewer/sew-laser-turret.gc +++ b/goal_src/jak3/levels/sewer/sew-laser-turret.gc @@ -7,3 +7,1207 @@ ;; DECOMP BEGINS +(deftype gun-turret-params (structure) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (barrel-joint int32) + (gun-joint int32) + (hole-joints int32 8) + ) + ) + + +(deftype sew-laser-turret (enemy) + ((params gun-turret-params) + (aim-pos vector :inline) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (flash-state symbol) + (can-shoot symbol) + (last-active-time time-frame) + (target-distance float) + (target-on-ground symbol) + (was-hit symbol) + (awareness-radius float) + (ring-rate time-frame) + (max-num-rings int32) + (last-spawn-index int32) + (spin-sound-id sound-id) + (last-play-time time-frame) + (strip prim-strip) + ) + (:state-methods + alert + spinning-up + spinning-down + turn-off + ) + (:methods + (start-firing (_type_ symbol int) none) + (sew-laser-turret-method-160 (_type_) none) + (generate-prim-verts! (_type_ float float) none) + (check-suitable-focus (_type_) symbol) + (sew-laser-turret-method-163 (_type_) none) + ) + ) + + +(defpartgroup group-sew-laser-turret-hit + :id 1518 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4757 :period (seconds 5) :length (seconds 0.085) :offset -10) + (sp-item 4758 :fade-after (meters 60) :period (seconds 5) :length (seconds 0.1)) + (sp-item 4759 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 5) :length (seconds 0.335)) + (sp-item 4760 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 5) :length (seconds 0.167)) + (sp-item 4761 :period (seconds 5) :length (seconds 0.017) :offset -10) + (sp-item 4762 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 5) :length (seconds 0.167)) + ) + ) + +(defpart 4760 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 4962) + (:conerot-x '*sp-temp*) + ) + ) + +(defpart 4762 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a 0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 4962) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 4962 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 4963)) + ) + +(defpart 4963 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4964) + ) + ) + +(defpart 4964 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 4965) + ) + ) + +(defpart 4965 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +(defpart 4761 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 4966) + ) + ) + +(defpart 4966 + :init-specs ((:scalevel-x (meters -0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -2.56) + (:fade-b 0.0) + (:fade-a -1.92) + ) + ) + +(defpart 4759 + :init-specs ((:texture (specs level-default-sprite)) + (:num 5.0 3.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4967) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +(defpart 4967 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4968) + ) + ) + +(defpart 4968 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +(defpart 4757 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4969) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +(defpart 4969 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4970) + ) + ) + +(defpart 4970 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +(defpart 4758 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.1) (meters 0.25)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +(defpartgroup group-sew-laser-turret-smoke + :id 1519 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4971 :flags (sp7))) + ) + +(defpart 4971 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 16.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.10666667) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:rotate-y (degrees 0)) + ) + ) + +(defpartgroup group-sew-laser-turret-casing + :id 1520 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4972 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4973 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +(defpart 4973 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 32.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.56) + (:fade-g -2.56) + (:fade-b 2.56) + (:fade-a -0.32) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.167)) + (:next-launcher 4974) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4974 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667)) + ) + +(defpart 4972 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:z (meters -0.4)) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.15) (meters 0.02)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:fade-b -8.0) + (:accel-y (meters -0.0016666667) (meters -0.0016666667)) + (:friction 0.9 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.05)) + (:next-launcher 4975) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 4975 + :init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96)) + ) + +(defskelgroup skel-sew-laser-turret sew-laser-turret sew-laser-turret-lod0-jg sew-laser-turret-idle-ja + ((sew-laser-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +(define *sew-laser-turret-enemy-info* + (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 3 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 150) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 10.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +(set! (-> *sew-laser-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; WARN: Return type mismatch symbol vs none. +(defmethod start-firing ((this sew-laser-turret) (arg0 symbol) (arg1 int)) + (let ((a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1)))) + (new 'stack-no-clear 'vector) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (-> a0-2 y) + (set! (-> a1-3 quad) (-> this node-list data arg1 bone transform fvec quad)) + (set! (-> a1-3 y) (* 0.5 (-> a1-3 y))) + (fire-laser! a0-2 a1-3 (the-as sew-laser-guard this) 491520.0) + ) + ) + (if arg0 + (sound-play "gtur-shot-fire") + ) + (set! (-> this flash-state) #t) + (none) + ) + +(defun do-spin ((arg0 sew-laser-turret) (arg1 float)) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s5-0 *up-vector* (* 182.04445 (seconds-per-frame) arg1)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) s5-0) + ) + (quaternion-normalize! (-> arg0 root quat)) + ) + +;; WARN: Return type mismatch symbol vs none. +(defmethod sew-laser-turret-method-163 ((this sew-laser-turret)) + (let* ((s5-0 *target*) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + (a0-2 + (set! (-> this target-distance) (vector-vector-xz-distance (get-trans a0-2 0) (-> this root trans))) + (set! (-> this target-on-ground) (logtest? (-> *target* control status) (collide-status on-surface))) + ) + (else + (set! (-> this target-on-ground) #f) + ) + ) + ) + (none) + ) + +(defmethod check-suitable-focus ((this sew-laser-turret)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (set! (-> s5-0 w) (-> this awareness-radius)) + (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) + (let* ((s2-0 (-> s4-0 s3-0)) + (v1-4 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when v1-4 + (let* ((s2-1 (-> v1-4 process)) + (v1-5 (if (type? s2-1 process-focusable) + s2-1 + ) + ) + ) + (when v1-5 + (if (and (!= this v1-5) + (not (focus-test? (the-as process-focusable v1-5) inactive)) + (not (focus-test? (the-as process-focusable v1-5) disable)) + (not (focus-test? (the-as process-focusable v1-5) dead)) + (not (logtest? (process-mask crate) (-> v1-5 mask))) + (not (logtest? (process-mask vehicle) (-> v1-5 mask))) + ) + (return #t) + ) + ) + ) + ) + ) + ) + ) + (let* ((s3-1 *target*) + (s4-1 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) s5-0) (-> s5-0 w))) + (if (and (!= this s4-1) + (not (focus-test? s4-1 inactive)) + (not (focus-test? s4-1 disable)) + (not (focus-test? s4-1 dead)) + (not (logtest? (process-mask crate) (-> s4-1 mask))) + (not (logtest? (process-mask vehicle) (-> s4-1 mask))) + ) + (return #t) + ) + ) + ) + ) + #f + ) + +(defun compute-ring-period ((arg0 int)) + (/ 1.0 (the float arg0)) + ) + +(defun compute-ring-position ((arg0 int) (arg1 int)) + (* (compute-ring-period arg1) (the float (- arg1 arg0))) + ) + +(defun compute-num-rings-to-draw ((arg0 time-frame) (arg1 time-frame) (arg2 float) (arg3 int)) + (if (< arg1 arg0) + arg3 + (+ (the int (/ arg2 (compute-ring-period arg3))) 1) + ) + ) + +(defun compute-ring-size ((arg0 float) (arg1 float)) + (let ((f0-1 (- arg0 (- 1.0 arg1)))) + (if (< f0-1 0.0) + (set! f0-1 (+ 1.0 f0-1)) + ) + f0-1 + ) + ) + +;; og:preserve-this decompiled manually +(defun check-enemy ((turret sew-laser-turret) (radius float) (pfoc process-focusable)) + (let ((dist (-> turret target-distance))) + (and (-> turret target-on-ground) + (>= dist (+ radius (meters -0.1))) + (>= dist (+ radius (meters 0.1))) + ) + ) + ) + +(defstate spinning-up (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (until #f + (if (time-elapsed? (-> self state-time) (seconds 1.2)) + (go-hostile self) + ) + (let ((f0-1 (* 0.0027777778 (the float (mod (- (current-time) (-> self state-time)) 360))))) + (do-spin self (* 240.0 f0-1)) + ) + (suspend) + ) + #f + ) + :post enemy-simple-post + ) + +(defstate spinning-down (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (until #f + (if (time-elapsed? (-> self state-time) (seconds 1.2)) + (go-virtual alert) + ) + (let ((f0-1 (* 0.0027777778 (the float (mod (- (current-time) (-> self state-time)) 360))))) + (do-spin self (* 240.0 (- 1.0 f0-1))) + ) + (suspend) + ) + #f + ) + :post enemy-simple-post + ) + +;; WARN: Return type mismatch uint vs none. +(defmethod generate-prim-verts! ((this sew-laser-turret) (arg0 float) (arg1 float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> *x-vector* quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *z-vector* quad)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + ;; og:preserve-this + ;; (s0-0 (new 'stack-no-clear 'rgbaf)) + (s0-0 (new 'static 'rgba)) + ) + 0.0 + (let* ((s2-0 (* arg1 arg1)) + (f30-0 (lerp 128.0 0.0 s2-0)) + (s2-1 (* s2-0 s2-0)) + (s2-2 + (logior (logand (logior (logand (logior (logand (logior (logand s0-0 (the-as uint -256)) + (shr (shl (the int (lerp (the float (-> *color-red* r)) (the float (-> *color-green* r)) s2-1)) 56) 56) + ) + -65281 + ) + (shr (shl (the int (lerp (the float (-> *color-red* g)) (the float (-> *color-green* g)) s2-1)) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (lerp (the float (-> *color-red* b)) (the float (-> *color-green* b)) s2-1)) 56) 40) + ) + (the-as uint #xffffffff00ffffff) + ) + (shr (shl (-> *color-gray* a) 56) 32) + ) + ) + ) + (set! (-> s3-0 y) 0.0) + (set! (-> s3-0 z) 0.0) + (vector-normalize! s3-0 arg0) + (vector-normalize! s5-0 arg0) + (vector+! s4-0 (-> this root trans) s3-0) + (vector+! s4-0 s4-0 s5-0) + (dotimes (v1-39 3) + (let ((a0-21 (-> this strip data (-> this strip num-verts)))) + (set! (-> a0-21 pos quad) (-> s4-0 quad)) + (set! (-> a0-21 stq z) (the-as float #x1)) + ) + (+! (-> this strip num-verts) 1) + ) + (let ((v1-46 (-> this strip data (-> this strip num-verts)))) + (set! (-> v1-46 pos quad) (-> s4-0 quad)) + (set! (-> v1-46 stq z) 0.0) + (set! (-> v1-46 stq x) 0.0) + (set! (-> v1-46 stq y) 0.0) + (set! (-> v1-46 col) (the-as rgba s2-2)) + (set! (-> v1-46 col a) (the int f30-0)) + (let ((v1-47 (&+ v1-46 32))) + (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) + (vector+! s4-0 s4-0 s5-0) + (set! (-> v1-47 pos quad) (-> s4-0 quad)) + (set! (-> v1-47 stq z) 0.0) + (set! (-> v1-47 stq x) 1.0) + (set! (-> v1-47 stq y) 0.0) + (set! (-> v1-47 col) (the-as rgba s2-2)) + (set! (-> v1-47 col a) (the int f30-0)) + (let ((v1-48 (&+ v1-47 32))) + (vector+! s4-0 (-> this root trans) s3-0) + (vector+float*! s4-0 s4-0 s5-0 -1.0) + (set! (-> v1-48 pos quad) (-> s4-0 quad)) + (set! (-> v1-48 stq z) 0.0) + (set! (-> v1-48 stq x) 0.0) + (set! (-> v1-48 stq y) 1.0) + (set! (-> v1-48 col) (the-as rgba s2-2)) + (set! (-> v1-48 col a) (the int f30-0)) + (let ((v1-49 (&+ v1-48 32))) + (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) + (vector+float*! s4-0 s4-0 s5-0 -1.0) + (set! (-> v1-49 pos quad) (-> s4-0 quad)) + (set! (-> v1-49 stq z) 0.0) + (set! (-> v1-49 stq x) 1.0) + (set! (-> v1-49 stq y) 1.0) + (set! (-> v1-49 col) (the-as rgba s2-2)) + (set! (-> v1-49 col a) (the int f30-0)) + (&+ v1-49 32) + ) + ) + ) + ) + ) + ) + ) + ) + (+! (-> this strip num-verts) 4) + (none) + ) + +(defstate alert (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self last-spawn-index) -1) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self strip num-verts) (the-as uint 0)) + 0 + ) + :trans (behavior () + (sew-laser-turret-method-163 self) + (when (-> self was-hit) + (set! (-> self was-hit) #f) + (go-virtual spinning-up) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + (set! (-> self strip num-verts) (the-as uint 0)) + (set! (-> self strip alpha) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> self strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> self strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x80 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (setup-dma-and-tex (-> self strip) (-> self draw)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (set! (-> gp-0 w) (-> self awareness-radius)) + (let* ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384)) + (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-0 384)) + (f30-0 (/ (the float (mod (- (current-time) (-> self state-time)) (-> self ring-rate))) + (the float (-> self ring-rate)) + ) + ) + (s3-1 (min (-> self max-num-rings) (compute-num-rings-to-draw + (- (current-time) (-> self state-time)) + (-> self ring-rate) + f30-0 + (-> self max-num-rings) + ) + ) + ) + ) + (dotimes (s2-0 s3-1) + (let* ((f0-3 (compute-ring-position s2-0 (-> self max-num-rings))) + (f26-0 (compute-ring-size f0-3 f30-0)) + (f28-0 (* (-> self awareness-radius) f26-0)) + ) + (generate-prim-verts! self (* 1.15 f28-0) f26-0) + (when (and (!= (-> self last-spawn-index) s2-0) (< f26-0 0.1)) + (set! (-> self last-spawn-index) s2-0) + (sound-play "las-tur-sonar") + ) + (if (and (< 0.1 f26-0) (= (-> self last-spawn-index) s2-0)) + (set! (-> self last-spawn-index) -1) + ) + (when (< f26-0 0.9) + (countdown (s1-1 s4-0) + (let* ((s0-1 (-> s5-0 s1-1)) + (v1-53 (if (type? s0-1 collide-shape) + s0-1 + ) + ) + ) + (when v1-53 + (let* ((s0-2 (-> v1-53 process)) + (a2-4 (if (type? s0-2 process-focusable) + s0-2 + ) + ) + ) + (when a2-4 + (when (and (!= self a2-4) + (not (focus-test? (the-as process-focusable a2-4) inactive)) + (not (focus-test? (the-as process-focusable a2-4) disable)) + (not (focus-test? (the-as process-focusable a2-4) dead)) + (not (logtest? (process-mask crate) (-> a2-4 mask))) + (not (logtest? (process-mask vehicle) (-> a2-4 mask))) + ) + (if (check-enemy self f28-0 (the-as process-focusable a2-4)) + (go-virtual spinning-up) + ) + ) + ) + ) + ) + ) + ) + (let* ((s0-3 *target*) + (s1-2 (if (type? s0-3 process-focusable) + s0-3 + ) + ) + ) + (when (and s1-2 (< (vector-vector-distance (get-trans s1-2 0) gp-0) (-> gp-0 w))) + (when (and (!= self s1-2) + (not (focus-test? s1-2 inactive)) + (not (focus-test? s1-2 disable)) + (not (focus-test? s1-2 dead)) + (not (logtest? (process-mask crate) (-> s1-2 mask))) + (not (logtest? (process-mask vehicle) (-> s1-2 mask))) + ) + (if (check-enemy self f28-0 s1-2) + (go-virtual spinning-up) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post enemy-simple-post + ) + +(defstate turn-off (sew-laser-turret) + :virtual #t + :code sleep-code + :post ja-post + ) + +(defstate hostile (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (sound-play "las-tur-whoosh") + (set-time! (-> self last-play-time)) + (set! (-> self spin-sound-id) (new-sound-id)) + (set-sewd-light! 1.0) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self flash-state) #f) + (if (not (and (-> self next-state) (= (-> self next-state name) 'hit))) + (set! (-> self was-hit) #f) + ) + (if (nonzero? (-> self spin-sound-id)) + (sound-stop (-> self spin-sound-id)) + ) + (set! (-> self spin-sound-id) (new 'static 'sound-id)) + (set-sewd-light! 0.0) + ) + :trans (behavior () + (sew-laser-turret-method-163 self) + (if (check-suitable-focus self) + (set-time! (-> self state-time)) + ) + (sound-play "las-tur-loop" :id (-> self spin-sound-id)) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-virtual spinning-down) + ) + (when (time-elapsed? (-> self last-play-time) (seconds 0.5)) + (sound-play "las-tur-whoosh") + (set-time! (-> self last-play-time)) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (let ((f30-0 0.0)) + (until #f + (do-spin self 240.0) + (start-firing self #t 5) + (start-firing self #t 7) + (start-firing self #t 9) + (+! f30-0 (seconds-per-frame)) + (suspend) + ) + ) + #f + ) + ) + +(defmethod event-handler ((this sew-laser-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('start) + (let ((v0-0 (the-as object #t))) + (set! (-> this can-shoot) (the-as symbol v0-0)) + v0-0 + ) + ) + (('attack) + (set! (-> this was-hit) #t) + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('stop) + (set! (-> this can-shoot) #f) + #f + ) + (('open) + (go (method-of-object this turn-off)) + ) + (('bonk) + (send-event arg0 'target-mech-get-off (seconds 0.3)) + (send-event arg0 'shove #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) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + #f + ) + (('flash-state) + (-> this flash-state) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +(defstate die (sew-laser-turret) + :virtual #t + :enter (behavior () + (if (nonzero? (-> self spin-sound-id)) + (sound-stop (-> self spin-sound-id)) + ) + (set! (-> self spin-sound-id) (new 'static 'sound-id)) + (on-dying self) + (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 + (set! (-> self hit-points) 0.0) + (play-communicator-speech! (-> *talker-speech* 49)) + ) + :code (behavior () + (new 'stack 'joint-exploder-tuning (the-as uint 0)) + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> *display* camera-clock)) + (sound-play "laser-tur-explo") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (+! (-> gp-1 y) 10240.0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2)) + (spawn (-> self part) gp-1) + (suspend) + ) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +(defmethod init-enemy-collision! ((this sew-laser-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-7 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 -2048.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +(defmethod deactivate ((this sew-laser-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this casing-part)) + (kill-particles (-> this casing-part)) + ) + (if (nonzero? (-> this spin-sound-id)) + (sound-stop (-> this spin-sound-id)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +(defmethod coin-flip? ((this sew-laser-turret)) + #f + ) + +;; WARN: Return type mismatch enemy vs sew-laser-turret. +(defmethod relocate ((this sew-laser-turret) (offset int)) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this casing-part)) + (&+! (-> this casing-part) offset) + ) + (if (nonzero? (-> this strip)) + (&+! (-> this strip) offset) + ) + (the-as sew-laser-turret ((method-of-type enemy relocate) this offset)) + ) + +(defmethod sew-laser-turret-method-160 ((this sew-laser-turret)) + 0 + (none) + ) + +(defmethod init-enemy! ((this sew-laser-turret)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sew-laser-turret-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1518) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1519) this)) + (set! (-> this casing-part) (create-launch-control (-> *part-group-id-table* 1520) this)) + (set! (-> this max-num-rings) + (res-lump-value (-> this entity) 'sdt-num-rings int :default (the-as uint128 2) :time -1000000000.0) + ) + (set! (-> this ring-rate) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'sdt-ring-rate :default 4.0)))) + ) + (set! (-> this awareness-radius) (res-lump-float (-> this entity) 'sdt-awareness-radius :default 90112.0)) + (let ((s5-1 (* 7 (-> this max-num-rings)))) + (set! (-> this strip) + (new 'process 'prim-strip s5-1 (lookup-texture-id-by-name "sonar-wave" (the-as string #f)) (the-as string #f)) + ) + ) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable)) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this was-hit) #f) + 0 + (none) + ) + +(defmethod go-idle2 ((this sew-laser-turret)) + (go (method-of-object this alert)) + ) + +(defmethod go-hostile ((this sew-laser-turret)) + (cond + ((and (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'spinning-up) (= v1-3 'hostile)) + ) + ) + ) + (not (-> this was-hit)) + ) + (go (method-of-object this spinning-up)) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) + ) + ) + ) diff --git a/goal_src/jak3/levels/sewer/sewer-obs.gc b/goal_src/jak3/levels/sewer/sewer-obs.gc index 269a8ab1a1..9dad4d80f0 100644 --- a/goal_src/jak3/levels/sewer/sewer-obs.gc +++ b/goal_src/jak3/levels/sewer/sewer-obs.gc @@ -9,7 +9,7 @@ (defun sewer-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 64 10) + (alloc-nav-network-for-level! *nav-network* 64 10) 0 (none) ) diff --git a/goal_src/jak3/levels/temple/temple-obs.gc b/goal_src/jak3/levels/temple/temple-obs.gc index 9c48c85131..bc14ef356c 100644 --- a/goal_src/jak3/levels/temple/temple-obs.gc +++ b/goal_src/jak3/levels/temple/temple-obs.gc @@ -9,7 +9,7 @@ (defun templea-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 64 10) + (alloc-nav-network-for-level! *nav-network* 64 10) 0 (none) ) diff --git a/goal_src/jak3/levels/tower/tower-obs.gc b/goal_src/jak3/levels/tower/tower-obs.gc index 5e667b155e..97fc52c7bf 100644 --- a/goal_src/jak3/levels/tower/tower-obs.gc +++ b/goal_src/jak3/levels/tower/tower-obs.gc @@ -11,7 +11,7 @@ (defun towera-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 64 10) + (alloc-nav-network-for-level! *nav-network* 64 10) 0 (none) ) diff --git a/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc b/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc index 84992b36a3..7e993e9de6 100644 --- a/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc +++ b/goal_src/jak3/levels/wascity/bbush/des-bush-time-chase.gc @@ -5,5 +5,1832 @@ ;; name in dgo: des-bush-time-chase ;; dgos: LBBTCHA3, LBBTCHA2, LBBTCHA1 +;; +++bb-pickup-type +(defenum bb-pickup-type + :type uint8 + (small) + (medium) + (large) + ) +;; ---bb-pickup-type + + +(define-extern *bb-timer-chase-trail* light-trail-composition) + ;; DECOMP BEGINS +(defpartgroup group-goal-explode + :id 1531 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5054 :period (seconds 20) :length (seconds 0.035)) + (sp-item 5055 :period (seconds 20) :length (seconds 0.035)) + ) + ) + +(defpart 5054 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 10.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.2) + (:fade-g -0.53333336) + (:fade-a -1.7 -1.7) + (:friction 0.93) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpart 5055 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.1) + (:fade-g -0.26666668) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +(defpartgroup group-trail-goal + :id 1532 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5056 :flags (sp7))) + ) + +(defpart 5056 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 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-trail-goal-touched + :id 1533 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5057 :flags (sp7))) + ) + +(defpart 5057 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +(define *tex-time-chase-level-list* (new 'static 'boxed-array :type symbol 'lbbtcha1 'lbbtcha2 'lbbtcha3)) + +(defun find-time-chase-level-name () + (dotimes (gp-0 (-> *tex-time-chase-level-list* length)) + (let ((v1-3 (level-get *level* (-> *tex-time-chase-level-list* gp-0)))) + (if v1-3 + (return v1-3) + ) + ) + ) + (the-as level #f) + ) + +(defpartgroup group-bb-finder + :id 1534 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5058 :flags (sp7))) + ) + +(defpart 5059 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:fade-a -0.055555556) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +(define *bb-alpha* 50) + +(defpartgroup group-bb-finder-nofade + :id 1535 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5060 :flags (sp7)) (sp-item 5058 :flags (sp7))) + ) + +(defpart 5060 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-bb-fader) + ) + ) + +;; WARN: Return type mismatch float vs none. +(defun spt-func-bb-fader ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg2 coneradius) (the float *bb-alpha*)) + (none) + ) + +(defpart 5058 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 2.0) + (:x (meters -2) (meters 4)) + (:y (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 120.0) + (:a 64.0) + (:vel-y (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +(deftype trail-effect (process-drawable) + ((trail handle) + (goal-part sparticle-launch-control) + ) + (:state-methods + idle + dormant + ) + ) + + +(defstate idle (trail-effect) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0)))) + (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + ) + (send-event (handle->process (-> self trail)) 'start-tracking) + ) + (('fadeout) + (send-event (handle->process (-> self trail)) 'fadeout) + ) + ) + ) + :trans (behavior () + '() + ) + :code sleep-code + ) + +(defstate dormant (trail-effect) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-1) quad)) + v0-0 + ) + ) + (('active) + (go-virtual idle) + ) + ) + ) + :trans (behavior () + (spawn (-> self goal-part) (-> self root trans)) + ) + :code sleep-code + ) + +;; WARN: Return type mismatch process-drawable vs trail-effect. +(defmethod relocate ((this trail-effect) (offset int)) + (if (nonzero? (-> this goal-part)) + (&+! (-> this goal-part) offset) + ) + (the-as trail-effect ((method-of-type process-drawable relocate) this offset)) + ) + +(if (or (zero? *bb-timer-chase-trail*) (!= loading-level global)) + (set! *bb-timer-chase-trail* (new 'loading-level 'light-trail-composition)) + ) + +(set! (-> *bb-timer-chase-trail* color-mode) (the-as uint 0)) + +(set! (-> *bb-timer-chase-trail* color-repeat-dist) 40960.0) + +(set! (-> *bb-timer-chase-trail* alpha-1-mode) (the-as uint 0)) + +(set! (-> *bb-timer-chase-trail* alpha-2-mode) (the-as uint 4)) + +(set! (-> *bb-timer-chase-trail* base-alpha) 0.5) + +(set! (-> *bb-timer-chase-trail* alpha-repeat-dist) 1228800.0) + +(set! (-> *bb-timer-chase-trail* width-mode) (the-as uint 2)) + +(set! (-> *bb-timer-chase-trail* base-width) 4096.0) + +(set! (-> *bb-timer-chase-trail* width-repeat-dist) 163840.0) + +(set! (-> *bb-timer-chase-trail* uv-mode) (the-as uint 1)) + +(set! (-> *bb-timer-chase-trail* uv-repeat-dist) 163840.0) + +(set! (-> *bb-timer-chase-trail* lie-mode) (the-as uint 0)) + +(set! (-> *bb-timer-chase-trail* max-age) (seconds 4)) + +(if #f + (set! (-> *bb-timer-chase-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *bb-timer-chase-trail* tex-id) (the-as uint #x100300)) + ) + +(set! (-> *bb-timer-chase-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +(set! (-> *bb-timer-chase-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-red*)) + +(set! (-> *bb-timer-chase-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *bb-timer-chase-trail* alpha-curve-2) (the-as curve2d-piecewise *curve-linear-down*)) + +(set! (-> *bb-timer-chase-trail* zbuffer?) #f) + +(set! (-> *bb-timer-chase-trail* lie-vector quad) (-> *up-vector* quad)) + +(set! (-> *bb-timer-chase-trail* use-tape-mode?) #f) + +(set! (-> *bb-timer-chase-trail* blend-mode) (the-as uint 1)) + +(set! (-> *bb-timer-chase-trail* frame-stagger) (the-as uint 1)) + +(deftype timer-chase-trail (light-trail-tracker-projectile) + ((time-offset time-frame :offset 192) + (start-tracking? symbol) + ) + (:state-methods + fadeout + ) + (:methods + (timer-chase-trail-method-23 (_type_) none) + ) + ) + + +(defmethod timer-chase-trail-method-23 ((this timer-chase-trail)) + (+! (-> this trail start-marker) (the int (* 1200.0 (seconds-per-frame)))) + (if (time-elapsed? (-> this state-time) (seconds 2)) + (go empty-state) + ) + 0 + (none) + ) + +(defstate tracking (timer-chase-trail) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fadeout) + (format #t "fadeout~%") + (go-virtual fadeout) + ) + (('start-tracking) + (let ((v0-1 (the-as object #t))) + (set! (-> self start-tracking?) (the-as symbol v0-1)) + v0-1 + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self start-tracking?) #f) + ) + :trans (behavior () + (let ((s5-0 (find-time-chase-level-name))) + (when s5-0 + (let ((s3-0 (-> s5-0 draw-index)) + (gp-0 4) + ) + (let ((s4-0 (vu1-bucket-map s3-0 gp-0 (merc-mode mercneric2))) + (v1-1 (vu1-bucket-map s3-0 gp-0 (merc-mode mm5))) + ) + (set! (-> self trail strip bucket) s4-0) + (set! (-> self trail strip sink) (the-as uint v1-1)) + ) + (set! (-> self trail strip level) s5-0) + (set! (-> self trail strip texture-index) (the-as uint gp-0)) + ) + (set! (-> self trail strip tex-id) + (lookup-texture-id-by-name "des-bush-timer-chase-trail" (the-as string #f)) + ) + ) + ) + (let ((gp-1 (handle->process (-> self tracked-object)))) + (cond + ((not gp-1) + (go-virtual hang-on) + ) + ((-> self start-tracking?) + (when (time-elapsed? (-> self time-offset) (seconds 0.05)) + (set-time! (-> self time-offset)) + (when (light-trail-tracker-method-17 self (the-as process-focusable gp-1)) + (set! (-> self trail start-marker) (the-as uint 0)) + (set! (-> self trail end-marker) (the-as uint 0)) + (light-trail-method-11 + (-> self trail) + (light-trail-tracker-method-16 self (the-as process-focusable gp-1) (new 'stack-no-clear 'vector)) + 0 + ) + ) + ) + ) + ) + ) + ) + ) + +(defstate fadeout (timer-chase-trail) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (timer-chase-trail-method-23 self) + ) + :code sleep-code + :post light-trail-tracker-common-post + ) + +(defmethod light-trail-tracker-method-19 ((this timer-chase-trail)) + #t + ) + +(defbehavior trail-effect-init-by-other trail-effect ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1534) self)) + (set! (-> self goal-part) (create-launch-control (-> *part-group-id-table* 1532) self)) + (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> gp-1 tracked-obj) (process->handle self)) + (set! (-> gp-1 appearance) *bb-timer-chase-trail*) + (set! (-> *bb-timer-chase-trail* tex-id) + (the-as uint (lookup-texture-id-by-name "des-bush-timer-chase-trail" (the-as string #f))) + ) + (set! (-> gp-1 max-num-crumbs) 500) + (set! (-> gp-1 track-immediately?) #f) + (let* ((v1-18 (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-0 (get-process *default-dead-pool* timer-chase-trail (+ v1-18 8192) 1)) + ) + (set! (-> self trail) (ppointer->handle (when s5-0 + (let ((t9-6 (method-of-type process activate))) + (t9-6 s5-0 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 light-trail-tracker-init-by-other gp-1) + (-> s5-0 ppointer) + ) + ) + ) + ) + ) + (go-virtual dormant) + ) + +(defpartgroup group-bb-goal + :id 1536 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5061)) + ) + +(defpart 5061 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +(deftype bb-goal (process-drawable) + ((activate-radius float) + (sound-id sound-id) + ) + (:state-methods + idle + die + ) + ) + + +(defstate idle (bb-goal) + :virtual #t + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (if (< (vector-vector-distance (target-pos 0) (-> self root trans)) 81920.0) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel bbush) (gui-action queue) "miss001" -99.0 0) + ) + ) + (let ((f0-1 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-1 (-> self activate-radius)) + ) + (when (< f0-1 (* f1-1 f1-1)) + (send-event (ppointer->process (-> self parent)) 'goal) + (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) + ) + (go-virtual die) + ) + ) + ) + :code sleep-code + ) + +(defstate die (bb-goal) + :virtual #t + :enter (behavior () + (cond + ((logtest? (-> *part-group-id-table* 1531 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1531)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1531)) + ) + ) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +(defmethod deactivate ((this bb-goal)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this bb-goal) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +(defbehavior bb-goal-init-by-other bb-goal ((arg0 entity-actor) (arg1 float)) + (process-entity-set! self arg0) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1536) self)) + (set! (-> self activate-radius) arg1) + (go-virtual idle) + ) + +(defpartgroup group-bb-freeze-3 + :id 1537 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5066 :flags (sp6 sp7)) + (sp-item 5067 :flags (sp3 sp7)) + (sp-item 5068 :flags (sp6 sp7)) + (sp-item 5069 :flags (sp3) :binding 5062) + (sp-item 5062 :flags (sp2 sp3) :binding 5063) + (sp-item 5069 :flags (sp3) :binding 5064) + (sp-item 5064 :flags (sp2 sp3) :binding 5063) + (sp-item 5069 :flags (sp3) :binding 5065) + (sp-item 5065 :flags (sp2 sp3) :binding 5063) + ) + ) + +(defpart 5066 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5067 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 4.8)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5070) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5070 + :init-specs ((:rot-z (degrees 1)) (:next-time (seconds 0.167)) (:next-launcher 5071)) + ) + +(defpart 5071 + :init-specs ((:rot-z (degrees -9)) (:next-time (seconds 0.335)) (:next-launcher 5072)) + ) + +(defpart 5072 + :init-specs ((:rot-z (degrees -8)) (:next-time (seconds 0.167)) (:next-launcher 5073)) + ) + +(defpart 5073 + :init-specs ((:rot-z (degrees -18)) (:next-time (seconds 0.335)) (:next-launcher 5074)) + ) + +(defpart 5074 + :init-specs ((:rot-z (degrees -17)) (:next-time (seconds 0.167)) (:next-launcher 5075)) + ) + +(defpart 5075 + :init-specs ((:rot-z (degrees -27.000002)) (:next-time (seconds 0.335)) (:next-launcher 5076)) + ) + +(defpart 5076 + :init-specs ((:rot-z (degrees -26.000002)) (:next-time (seconds 0.167)) (:next-launcher 5077)) + ) + +(defpart 5077 + :init-specs ((:rot-z (degrees -36)) (:next-time (seconds 0.335)) (:next-launcher 5078)) + ) + +(defpart 5078 + :init-specs ((:rot-z (degrees -35)) (:next-time (seconds 0.167)) (:next-launcher 5079)) + ) + +(defpart 5079 + :init-specs ((:rot-z (degrees -45)) (:next-time (seconds 0.335)) (:next-launcher 5070)) + ) + +(defpart 5068 + :init-specs ((:texture (time-bubble lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5069 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5062 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:y (meters 2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5064 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:y (meters -2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5065 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5063 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-bb-freeze-2 + :id 1538 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5083 :flags (sp6 sp7)) + (sp-item 5084 :flags (sp3 sp7)) + (sp-item 5085 :flags (sp6 sp7)) + (sp-item 5086 :flags (sp3) :binding 5080) + (sp-item 5080 :flags (sp2 sp3) :binding 5081) + (sp-item 5086 :flags (sp3) :binding 5082) + (sp-item 5082 :flags (sp2 sp3) :binding 5081) + ) + ) + +(defpart 5083 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5084 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 4.8)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5087) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5087 + :init-specs ((:rot-z (degrees 1)) (:next-time (seconds 0.167)) (:next-launcher 5088)) + ) + +(defpart 5088 + :init-specs ((:rot-z (degrees -9)) (:next-time (seconds 0.335)) (:next-launcher 5089)) + ) + +(defpart 5089 + :init-specs ((:rot-z (degrees -8)) (:next-time (seconds 0.167)) (:next-launcher 5090)) + ) + +(defpart 5090 + :init-specs ((:rot-z (degrees -18)) (:next-time (seconds 0.335)) (:next-launcher 5091)) + ) + +(defpart 5091 + :init-specs ((:rot-z (degrees -17)) (:next-time (seconds 0.167)) (:next-launcher 5092)) + ) + +(defpart 5092 + :init-specs ((:rot-z (degrees -27.000002)) (:next-time (seconds 0.335)) (:next-launcher 5093)) + ) + +(defpart 5093 + :init-specs ((:rot-z (degrees -26.000002)) (:next-time (seconds 0.167)) (:next-launcher 5094)) + ) + +(defpart 5094 + :init-specs ((:rot-z (degrees -36)) (:next-time (seconds 0.335)) (:next-launcher 5095)) + ) + +(defpart 5095 + :init-specs ((:rot-z (degrees -35)) (:next-time (seconds 0.167)) (:next-launcher 5096)) + ) + +(defpart 5096 + :init-specs ((:rot-z (degrees -45)) (:next-time (seconds 0.335)) (:next-launcher 5087)) + ) + +(defpart 5085 + :init-specs ((:texture (time-bubble lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5086 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5080 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5082 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 180)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5081 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +(defpartgroup group-bb-freeze + :id 1539 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5100 :flags (sp6 sp7)) + (sp-item 5101 :flags (sp3 sp7)) + (sp-item 5102 :flags (sp6 sp7)) + (sp-item 5103 :flags (sp3) :binding 5097) + (sp-item 5097 :flags (sp2 sp3) :binding 5098) + (sp-item 5103 :flags (sp3) :binding 5099) + ) + ) + +(defpart 5100 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 16.0) + (:b 255.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5101 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 4.8)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 16.0) + (:b 255.0) + (:a 255.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5104) + (:rotate-y (degrees 0)) + ) + ) + +(defpart 5104 + :init-specs ((:rot-z (degrees 1)) (:next-time (seconds 0.167)) (:next-launcher 5105)) + ) + +(defpart 5105 + :init-specs ((:rot-z (degrees -9)) (:next-time (seconds 0.335)) (:next-launcher 5106)) + ) + +(defpart 5106 + :init-specs ((:rot-z (degrees -8)) (:next-time (seconds 0.167)) (:next-launcher 5107)) + ) + +(defpart 5107 + :init-specs ((:rot-z (degrees -18)) (:next-time (seconds 0.335)) (:next-launcher 5108)) + ) + +(defpart 5108 + :init-specs ((:rot-z (degrees -17)) (:next-time (seconds 0.167)) (:next-launcher 5109)) + ) + +(defpart 5109 + :init-specs ((:rot-z (degrees -27.000002)) (:next-time (seconds 0.335)) (:next-launcher 5110)) + ) + +(defpart 5110 + :init-specs ((:rot-z (degrees -26.000002)) (:next-time (seconds 0.167)) (:next-launcher 5111)) + ) + +(defpart 5111 + :init-specs ((:rot-z (degrees -36)) (:next-time (seconds 0.335)) (:next-launcher 5112)) + ) + +(defpart 5112 + :init-specs ((:rot-z (degrees -35)) (:next-time (seconds 0.167)) (:next-launcher 5113)) + ) + +(defpart 5113 + :init-specs ((:rot-z (degrees -45)) (:next-time (seconds 0.335)) (:next-launcher 5104)) + ) + +(defpart 5102 + :init-specs ((:texture (time-bubble lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5103 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +(defpart 5097 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:y (meters 4)) + (:z (meters 0.2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +(defun-debug bb-pickup-type->string ((arg0 bb-pickup-type)) + (case arg0 + (((bb-pickup-type large)) + "large" + ) + (((bb-pickup-type small)) + "small" + ) + (((bb-pickup-type medium)) + "medium" + ) + (else + "*unknown*" + ) + ) + ) + +;; WARN: Return type mismatch texture-id vs none. +(defun set-time-chase-particle-texture () + (let ((gp-0 (find-time-chase-level-name))) + (when gp-0 + (set! (-> *part-id-table* 5067 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5066 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5068 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble" gp-0 7)) + ) + (set! (-> *part-id-table* 5069 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "hotdot" gp-0 7)) + ) + (set! (-> *part-id-table* 5062 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5064 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5065 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5063 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5084 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5083 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5085 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble" gp-0 7)) + ) + (set! (-> *part-id-table* 5086 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "hotdot" gp-0 7)) + ) + (set! (-> *part-id-table* 5080 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5082 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5081 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5101 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5100 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5102 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble" gp-0 7)) + ) + (set! (-> *part-id-table* 5103 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "hotdot" gp-0 7)) + ) + (set! (-> *part-id-table* 5097 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + ) + ) + (none) + ) + +(deftype bb-freeze (process-drawable) + ((launch-pos vector :inline) + (activate-radius float) + (freeze-time float) + (freeze-pickup-radius float) + (bb-pickup-type bb-pickup-type) + ) + (:state-methods + idle + dormant + die + ) + ) + + +(defstate dormant (bb-freeze) + :virtual #t + :trans (behavior () + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 (-> self activate-radius)) + ) + (if (< f0-0 (* f1-0 f1-0)) + (go-virtual idle) + ) + ) + ) + :code sleep-code + ) + +(defstate idle (bb-freeze) + :virtual #t + :enter (behavior () + '() + ) + :exit (behavior () + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + ) + :trans (behavior () + (let ((f0-0 (-> self activate-radius))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (go-virtual dormant) + ) + ) + (spawn (-> self part) (-> self root trans)) + (let ((f0-3 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 (-> self freeze-pickup-radius)) + ) + (when (< f0-3 (* f1-0 f1-0)) + (send-event (ppointer->process (-> self parent)) 'freeze (-> self freeze-time)) + (case (-> self bb-pickup-type) + (((bb-pickup-type small)) + (sound-play "small-pickup") + ) + (((bb-pickup-type medium)) + (sound-play "medium-pickup") + ) + (((bb-pickup-type large)) + (sound-play "large-pickup") + ) + ) + (go-virtual die) + ) + ) + ) + :code sleep-code + ) + +(defstate die (bb-freeze) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +(defmethod deactivate ((this bb-freeze)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this bb-freeze) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 32) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +(defbehavior bb-freeze-init-by-other bb-freeze ((arg0 entity-actor) (arg1 object) (arg2 float) (arg3 float) (arg4 float)) + (process-entity-set! self arg0) + (set! (-> self bb-pickup-type) (bb-pickup-type small)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self activate-radius) arg2) + (set! (-> self freeze-time) arg3) + (set! (-> self freeze-pickup-radius) arg4) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1539) self)) + (go-virtual dormant) + ) + +(deftype a-bb-freeze (bb-freeze) + () + ) + + +(defbehavior a-bb-freeze-init-by-other a-bb-freeze ((arg0 entity-actor) (arg1 object) (arg2 float) (arg3 float) (arg4 float)) + (stack-size-set! (-> self main-thread) 32) + (process-entity-set! self arg0) + (set! (-> self bb-pickup-type) (bb-pickup-type medium)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self activate-radius) arg2) + (set! (-> self freeze-time) arg3) + (set! (-> self freeze-pickup-radius) arg4) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1538) self)) + (go-virtual dormant) + ) + +(deftype b-bb-freeze (bb-freeze) + () + ) + + +(defbehavior b-bb-freeze-init-by-other b-bb-freeze ((arg0 entity-actor) (arg1 object) (arg2 float) (arg3 float) (arg4 float)) + (stack-size-set! (-> self main-thread) 32) + (process-entity-set! self arg0) + (set! (-> self bb-pickup-type) (bb-pickup-type large)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self activate-radius) arg2) + (set! (-> self freeze-time) arg3) + (set! (-> self freeze-pickup-radius) arg4) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1537) self)) + (go-virtual dormant) + ) + +(deftype freeze-time-hud (hud-goal) + () + ) + + +(defmethod draw ((this freeze-time-hud)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 447 70) + (format (clear (-> this strings 0 text)) "~2,'0D" (/ (-> this values 0 current) 100)) + (format (clear (-> this strings 2 text)) ":") + (format (clear (-> this strings 3 text)) "~2,'0D" (mod (-> this values 0 current) 100)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -15 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 2 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 3 pos)) (the-as vector4w (-> this sprites)) 15 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + (let ((s5-3 (new + 'stack + 'font-context + *font-default-matrix* + (+ (-> this strings 1 pos x) -80) + (+ (-> this strings 1 pos y) -20) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> s5-3 flags) (font-flags kerning middle large)) + (let ((v1-6 s5-3)) + (set! (-> v1-6 width) (the float 160)) + ) + (let ((v1-7 s5-3)) + (set! (-> v1-7 height) (the float 80)) + ) + (let ((v1-8 s5-3)) + (set! (-> v1-8 scale) 0.6) + ) + (let ((a0-16 s5-3)) + (set! (-> a0-16 color) (-> this strings 1 color)) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0861) #f)) + (s4-0 *temp-string* s5-3 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +(defmethod update-values! ((this freeze-time-hud)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +(defmethod init-callback ((this freeze-time-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 2) + (set! (-> this strings 2 scale) 0.5) + (set! (-> this strings 2 flags) (font-flags kerning middle large)) + (set! (-> this strings 2 color) (font-color red)) + (alloc-string-if-needed this 3) + (set! (-> this strings 3 scale) 0.5) + (set! (-> this strings 3 flags) (font-flags kerning middle large)) + (set! (-> this strings 3 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) + (let ((s5-0 format) + (gp-1 (clear (-> this strings 1 text))) + (s4-0 "") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0861) #f)) + *temp-string* + (s5-0 gp-1 s4-0) + ) + 0 + (none) + ) + +(deftype task-manager-bbush-timer-chase (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (freeze-time float) + (path-pos float) + (trail-effect handle) + (trans vector :inline) + (freeze-activation-radius float) + (goal-activation-radius float) + (total-time float) + (touched symbol) + (freeze-time-1 float :offset 308) + (freeze-time-2 float) + (freeze-time-3 float) + (freeze-pickup-radius float) + (freeze-time-hud handle) + (sound-id sound-id) + (color-flash-time time-frame) + ) + (:methods + (get-entity-name (_type_) string) + (set-sbanks (_type_) none) + (get-node-array (_type_) (array timer-chase-node)) + ) + ) + + +(defstate resolution (task-manager-bbush-timer-chase) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +(defmethod set-sbanks ((this task-manager-bbush-timer-chase)) + (cond + ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'music 'wastimer 0.0 0) + ) + (else + (set-setting! 'extra-bank '((desert2 bbush1) (nest2 bbush1)) 0.0 0) + (set-setting! 'music 'destimer 0.0 0) + ) + ) + 0 + (none) + ) + +(defmethod get-entity-name ((this task-manager-bbush-timer-chase)) + (format 0 "tag2~%") + "tmanager-3" + ) + +(defmethod get-node-array ((this task-manager-bbush-timer-chase)) + *timer-chase-path-0* + ) + +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-bbush-timer-chase)) + (local-vars (s4-0 object) (sv-96 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-time-chase-particle-texture) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this freeze-time) 0.0) + (set-sbanks this) + (set! (-> this trail-effect) + (ppointer->handle (process-spawn trail-effect *null-vector* :name "trail-effect" :to this)) + ) + (set! (-> this freeze-time-hud) + (ppointer->handle (process-spawn freeze-time-hud :init hud-init-by-other :name "freeze-time-hud" :to this)) + ) + (if (handle->process (-> this freeze-time-hud)) + (send-event (handle->process (-> this freeze-time-hud)) 'force-hide) + ) + (set! (-> *game-info* score) 0.0) + (set! (-> this touched) #f) + (let ((s5-3 (entity-by-name (get-entity-name this)))) + (set! s4-0 + (when s5-3 + (set! (-> this entity) (the-as entity-actor s5-3)) + (set! (-> this freeze-activation-radius) (res-lump-float s5-3 'freezer-activation-radius :default 40960.0)) + (set! (-> this freeze-pickup-radius) (res-lump-float s5-3 'freeze-pickup-radius :default 10.0)) + (set! (-> this goal-activation-radius) (res-lump-float s5-3 'goal-activation-radius :default 40960.0)) + (set! (-> this total-time) (res-lump-float s5-3 'time-limit :default 10.0)) + (set! (-> this freeze-time) 0.0) + (set! (-> this freeze-time-1) (res-lump-float s5-3 'freeze-time :default 10.0)) + (set! (-> this freeze-time-2) (res-lump-float s5-3 'a-freeze-time :default 10.0)) + (set! (-> this freeze-time-3) (res-lump-float s5-3 'b-freeze-time :default 10.0)) + (set! sv-96 (new 'static 'res-tag)) + (set! s4-0 (res-lump-data s5-3 'actor-groups pointer :tag-ptr (& sv-96))) + (cond + ((and (the-as pointer s4-0) (nonzero? (-> sv-96 elt-count))) + (format 0 "elt: ~d~%" (the-as pointer s4-0)) + (format 0 "elt2: ~d~%" (-> sv-96 elt-count)) + (set! (-> this actor-group-count) (the-as int (-> sv-96 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) s4-0)) + s4-0 + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (none) + ) + +(defstate active (task-manager-bbush-timer-chase) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('freeze) + (let ((f0-0 (the-as float (-> block param 0)))) + (+! (-> self time-limit) (the int (* 300.0 f0-0))) + (+! (-> self freeze-time) f0-0) + (when (-> self freeze-time-hud) + (cond + ((= f0-0 (-> self freeze-time-1)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color cyan) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color cyan) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color cyan) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color cyan) + ) + ) + ((= f0-0 (-> self freeze-time-2)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color yellow) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color yellow) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color yellow) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color yellow) + ) + ) + ((= f0-0 (-> self freeze-time-3)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color red) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color red) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color red) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color red) + ) + ) + ) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self color-flash-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + (('goal) + (send-event (handle->process (-> self trail-effect)) 'fadeout) + (send-event self 'complete) + ) + (('start) + (when (and (nonzero? (-> self actor-group)) (-> self touched)) + (dotimes (gp-0 3) + (dotimes (s5-0 (length (-> self actor-group gp-0))) + (let ((s4-0 (-> self actor-group gp-0 data s5-0))) + (cond + ((and (zero? s5-0) (zero? gp-0)) + (process-spawn bb-goal (-> s4-0 actor) (-> self goal-activation-radius) :name "bb-goal" :to self) + ) + (else + (cond + ((zero? gp-0) + (process-spawn + bb-freeze + (-> s4-0 actor) + (get-node-array self) + (-> self freeze-activation-radius) + (-> self freeze-time-1) + (-> self freeze-pickup-radius) + :name "bb-freeze" + :to self + ) + ) + ((= gp-0 1) + (process-spawn + a-bb-freeze + (-> s4-0 actor) + (get-node-array self) + (-> self freeze-activation-radius) + (-> self freeze-time-2) + (-> self freeze-pickup-radius) + :name "a-bb-freeze" + :to self + ) + ) + ((= gp-0 2) + (process-spawn + b-bb-freeze + (-> s4-0 actor) + (get-node-array self) + (-> self freeze-activation-radius) + (-> self freeze-time-3) + (-> self freeze-pickup-radius) + :name "b-bb-freeze" + :to self + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (-> self touched) + (+! (-> self path-pos) (* 0.1 (seconds-per-frame))) + (when (< (the float (+ (length (-> self actor-group 0)) -1)) (-> self path-pos)) + (set! (-> self path-pos) (the float (+ (length (-> self actor-group 0)) -1))) + (send-event self 'complete) + ) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (local-vars (sv-208 (function vector float vector)) (sv-224 vector) (sv-240 (function vector float vector))) + (seek! (-> self freeze-time) 0.0 (seconds-per-frame)) + (when (time-elapsed? (-> self color-flash-time) (seconds 1)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color green) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color green) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color green) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color green) + ) + ) + (if (and (-> self touched) (= (-> self freeze-time) 0.0)) + (hud-timer-handler self) + ) + (set! (-> *game-info* score) (* 100.0 (-> self freeze-time))) + (dotimes (gp-0 (+ (length (-> self actor-group (+ (-> self actor-group-count) -1))) -1)) + (when (and (>= (-> self path-pos) (the float gp-0)) (>= (the float (+ gp-0 1)) (-> self path-pos))) + (let ((v1-22 (-> self actor-group (+ (-> self actor-group-count) -1) data gp-0)) + (a1-23 (-> self actor-group (+ (-> self actor-group-count) -1) data (+ gp-0 1))) + ) + (when (and v1-22 a1-23) + (let ((s3-0 (-> v1-22 actor)) + (s4-0 (-> a1-23 actor)) + (s5-0 (new 'stack 'cubic-curve)) + ) + (new 'stack-no-clear 'vector) + (when (and s3-0 s4-0) + (let ((s2-0 s5-0) + (s1-0 (method-of-type cubic-curve cubic-curve-method-9)) + (s0-0 (-> s3-0 trans)) + ) + (set! sv-208 vector-normalize!) + (let* ((a0-26 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (a1-26 204800.0) + (s3-1 (sv-208 a0-26 a1-26)) + ) + (set! sv-224 (-> s4-0 trans)) + (set! sv-240 vector-normalize!) + (let* ((a0-28 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat))) + (a1-28 204800.0) + (t0-0 (sv-240 a0-28 a1-28)) + ) + (s1-0 s2-0 s0-0 s3-1 sv-224 t0-0) + ) + ) + ) + (cubic-curve-method-10 s5-0 (-> self trans) (- (-> self path-pos) (the float gp-0))) + ) + ) + ) + ) + ) + ) + (send-event (handle->process (-> self trail-effect)) 'trans (-> self trans)) + (cond + ((-> self touched) + (+! (-> self path-pos) (* 2.0 (seconds-per-frame))) + ) + (else + (set-time! (-> self start-time)) + (when (< (vector-vector-distance (target-pos 0) (-> self trans)) 20480.0) + (set! (-> self touched) #t) + (if (handle->process (-> self freeze-time-hud)) + (send-event (handle->process (-> self freeze-time-hud)) 'force-show) + ) + (sound-play "start-pickup") + (send-event self 'start) + (set! (-> self time-limit) (the-as time-frame (the int (* 300.0 (-> self total-time))))) + (send-event (handle->process (-> self trail-effect)) 'active) + ) + (if (< 409600.0 (vector-vector-distance (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +(deftype task-manager-bbush-timer-chase-2 (task-manager-bbush-timer-chase) + () + ) + + +(defmethod get-entity-name ((this task-manager-bbush-timer-chase-2)) + "t-manager-9" + ) + +(defmethod get-node-array ((this task-manager-bbush-timer-chase-2)) + *timer-chase-path-1* + ) + +(deftype task-manager-bbush-timer-chase-3 (task-manager-bbush-timer-chase) + () + ) + + +(defmethod get-entity-name ((this task-manager-bbush-timer-chase-3)) + "t-manager-11" + ) + +(defmethod set-sbanks ((this task-manager-bbush-timer-chase-3)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'ctytimer 0.0 0) + 0 + (none) + ) diff --git a/goal_src/jak3/levels/wascity/bbush/timer-path.gc b/goal_src/jak3/levels/wascity/bbush/timer-path.gc index 63fc9fda78..b4cce1e790 100644 --- a/goal_src/jak3/levels/wascity/bbush/timer-path.gc +++ b/goal_src/jak3/levels/wascity/bbush/timer-path.gc @@ -7,3 +7,613 @@ ;; DECOMP BEGINS +(deftype timer-chase-node (structure) + ((pos vector :inline) + (is-spawn? symbol) + ) + ) + + +(define *timer-chase-path-0* (new 'static 'boxed-array :type timer-chase-node + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11662866.0 :y 221034.5 :z 4081106.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11621823.0 :y 179699.72 :z 4237392.5 :w 1.0) + :is-spawn? #t + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11689940.0 :y 135861.05 :z 4420852.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11793282.0 :y 107726.85 :z 4585757.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11855254.0 :y 99959.6 :z 4681030.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11943933.0 :y 97535.59 :z 4734605.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12076113.0 :y 104384.1 :z 4851341.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12142958.0 :y 123763.09 :z 4950751.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12147382.0 :y 136815.83 :z 5067283.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12146604.0 :y 159249.2 :z 5145066.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12183426.0 :y 180995.69 :z 5215026.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12254655.0 :y 196199.62 :z 5272861.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12293773.0 :y 189432.62 :z 5314436.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12348617.0 :y 176897.64 :z 5358877.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12412761.0 :y 167104.92 :z 5400984.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12465477.0 :y 161542.55 :z 5465701.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12546824.0 :y 159456.45 :z 5498960.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12689732.0 :y 140263.02 :z 5554666.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12903298.0 :y 123974.04 :z 5641174.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12972070.0 :y 135716.05 :z 5688564.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13058250.0 :y 145242.94 :z 5748612.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13152867.0 :y 159722.7 :z 5775522.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13203822.0 :y 174543.67 :z 5817916.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13260878.0 :y 195249.36 :z 5861293.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13314946.0 :y 210316.5 :z 5885541.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13373233.0 :y 217735.98 :z 5943704.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13451548.0 :y 216344.58 :z 6013952.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13530069.0 :y 214853.22 :z 6049544.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13562960.0 :y 215314.44 :z 6071213.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13625792.0 :y 212812.6 :z 6103693.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13850744.0 :y 166247.62 :z 6141952.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14093310.0 :y 136698.27 :z 6154853.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14336366.0 :y 88510.875 :z 6271466.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14436309.0 :y 78679.66 :z 6702815.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14454700.0 :y 93333.914 :z 6825819.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14475752.0 :y 84293.63 :z 7018044.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14500042.0 :y 93302.375 :z 7144528.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14537480.0 :y 53508.504 :z 7338678.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14634554.0 :y 76670.56 :z 7735499.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14679488.0 :y 107677.695 :z 7989124.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14732121.0 :y 133817.95 :z 8211536.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14755674.0 :y 151914.5 :z 8290425.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14780946.0 :y 166041.19 :z 8354282.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14814164.0 :y 176115.72 :z 8404867.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14825796.0 :y 187811.44 :z 8480274.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14833539.0 :y 198363.95 :z 8553265.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14862006.0 :y 211248.33 :z 8626010.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14873351.0 :y 234013.08 :z 8708708.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14891824.0 :y 263639.44 :z 8799844.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14902064.0 :y 281009.78 :z 8866404.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14931146.0 :y 291222.3 :z 8915433.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 15000983.0 :y 292676.4 :z 9001941.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 15092365.0 :y 268016.44 :z 9085458.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 15121978.0 :y 201281.12 :z 9407608.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14825509.0 :y 173629.44 :z 9635592.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14484436.0 :y 217798.25 :z 9952745.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14411650.0 :y 154336.88 :z 10427799.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14292211.0 :y 150299.44 :z 10556249.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14224954.0 :y 144734.2 :z 10602289.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14041004.0 :y 123476.79 :z 10684454.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13806302.0 :y 111191.66 :z 10796971.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13717215.0 :y 134289.0 :z 10767071.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13600561.0 :y 147339.67 :z 10717918.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13400347.0 :y 142908.62 :z 10718082.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13205583.0 :y 118439.12 :z 10817779.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12929184.0 :y 92757.195 :z 10957534.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12691903.0 :y 97937.0 :z 11117442.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12407109.0 :y 101740.55 :z 11141773.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12103472.0 :y 100392.96 :z 11221439.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11971909.0 :y 102868.17 :z 11217998.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11832891.0 :y 91679.54 :z 11195634.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11742042.0 :y 94658.56 :z 11258591.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11696862.0 :y 102268.11 :z 11372950.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11579963.0 :y 119266.1 :z 11690472.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11407398.0 :y 93837.31 :z 11992348.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11290170.0 :y 133498.06 :z 12324902.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11377128.0 :y 156357.02 :z 12513809.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11404654.0 :y 172135.62 :z 12633782.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11402442.0 :y 184381.84 :z 12769768.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11380487.0 :y 188515.94 :z 12890847.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11305490.0 :y 186036.64 :z 13021058.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11237210.0 :y 175171.58 :z 13141440.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11165202.0 :y 156057.19 :z 13254571.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10993866.0 :y 123564.85 :z 13377943.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10821752.0 :y 113522.69 :z 13547520.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10723734.0 :y 101874.07 :z 13768947.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10618303.0 :y 88096.36 :z 13900346.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10603886.0 :y 88534.22 :z 14080242.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10628707.0 :y 105060.35 :z 14243550.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10679498.0 :y 112945.15 :z 14354348.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10737375.0 :y 112455.27 :z 14461826.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10778293.0 :y 108901.58 :z 14529943.0 :w 1.0) + :is-spawn? #f + ) + ) + ) + +(define *timer-chase-path-1* (new 'static 'boxed-array :type timer-chase-node + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9191299.0 :y 103415.805 :z 254029.83 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9221978.0 :y 91179.414 :z 224322.36 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9224353.0 :y 84404.63 :z 180507.44 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9202604.0 :y 77736.76 :z 131431.62 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9187817.0 :y 60112.895 :z 51052.133 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9167992.0 :y 44095.49 :z -60146.895 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9165248.0 :y 32416.154 :z -225542.14 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9206167.0 :y 30528.307 :z -294044.88 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9195395.0 :y 30397.645 :z -379459.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9161728.0 :y 31997.543 :z -467340.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9094961.0 :y 41626.008 :z -530640.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9067477.0 :y 38292.273 :z -598134.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9041303.0 :y 36459.316 :z -659652.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9031268.0 :y 35156.79 :z -723029.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9045932.0 :y 36037.02 :z -790945.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9030490.0 :y 51421.184 :z -855944.8 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8968886.0 :y 67532.39 :z -898604.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8928172.0 :y 77001.93 :z -908590.7 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8817252.0 :y 90379.47 :z -955645.56 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8716081.0 :y 109561.04 :z -1041792.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8663040.0 :y 114063.77 :z -1116819.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8614582.0 :y 113920.82 :z -1228095.1 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8520456.0 :y 114579.87 :z -1336909.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8401590.0 :y 130158.59 :z -1428471.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8293989.0 :y 145850.38 :z -1459523.1 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8195931.0 :y 154208.67 :z -1437929.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8165743.5 :y 153191.22 :z -1375674.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8123677.5 :y 154375.38 :z -1284136.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8117288.0 :y 152758.27 :z -1240698.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8049416.5 :y 141521.31 :z -1116901.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7989165.0 :y 135367.06 :z -1074011.8 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7871405.0 :y 127031.3 :z -1070362.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7798495.5 :y 125217.586 :z -1111867.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7722064.5 :y 121516.445 :z -1174691.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7653579.0 :y 118677.914 :z -1259282.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7596071.5 :y 114234.164 :z -1293344.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7499611.0 :y 118466.97 :z -1312587.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7437761.5 :y 124832.16 :z -1291738.8 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7393401.0 :y 131270.25 :z -1253359.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7289977.0 :y 146183.78 :z -1204772.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7238900.0 :y 147383.9 :z -1194675.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7146740.0 :y 136803.53 :z -1187081.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7002684.0 :y 149120.61 :z -1160261.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6972210.0 :y 163582.77 :z -1148182.1 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6938909.5 :y 170448.08 :z -1137737.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6896557.0 :y 169711.61 :z -1123724.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6839499.0 :y 158490.62 :z -1119690.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6732962.0 :y 142339.28 :z -1126231.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6666893.5 :y 143119.97 :z -1122746.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6595419.0 :y 151475.4 :z -1109647.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6467951.5 :y 153472.61 :z -1085357.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6399548.0 :y 154023.11 :z -1079910.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6343228.0 :y 162228.64 :z -1066917.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6283016.5 :y 174840.62 :z -1052802.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6199172.0 :y 196677.22 :z -1045180.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6166936.5 :y 209845.86 :z -1048538.75 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6127656.0 :y 213454.44 :z -1059573.4 :w 1.0) + :is-spawn? #f + ) + ) + ) diff --git a/goal_src/jak3/levels/wascity/mission-squad-control-h.gc b/goal_src/jak3/levels/wascity/mission-squad-control-h.gc index a3de9ffd08..92e65cbe49 100644 --- a/goal_src/jak3/levels/wascity/mission-squad-control-h.gc +++ b/goal_src/jak3/levels/wascity/mission-squad-control-h.gc @@ -5,5 +5,118 @@ ;; name in dgo: mission-squad-control-h ;; dgos: DESRESC, WWD, CWI +;; +++city-attacker-info-flag +(defenum city-attacker-info-flag + :type uint16 + :bitfield #t + (cai0 0) + (cai1 1) + (cai2 2) + (cai3 3) + ) +;; ---city-attacker-info-flag + + +;; +++city-hatred-info-flag +(defenum city-hatred-info-flag + :type uint16 + :bitfield #t + ) +;; ---city-hatred-info-flag + + ;; DECOMP BEGINS +(deftype city-attacker-info (structure) + ((proc handle) + (enemy handle) + (next-update-target-time time-frame) + (flags city-attacker-info-flag) + (num-current-attackers uint8) + (max-num-attackers uint8) + (self-type int16) + (enemy-type int16) + (self-index int16) + (enemy-index int16) + (callback function) + (hatred-map-callback function) + ) + (:methods + (city-attacker-info-method-9 () none) + (city-attacker-info-method-10 () none) + ) + ) + + +(deftype city-attacker-cache (structure) + ((pos vector) + (proc basic) + (attackable? symbol) + ) + ) + + +(deftype city-hatred-info (structure) + ((hatred float) + (max-consider-dist float) + (hatred-dist float) + (dist-scale float) + (attacker-scale float) + (flags city-hatred-info-flag) + (index uint8) + (pad uint8) + ) + ) + + +(deftype city-attacker-array (inline-array-class) + ((data city-attacker-info :inline :dynamic) + ) + ) + + +(set! (-> city-attacker-array heap-base) (the-as uint 48)) + +(deftype city-hatred-array (inline-array-class) + ((data city-hatred-info :inline :dynamic) + ) + ) + + +(set! (-> city-hatred-array heap-base) (the-as uint 24)) + +(deftype city-attacker-cache-array (inline-array-class) + ((data city-attacker-cache :inline :dynamic) + ) + ) + + +(set! (-> city-attacker-cache-array heap-base) (the-as uint 12)) + +(deftype mission-squad-control (basic) + ((attackers city-attacker-array) + (unused-list basic) + (hatred-vals basic) + (hatred-indices basic) + (attacker-cache city-attacker-cache-array) + (target-attacker city-attacker-info) + (max-num-object-types int32) + ) + (:methods + (mission-squad-control-method-9 () none) + (mission-squad-control-method-10 () none) + (mission-squad-control-method-11 () none) + (mission-squad-control-method-12 () none) + (mission-squad-control-method-13 () none) + (mission-squad-control-method-14 () none) + (mission-squad-control-method-15 () none) + (mission-squad-control-method-16 () none) + (mission-squad-control-method-17 () none) + (mission-squad-control-method-18 () none) + (mission-squad-control-method-19 () none) + (mission-squad-control-method-20 () none) + (mission-squad-control-method-21 () none) + (mission-squad-control-method-22 () none) + (mission-squad-control-method-23 () none) + ) + ) diff --git a/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc b/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc index 249e4dc689..81db6e35a3 100644 --- a/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/anim/joint-mod-h_REF.gc @@ -277,7 +277,7 @@ This is used to make jak look toward an enemy, for example." "Set up this joint-mod to modify the given joint of the given process. Will attach automatically if attached flag is set." (set! (-> this flags) flags) (set! (-> this node-index) (the-as int bone-idx)) - (set! (-> this proc) (the-as (pointer process-drawable) (process->ppointer proc))) + (set! (-> this proc) (process->ppointer proc)) (if (logtest? flags (joint-mod-base-flags attached)) (attach-callback this) ) diff --git a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc index 05399735eb..a81ead466f 100644 --- a/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc +++ b/test/decompiler/reference/jak3/engine/collide/collide-edge-grab_REF.gc @@ -17,7 +17,7 @@ (set! (-> *edge-grab-info* found-edge?) #f) (mem-copy! (the-as pointer (-> *collide-edge-work* spec)) (the-as pointer arg1) 320) (let ((s5-0 *collide-edge-work*)) - (set! (-> s5-0 process) (the-as (pointer process-drawable) (process->ppointer this))) + (set! (-> s5-0 process) (process->ppointer this)) (set! (-> s5-0 num-verts) (the-as uint 0)) (set! (-> s5-0 num-edges) (the-as uint 0)) (set! (-> s5-0 num-tris) (the-as uint 0)) @@ -789,7 +789,3 @@ (set! (-> v1-2 touch-hook) nothing) (set! (-> v1-2 active-hook) nothing) ) - - - - 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 6a389c9b00..93518b2295 100644 --- a/test/decompiler/reference/jak3/engine/game/game-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/game/game-h_REF.gc @@ -7,7 +7,8 @@ This handles drawing, collision, animation, navigation, particles, sounds, physics, etc. The actual child classes will add most of the functionality, and this just serves as a common container for references to the `-control` objects for this object." - ((self process-drawable :override) + ((self process-drawable :override) + (ppointer (pointer process-drawable) :override) (root trsqv) (node-list cspace-array) (draw draw-control) diff --git a/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc b/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc index 88f34e929a..3398f1b227 100644 --- a/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/gfx/texture/texture-anim-h_REF.gc @@ -131,7 +131,8 @@ ;; definition of type texture-anim-array (deftype texture-anim-array (array) - () + ((array-data texture-anim :dynamic) + ) (:methods (init! (_type_) _type_) (clear! (_type_) _type_) diff --git a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc index f2dfc0622b..594dfef8e8 100644 --- a/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc +++ b/test/decompiler/reference/jak3/engine/math/matrix-compose_REF.gc @@ -99,10 +99,10 @@ ;; definition for function matrix-f-compose ;; INFO: Used lq/sq -(defun matrix-f-compose ((arg0 matrix) (arg1 vector) (arg2 float)) +(defun matrix-f-compose ((arg0 matrix) (arg1 vector)) (set! (-> arg0 fvec quad) (-> arg1 quad)) - (let ((a2-1 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) - (matrix-f-u-compose arg0 arg1 a2-1) + (let ((a2-0 (vector-get-unique! (new 'stack-no-clear 'vector) arg1))) + (matrix-f-u-compose arg0 arg1 a2-0) ) arg0 ) diff --git a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc index 654457273c..166185caae 100644 --- a/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc +++ b/test/decompiler/reference/jak3/engine/physics/trajectory_REF.gc @@ -154,7 +154,7 @@ ;; INFO: Used lq/sq (defmethod initialize ((this impact-control) (arg0 process-drawable) (arg1 int) (arg2 float) (arg3 collide-spec)) (set! (-> this start-time) (the-as uint (current-time))) - (set! (-> this process) (the-as (pointer process-drawable) (process->ppointer arg0))) + (set! (-> this process) (process->ppointer arg0)) (set! (-> this joint) arg1) (set! (-> this radius) arg2) (set! (-> this collide-with) (logclear arg3 (collide-spec water))) 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 dc4f32f6d2..672c3536c3 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 @@ -1642,7 +1642,7 @@ ;; definition for method 0 of type top-anim-joint-control (defmethod new top-anim-joint-control ((allocation symbol) (type-to-make type) (arg0 process-drawable)) (let ((gp-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) - (set! (-> gp-0 process) (the-as (pointer process-drawable) (process->ppointer arg0))) + (set! (-> gp-0 process) (process->ppointer arg0)) (set! (-> gp-0 interp-select 0) (the-as uint (-> arg0 skel interp-select 0))) (set! (-> gp-0 interp-select 1) (the-as uint (-> arg0 skel interp-select 1))) (set! (-> gp-0 base-anim-speed) 1.0) 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 4cd3104d4e..14c6dca0ce 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 @@ -3,8 +3,9 @@ ;; definition of type process-focusable (deftype process-focusable (process-drawable) - ((self process-focusable :override) - (root collide-shape :override) + ((self process-focusable :override) + (ppointer (pointer process-focusable) :override) + (root collide-shape :override) (focus-status focus-status) ) (:methods diff --git a/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc b/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc new file mode 100644 index 0000000000..cf5a388c8f --- /dev/null +++ b/test/decompiler/reference/jak3/engine/process-drawable/simple-focus_REF.gc @@ -0,0 +1,73 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type simple-focus +(deftype simple-focus (process-focusable) + ((first-time? symbol) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type simple-focus +(defmethod inspect ((this simple-focus)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tfirst-time?: ~A~%" (-> this first-time?)) + (label cfg-4) + this + ) + +;; definition for method 21 of type simple-focus +(defmethod get-trans ((this simple-focus) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +;; definition for method 12 of type simple-focus +(defmethod run-logic? ((this simple-focus)) + "Should this process be run? Checked by execute-process-tree." + (when (-> this first-time?) + (set! (-> this first-time?) #f) + #t + ) + ) + +;; failed to figure out what this is: +(defstate idle (simple-focus) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('move-trans) + (let ((v0-0 (-> self root trans))) + (set! (-> v0-0 quad) (-> (the-as vector (-> block param 0)) quad)) + v0-0 + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for function simple-focus-init-by-other +(defbehavior simple-focus-init-by-other simple-focus () + (let ((gp-0 (new 'process 'trsqv))) + (set! (-> self root) (the-as collide-shape gp-0)) + (vector-identity! (-> gp-0 scale)) + (quaternion-identity! (-> gp-0 quat)) + ) + (logclear! (-> self mask) (process-mask enemy)) + (set! (-> self first-time?) #t) + (set! (-> self event-hook) (-> (method-of-object self idle) event)) + (go-virtual idle) + ) + + + + 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 index dac7c95e4f..90a79c4742 100644 --- a/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/board/target-board_REF.gc @@ -844,7 +844,7 @@ (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 process) (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)) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc index 61f9c19544..85869a70b3 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-dark-shot_REF.gc @@ -700,13 +700,8 @@ ) (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)) (let ((gp-1 (new 'stack-no-clear 'matrix))) - (let* ((t9-10 vector-normalize-copy!) - (a0-12 (new 'stack-no-clear 'vector)) - (a1-4 (-> self root transv)) - (a2-3 1.0) - (a1-5 (t9-10 a0-12 a1-4 a2-3)) - ) - (matrix-f-compose gp-1 a1-5 a2-3) + (let ((a1-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0))) + (matrix-f-compose gp-1 a1-5) ) (matrix->quaternion (-> self root quat) gp-1) ) diff --git a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc index 8dfbbdf7c5..7ce203e94e 100644 --- a/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/gun/gun-yellow-shot_REF.gc @@ -1129,29 +1129,23 @@ (set! (-> s4-1 quad) (-> self gun fire-dir-out quad)) (set! (-> s4-1 y) 0.0) (vector-normalize! s4-1 1.0) - (let ((t9-9 draw-beam) - (a0-38 (-> *part-id-table* 297)) - (a1-9 (-> gp-0 fire-point)) - (a2-5 s4-1) - ) - (t9-9 a0-38 a1-9 a2-5 #f) - (let ((s5-1 (new 'stack-no-clear 'matrix))) - (matrix-f-compose s5-1 s4-1 (the-as float a2-5)) - (set! (-> s5-1 trans quad) (-> gp-0 fire-point quad)) - (let ((v1-62 - (if (logtest? (-> *part-group-id-table* 100 flags) (sp-group-flag sp13)) - (part-tracker-spawn - part-tracker-subsampler - :to *entity-pool* - :group (-> *part-group-id-table* 100) - :mat-joint s5-1 - ) - (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 100) :mat-joint s5-1) + (draw-beam (-> *part-id-table* 297) (-> gp-0 fire-point) s4-1 #f) + (let ((s5-1 (new 'stack-no-clear 'matrix))) + (matrix-f-compose s5-1 s4-1) + (set! (-> s5-1 trans quad) (-> gp-0 fire-point quad)) + (let ((v1-62 + (if (logtest? (-> *part-group-id-table* 100 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 100) + :mat-joint s5-1 ) - ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 100) :mat-joint s5-1) + ) ) - (send-event (ppointer->process v1-62) 'clock self) - ) + ) + (send-event (ppointer->process v1-62) 'clock self) ) ) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc index 22b7cd3644..c5c502b4cf 100644 --- a/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-darkjak_REF.gc @@ -685,7 +685,7 @@ (defbehavior target-darkjak-setup target ((arg0 symbol)) (when (zero? (-> self darkjak)) (set! (-> self darkjak) (new 'process 'darkjak-info)) - (set! (-> self darkjak process) (the-as (pointer target) (process->ppointer self))) + (set! (-> self darkjak process) (process->ppointer self)) (let* ((v1-4 (-> self game)) (a0-5 (+ (-> v1-4 attack-id) 1)) ) diff --git a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc index dcfa545a46..a9633f5e68 100644 --- a/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-gun_REF.gc @@ -205,7 +205,7 @@ (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 process) (process->ppointer self)) (set! (-> self gun strip) #f) (set! (-> self gun uv-slide) 0.0) (set! (-> self gun gun) (the-as (pointer gun) #f)) 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 352d6a845d..7bce6a67f4 100644 --- a/test/decompiler/reference/jak3/engine/target/target-h_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-h_REF.gc @@ -4,6 +4,7 @@ ;; definition of type target (deftype target (process-focusable) ((self target :override) + (ppointer (pointer target) :override) (fact fact-info-target :override) (control control-info :overlay-at root) (skel2 joint-control) diff --git a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc index c6a78221e0..446dc90c00 100644 --- a/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc +++ b/test/decompiler/reference/jak3/engine/target/target-lightjak_REF.gc @@ -998,7 +998,7 @@ (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))) + (set! (-> self lightjak process) (process->ppointer self)) (let* ((v1-4 (-> self game)) (a0-5 (+ (-> v1-4 attack-id) 1)) ) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc index 4cc1b6fe95..560b1e4db7 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle-h_REF.gc @@ -1035,7 +1035,7 @@ (vehicle-method-88 (_type_ vehicle-controls) none) (init-reverse (_type_ vehicle-controls) none) (control-hook-ai (_type_ vehicle-controls) none) - (control-hook-player (_type_ vehicle-controls) none) + (control-hook-player (_type_) none) (vehicle-method-92 (_type_ vehicle-controls) none) (vehicle-method-93 (_type_) none) (vehicle-method-94 (_type_) none) diff --git a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc index c0bb7de206..8f58538ea0 100644 --- a/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/city/traffic/vehicle/vehicle_REF.gc @@ -215,7 +215,7 @@ ;; definition for method 91 of type vehicle ;; WARN: Return type mismatch int vs none. -(defmethod control-hook-player ((this vehicle) (arg0 vehicle-controls)) +(defmethod control-hook-player ((this vehicle)) (let ((gp-0 (new 'stack-no-clear 'vehicle-controls))) (mem-set32! (&-> gp-0 steering) 6 0) (cond @@ -1402,7 +1402,3 @@ (defmethod vehicle-method-143 ((this vehicle) (arg0 process)) 0 ) - - - - diff --git a/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc new file mode 100644 index 0000000000..03b03b72b0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-field_REF.gc @@ -0,0 +1,383 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type comb-field +(deftype comb-field (process-drawable) + ((root collide-shape :override) + (pass pickup-type) + (incoming-attack-id uint32) + (next-message-time time-frame) + (message int32) + (plane plane :inline) + (color vector :inline) + (target-pos vector :inline) + (hum-sound-id sound-id) + (flash float) + (touch-count int32) + (touch-time time-frame) + (breach symbol) + ) + (:state-methods + idle-close + ) + (:methods + (init-collision! (_type_ path-control float) none) + (on-jak-touch (_type_) none) + (play-hum (_type_) none) + ) + ) + +;; definition for method 3 of type comb-field +(defmethod inspect ((this comb-field)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpass: ~D~%" (-> this pass)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tnext-message-time: ~D~%" (-> this next-message-time)) + (format #t "~2Tmessage: ~D~%" (-> this message)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tcolor: #~%" (-> this color)) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Thum-sound-id: ~D~%" (-> this hum-sound-id)) + (format #t "~2Tflash: ~f~%" (-> this flash)) + (format #t "~2Ttouch-count: ~D~%" (-> this touch-count)) + (format #t "~2Ttouch-time: ~D~%" (-> this touch-time)) + (format #t "~2Tbreach: ~A~%" (-> this breach)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-field security-wall security-wall-lod0-jg security-wall-idle-ja + ((security-wall-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100.1) + ) + +;; definition for method 22 of type comb-field +;; WARN: Return type mismatch int vs none. +(defmethod on-jak-touch ((this comb-field)) + (when (time-elapsed? (-> this touch-time) (seconds 0.25)) + (set-time! (-> this touch-time)) + (sound-play "barrier-deflect") + ) + 0 + (none) + ) + +;; definition for method 23 of type comb-field +;; WARN: Return type mismatch int vs none. +(defmethod play-hum ((this comb-field)) + (let ((v1-0 *target*)) + (when v1-0 + (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> v1-0 control trans))) + (f1-0 655360.0) + ) + (cond + ((< f0-0 (* f1-0 f1-0)) + (if (zero? (-> this hum-sound-id)) + (set! (-> this hum-sound-id) (new-sound-id)) + ) + (sound-play "barrier-loop" :id (-> this hum-sound-id)) + ) + (else + (sound-stop (-> this hum-sound-id)) + (set! (-> this hum-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle-close (comb-field) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (local-vars (v0-0 object)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (case message + (('on) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (-> self root backup-collide-as)) + (set! v0-0 (-> self root backup-collide-with)) + (set! (-> v1-2 prim-core collide-with) (the-as collide-spec v0-0)) + ) + v0-0 + ) + (('off) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + (('attack) + (let ((v1-5 (the-as attack-info (-> block param 1)))) + (when (!= (-> v1-5 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (-> v1-5 id)) + (let* ((gp-0 proc) + (s4-0 (if (type? gp-0 process-drawable) + gp-0 + ) + ) + ) + (when s4-0 + (let ((gp-1 (process-spawn + manipy + :init manipy-init + (-> (the-as process-drawable s4-0) root trans) + (-> self entity) + (art-group-get-by-name *level* "skel-generic-ripples" (the-as (pointer level) #f)) + #f + 0 + :name "manipy" + :to self + :stack-size #x20000 + ) + ) + ) + (when gp-1 + (send-event (ppointer->process gp-1) 'anim-mode 'play1) + (send-event (ppointer->process gp-1) 'speed 1.5) + (send-event (ppointer->process gp-1) 'art-joint-anim "generic-ripples-idle" 0) + (set-vector! (-> (the-as process-drawable (-> gp-1 0)) root scale) 1.0 1.0 1.0 1.0) + (quaternion-rotate-local-x! (-> (the-as process-drawable (-> gp-1 0)) root quat) (-> self root quat) -16384.0) + (let ((v1-43 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a0-22 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a1-17 *up-vector*)) + (let ((a2-8 8192.0)) + (.mov vf7 a2-8) + ) + (.lvf vf5 (&-> a1-17 quad)) + ) + (.lvf vf4 (&-> a0-22 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-43 quad) vf6) + ) + (let ((f0-6 (vector4-dot (-> (the-as process-drawable (-> gp-1 0)) root trans) (the-as vector (-> self plane))))) + (let ((v1-50 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a0-26 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a1-18 (-> self plane))) + (let ((a2-9 (- f0-6))) + (.mov vf7 a2-9) + ) + (.lvf vf5 (&-> a1-18 quad)) + ) + (.lvf vf4 (&-> a0-26 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-50 quad) vf6) + ) + (let ((v1-53 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a0-29 (-> (the-as process-drawable (-> gp-1 0)) root trans))) + (let ((a1-19 (-> self plane))) + (let ((a2-11 (the-as float (if (< 0.0 f0-6) + -2048.0 + 2048.0 + ) + ) + ) + ) + (.mov vf7 a2-11) + ) + (.lvf vf5 (&-> a1-19 quad)) + ) + (.lvf vf4 (&-> a0-29 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-53 quad) vf6) + ) + ) + (send-event (ppointer->process gp-1) 'trans-hook (lambda () #f)) + ) + ) + ) + ) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (set! v0-0 (+ (-> self touch-count) 1)) + (set! (-> self touch-count) (the-as int v0-0)) + v0-0 + ) + ) + ) + (('touched) + (when (zero? (-> self touch-count)) + (+! (-> self touch-count) 1) + (set! (-> self flash) 0.375) + ) + (+! (-> self touch-count) 1) + (let* ((gp-3 proc) + (v1-75 (if (type? gp-3 process-focusable) + gp-3 + ) + ) + ) + (when v1-75 + (let* ((s5-1 (-> (the-as process-drawable v1-75) root)) + (gp-4 (if (type? s5-1 collide-shape) + s5-1 + ) + ) + ) + (when gp-4 + (if (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec jak)) + (on-jak-touch self) + ) + (when (logtest? (-> (the-as collide-shape gp-4) root-prim prim-core collide-as) (collide-spec vehicle-sphere)) + (when (not (-> self breach)) + (sound-play "barrier-cross") + (set! v0-0 #t) + (set! (-> self breach) (the-as symbol v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :trans (behavior () + (play-hum self) + ) + :code (behavior () + (until #f + (let ((f30-0 (calc-fade-from-fog (-> self root trans))) + (a0-1 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a0-1 (-> self color) f30-0) + (set-comb-field-color! a0-1) + (vector-float*! gp-0 (-> self color) (* f30-0 (-> self flash))) + (seek! (-> self flash) 0.0 (seconds-per-frame)) + (if (nonzero? (-> self touch-count)) + (+! (-> self touch-count) -1) + ) + (set-comb-field-flash! gp-0) + ) + (suspend) + ) + #f + ) + ) + +;; definition for method 21 of type comb-field +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod init-collision! ((this comb-field) (arg0 path-control) (arg1 float)) + (let ((s3-0 (new 'static 'vector)) + (s4-0 (new 'static 'vector)) + ) + 0.0 + (get-point-in-path! arg0 s3-0 0.0 'exact) + (get-point-in-path! arg0 s4-0 1.0 'exact) + (* 0.5 (vector-vector-distance s3-0 s4-0)) + (let ((s2-1 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s2-1 penetrated-by) (penetrate vehicle)) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s2-1 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle blocking-plane camera-blocker)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set! (-> s2-1 total-prims) (the-as uint 1)) + (set! (-> s2-1 root-prim) v1-8) + ) + (set! (-> s2-1 nav-radius) (* 0.75 (-> s2-1 root-prim local-sphere w))) + (let ((v1-11 (-> s2-1 root-prim))) + (set! (-> s2-1 backup-collide-as) (-> v1-11 prim-core collide-as)) + (set! (-> s2-1 backup-collide-with) (-> v1-11 prim-core collide-with)) + ) + (set! (-> this root) s2-1) + ) + (let ((s2-2 (new 'stack-no-clear 'matrix)) + (s1-0 (-> this root)) + ) + (vector+! (-> s1-0 trans) s3-0 s4-0) + (vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5) + (vector-! (-> s2-2 rvec) s4-0 s3-0) + (let ((f30-1 (vector-normalize-ret-len! (-> s2-2 rvec) 1.0))) + (set! (-> s1-0 scale x) (* 0.00024414062 f30-1)) + (set! (-> s1-0 scale y) (* 0.00024414062 arg1)) + (set! (-> s1-0 scale z) 1.0) + (set! (-> s2-2 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (vector-cross! (-> s2-2 fvec) (-> s2-2 rvec) (-> s2-2 uvec)) + (vector-normalize! (-> s2-2 fvec) 1.0) + (matrix->quaternion (-> s1-0 quat) s2-2) + (set! (-> this plane quad) (-> s2-2 fvec quad)) + (set! (-> this plane w) (- (vector-dot (-> s2-2 fvec) (-> this root trans)))) + (let ((v0-8 (-> this root root-prim local-sphere))) + (set! (-> v0-8 x) 0.0) + (set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1))) + (set! (-> v0-8 z) 0.0) + (let ((f0-18 0.5) + (f1-5 (* f30-1 f30-1)) + (f2-1 arg1) + ) + (set! (-> v0-8 w) (* f0-18 (sqrtf (+ f1-5 (* f2-1 f2-1))))) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 11 of type comb-field +(defmethod init-from-entity! ((this comb-field) (arg0 entity-actor)) + (set! (-> this breach) #f) + (set! (-> this hum-sound-id) (new 'static 'sound-id)) + (set! (-> this pass) (res-lump-value arg0 'pickup-type pickup-type :time -1000000000.0)) + (let ((v1-3 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f))) + (set! (-> this path) v1-3) + (if (or (not v1-3) (!= (-> v1-3 curve num-cverts) 2)) + (go process-drawable-art-error "bad path") + ) + ) + (init-collision! this (-> this path) 204800.0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-field" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this root event-self) 'touched) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this draw status) (draw-control-status disable-fog)) + (set-comb-field-texture-masks! (the-as vector (-> this draw mgeo header texture-usage-group data 4))) + (set-vector! (-> this color) 0.0 0.5 1.0 1.0) + (set-comb-field-color! (-> this color)) + (set-vector! (-> this draw color-mult) 0.0 0.0 0.0 0.0) + (set-vector! (-> this draw color-emissive) 1.0 1.0 1.0 1.0) + (transform-post) + (go (method-of-object this idle-close)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc new file mode 100644 index 0000000000..be0a516e6d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-mood_REF.gc @@ -0,0 +1,308 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type comb-states +(deftype comb-states (structure) + () + ) + +;; definition for method 3 of type comb-states +(defmethod inspect ((this comb-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'comb-states) + (label cfg-4) + this + ) + +;; definition for function init-mood-comb +(defun init-mood-comb ((arg0 mood-context)) + (let ((v1-0 (-> arg0 light-group 1))) + (let ((a0-1 (-> v1-0 dir0))) + (set! (-> a0-1 direction x) 0.0) + (set! (-> a0-1 direction y) 1.0) + (set! (-> a0-1 direction z) 0.0) + (set! (-> a0-1 direction w) 0.0) + ) + (set-vector! (-> v1-0 dir0 color) 0.667 0.667 0.667 1.0) + (set-vector! (-> v1-0 ambi color) 0.333 0.333 0.333 1.0) + (set! (-> v1-0 dir0 extra x) 0.75) + (set! (-> v1-0 dir1 extra x) 0.0) + (set! (-> v1-0 dir2 extra x) 0.0) + (set! (-> v1-0 ambi extra x) 0.25) + ) + ) + +;; definition for function update-mood-comb +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-comb time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (let* ((s5-0 (camera-pos)) + (f0-1 (fmin + (vector-vector-distance s5-0 (new 'static 'vector :x 368640.0 :z 40960.0 :w 1.0)) + (vector-vector-distance s5-0 (new 'static 'vector :x 14274560.0 :y -167936.0 :z 614400.0 :w 1.0)) + ) + ) + ) + (when (< f0-1 716800.0) + (let ((f30-1 (fmax 0.0 (fmin 1.0 (* 0.000009765625 (- 819200.0 f0-1))))) + (a1-4 (-> arg0 current-fog)) + (s5-1 (-> arg0 current-fog fog-dists)) + ) + (vector4-lerp! + (the-as vector a1-4) + (the-as vector a1-4) + (new 'static 'vector :x 30.0 :y 80.0 :z 150.0 :w 128.0) + f30-1 + ) + (vector4-lerp! s5-1 s5-1 (new 'static 'vector :x 262144.0 :y 937984.0 :z 255.0 :w 200.0) f30-1) + ) + ) + ) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (let* ((s5-2 (-> *display* part-clock frame-counter)) + (f0-6 (* 1310.72 (the float (mod s5-2 25)))) + (f30-2 (sin f0-6)) + (f0-8 (* 109.22667 (the float (mod s5-2 600)))) + (s5-3 (/ (mod s5-2 125) 25)) + ) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) f30-2) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.15 (cos f0-8)))) + (set! (-> arg0 times 3 w) (if (zero? s5-3) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 4 w) (if (= s5-3 1) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 5 w) (if (= s5-3 2) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 6 w) (if (= s5-3 3) + f30-2 + 0.0 + ) + ) + (set! (-> arg0 times 7 w) (if (= s5-3 4) + f30-2 + 0.0 + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for symbol *comb-field-texture-anim-array*, type (texture-anim-array texture-anim) +(define *comb-field-texture-anim-array* + (the-as (texture-anim-array texture-anim) + (new 'static 'texture-anim-array :type texture-anim + (new 'static 'texture-anim + :num-layers #x2 + :func #f + :init-func #f + :tex #f + :tex-name "security-env-dest" + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 4800.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :clamp (new 'static 'gs-clamp :wms (gs-tex-wrap-mode clamp) :wmt (gs-tex-wrap-mode clamp)) + :data (new 'static 'array texture-anim-layer 2 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 4800.0 + :tex-name "security-env-uscroll" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0 0.5)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 4.0 0.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 4800.0 + :tex-name "security-env-uscroll" + :test (new 'static 'gs-test :ate #x1 :afail #x3 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0 3.0)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + (new 'static 'texture-anim + :num-layers #x3 + :func #f + :init-func #f + :tex #f + :tex-name "security-dot-dest" + :color (new 'static 'rgba :a #x80) + :frame-delta 300.0 + :frame-mod 600.0 + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x1 :d #x1) + :data (new 'static 'array texture-anim-layer 6 + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 4800.0 + :tex-name "common-white" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "security-dot-src" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.015625)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 1.0078125 0.015625)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + (new 'static 'texture-anim-layer + :func-id 'default-texture-anim-layer-func + :init-func #f + :tex #f + :end-time 600.0 + :tex-name "security-dot-src" + :test (new 'static 'gs-test :ate #x1 :afail #x1 :zte #x1 :ztst (gs-ztest always)) + :alpha (new 'static 'gs-alpha :b #x2 :d #x1) + :start-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :start-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :start-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :start-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.0078125 0.140625)) + :start-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :end-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-offset (new 'static 'vector2 :data (new 'static 'array float 2 0.5 0.5)) + :end-st-scale (new 'static 'vector2 :data (new 'static 'array float 2 1.0 1.0)) + :end-st-offset (new 'static 'vector2 :data (new 'static 'array float 2 2.0078125 0.140625)) + :end-qs (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + ) + ) + ) + +;; definition for function set-comb-field-color! +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defun set-comb-field-color! ((arg0 vector)) + (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 0))) + (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 1 start-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 1 end-color quad) (-> arg0 quad)) + ) + (let ((v1-5 (-> *comb-field-texture-anim-array* array-data 1))) + (set! (-> v1-5 data 1 start-color quad) (-> arg0 quad)) + (set! (-> v1-5 data 1 end-color quad) (-> arg0 quad)) + (set! (-> v1-5 data 2 start-color quad) (-> arg0 quad)) + (set! (-> v1-5 data 2 end-color quad) (-> arg0 quad)) + ) + (none) + ) + +;; definition for function set-comb-field-flash! +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defun set-comb-field-flash! ((arg0 vector)) + (let ((v1-1 (-> *comb-field-texture-anim-array* array-data 1))) + (set! (-> v1-1 data 0 start-color quad) (-> arg0 quad)) + (set! (-> v1-1 data 0 end-color quad) (-> arg0 quad)) + ) + (none) + ) + +;; definition for function set-comb-field-texture-masks! +;; INFO: Used lq/sq +(defun set-comb-field-texture-masks! ((arg0 vector)) + (local-vars (a3-3 uint128) (a3-4 uint128)) + (let ((v1-3 (-> *comb-field-texture-anim-array* array-data 0 data 0 tex)) + (a1-3 (-> *comb-field-texture-anim-array* array-data 1 data 1 tex)) + ) + (when (and v1-3 a1-3) + (dotimes (a2-1 3) + (let ((a3-2 (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16))))) + (t0-2 (-> v1-3 masks data a2-1 mask quad)) + ) + (.por a3-3 a3-2 t0-2) + ) + (let ((t0-5 (-> a1-3 masks data a2-1 mask quad))) + (.por a3-4 a3-3 t0-5) + ) + (set! (-> (the-as (pointer uint128) (+ (the-as uint arg0) (* a2-1 16)))) a3-4) + ) + #f + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc new file mode 100644 index 0000000000..a44932da30 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-obs_REF.gc @@ -0,0 +1,1346 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type comb-elevator +(deftype comb-elevator (elevator) + () + ) + +;; definition for method 3 of type comb-elevator +(defmethod inspect ((this comb-elevator)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-elevator min-elevator min-elevator-lod0-jg min-elevator-idle-ja + ((min-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + ) + +;; definition for method 31 of type comb-elevator +(defmethod get-art-group ((this comb-elevator)) + (art-group-get-by-name *level* "skel-comb-elevator" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type comb-elevator +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this comb-elevator)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 3) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 29 of type comb-elevator +;; WARN: Return type mismatch sound-spec vs none. +(defmethod init-bounce-params! ((this comb-elevator)) + (call-parent-method this) + (setup-masks (-> this draw) 1 2) + (set! (-> this draw light-index) (the-as uint 1)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "min-elevator" :group 0)) + (none) + ) + +;; definition for method 34 of type comb-elevator +;; WARN: Return type mismatch int vs none. +(defmethod base-plat-method-34 ((this comb-elevator)) + 0 + (none) + ) + +;; definition of type comb-pillar +(deftype comb-pillar (process-focusable) + ((center-pos vector :inline) + (attack-vel vector :inline) + (exploder-params joint-exploder-static-params) + (exploder-skel skeleton-group) + (exploder-anim uint32) + (hit-points float) + (incoming-attack-id int32) + ) + (:state-methods + idle + explode + ) + (:methods + (update-fade (_type_) none) + (set-cspec! (_type_) none) + (go-explode (_type_) none) + (set-attack-vel! (_type_ vector) none) + (on-attack (_type_ process attack-info object) symbol) + (on-impulse (_type_ rigid-body-impact) symbol) + ) + ) + +;; definition for method 3 of type comb-pillar +(defmethod inspect ((this comb-pillar)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tcenter-pos: #~%" (-> this center-pos)) + (format #t "~2Tattack-vel: #~%" (-> this attack-vel)) + (format #t "~2Texploder-params: ~A~%" (-> this exploder-params)) + (format #t "~2Texploder-skel: ~A~%" (-> this exploder-skel)) + (format #t "~2Texploder-anim: ~D~%" (-> this exploder-anim)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-pillar comb-pillar comb-pillar-lod0-jg comb-pillar-idle-ja + ((comb-pillar-lod0-mg (meters 999999))) + :bounds (static-spherem 0 70 0 75) + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-pillar-explode comb-pillar comb-pillar-explode-lod0-jg comb-pillar-explode-idle-ja + ((comb-pillar-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6.5 0 7) + ) + +;; definition for symbol *comb-pillar-explode-params*, type joint-exploder-static-params +(define *comb-pillar-explode-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for method 11 of type comb-pillar +(defmethod init-from-entity! ((this comb-pillar) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 286720.0 0.0 307200.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 286720.0 0.0 307200.0) + ) + (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! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 1))) + (vector-y-quaternion! (-> s5-1 0) (-> this root quat)) + (vector+float*! (-> this center-pos) (-> this root trans) (-> s5-1 0) 286720.0) + ) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-pillar" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this hit-points) 8.0) + (set! (-> this exploder-params) *comb-pillar-explode-params*) + (set! (-> this exploder-skel) + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-pillar-explode" (the-as (pointer level) #f))) + ) + (set! (-> this exploder-anim) (the-as uint 7)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +;; definition for method 31 of type comb-pillar +;; WARN: Return type mismatch int vs none. +(defmethod set-cspec! ((this comb-pillar)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; definition for method 30 of type comb-pillar +;; WARN: Return type mismatch int vs none. +(defmethod update-fade ((this comb-pillar)) + (let ((f0-2 (fmax 0.0 (+ -81920.0 (vector-vector-distance (-> this center-pos) (camera-pos))))) + (f1-0 40960.0) + ) + (cond + ((< f0-2 f1-0) + (logior! (-> this draw status) (draw-control-status force-fade)) + (set! (-> this draw force-fade) (the-as uint (the int (* 128.0 (/ f0-2 f1-0))))) + ) + (else + (logclear! (-> this draw status) (draw-control-status force-fade)) + ) + ) + ) + (ja-post) + 0 + (none) + ) + +;; definition for method 32 of type comb-pillar +;; WARN: Return type mismatch int vs none. +(defmethod go-explode ((this comb-pillar)) + (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 + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this explode)) + 0 + (none) + ) + +;; definition for method 27 of type comb-pillar +(defmethod get-inv-mass ((this comb-pillar)) + 0.125 + ) + +;; definition for method 33 of type comb-pillar +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-attack-vel! ((this comb-pillar) (arg0 vector)) + (set! (-> this attack-vel quad) (-> arg0 quad)) + (if (< 81920.0 (vector-length (-> this attack-vel))) + (vector-normalize! (-> this attack-vel) 81920.0) + ) + 0 + (none) + ) + +;; definition for method 34 of type comb-pillar +(defmethod on-attack ((this comb-pillar) (arg0 process) (arg1 attack-info) (arg2 object)) + (vector-reset! (-> this attack-vel)) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (f30-0 0.0) + ) + (vector-reset! a1-1) + (when (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0) + (set-attack-vel! this a1-1) + ) + (when (logtest? (attack-mask damage) (-> arg1 mask)) + (if (>= (-> arg1 damage) 2.0) + (set! f30-0 (-> arg1 damage)) + ) + ) + (set! (-> this hit-points) (- (-> this hit-points) f30-0)) + ) + (if (< (-> this hit-points) 0.0) + (go-explode this) + ) + #t + ) + +;; definition for method 35 of type comb-pillar +(defmethod on-impulse ((this comb-pillar) (arg0 rigid-body-impact)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse)) + (set-attack-vel! this a1-1) + ) + (when (< 286720.0 (-> arg0 impulse)) + (go-explode this) + #t + ) + ) + +;; failed to figure out what this is: +(defstate idle (comb-pillar) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((a1-1 (-> block param 0))) + (on-impulse self (the-as rigid-body-impact a1-1)) + ) + ) + (('attack) + (let ((s4-0 (the-as object (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (!= (-> (the-as attack-info s4-0) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (the-as int (-> (the-as attack-info s4-0) id))) + (on-attack self proc (the-as attack-info s4-0) (-> block param 0)) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (update-fade self) + ) + ) + +;; failed to figure out what this is: +(defstate explode (comb-pillar) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (sound-play "sentry-explode") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> gp-1 duration) (seconds 4)) + (set! (-> gp-1 gravity) -163840.0) + (set! (-> gp-1 rot-speed) 5.0) + (vector+! + (-> gp-1 fountain-rand-transv-lo) + (new 'static 'vector :x -40960.0 :y 40960.0 :z -40960.0 :w 1.0) + (-> self attack-vel) + ) + (vector+! + (-> gp-1 fountain-rand-transv-hi) + (new 'static 'vector :x 40960.0 :y 122880.0 :z 40960.0 :w 1.0) + (-> self attack-vel) + ) + (process-spawn + joint-exploder + (-> self exploder-skel) + (-> self exploder-anim) + gp-1 + (-> self exploder-params) + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 2)) + (suspend) + ) + ) + (cleanup-for-death self) + ) + :post #f + ) + +;; definition of type comb-block +(deftype comb-block (process-focusable) + ((attack-vel vector :inline) + (exploder-params joint-exploder-static-params) + (exploder-skel skeleton-group) + (exploder-anim uint32) + (hit-points float) + (incoming-attack-id int32) + (parts sparticle-launch-control 4) + ) + (:state-methods + idle + explode + ) + (:methods + (spawn-parts (_type_) none) + (set-cspec! (_type_) none) + (go-explode (_type_) none) + (set-attack-vel! (_type_ vector) none) + (on-attack (_type_ process attack-info object) symbol) + (on-impact (_type_ rigid-body-impact) symbol) + ) + ) + +;; definition for method 3 of type comb-block +(defmethod inspect ((this comb-block)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tattack-vel: #~%" (-> this attack-vel)) + (format #t "~2Texploder-params: ~A~%" (-> this exploder-params)) + (format #t "~2Texploder-skel: ~A~%" (-> this exploder-skel)) + (format #t "~2Texploder-anim: ~D~%" (-> this exploder-anim)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tparts[4] @ #x~X~%" (-> this parts)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-block comb-obstacle comb-obstacle-lod0-jg comb-obstacle-idle-ja + ((comb-obstacle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 5 + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-block-explode comb-obstacle comb-obstacle-explode-lod0-jg comb-obstacle-explode-idle-ja + ((comb-obstacle-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6.5 0 7) + ) + +;; definition for symbol *comb-block-explode-params*, type joint-exploder-static-params +(define *comb-block-explode-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for method 7 of type comb-block +(defmethod relocate ((this comb-block) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) offset) + ) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type comb-block +(defmethod deactivate ((this comb-block)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (dotimes (s5-0 4) + (let ((a0-1 (-> this parts s5-0))) + (if (nonzero? a0-1) + (kill-particles a0-1) + ) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type comb-block +(defmethod init-from-entity! ((this comb-block) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 61440.0) + ) + (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! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-block" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this hit-points) 0.1) + (set! (-> this exploder-params) *comb-block-explode-params*) + (set! (-> this exploder-skel) + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-block-explode" (the-as (pointer level) #f))) + ) + (set! (-> this exploder-anim) (the-as uint 6)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (dotimes (s5-2 4) + (set! (-> this parts s5-2) (create-launch-control (-> *part-group-id-table* 1235) this)) + ) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +;; definition for method 31 of type comb-block +;; WARN: Return type mismatch int vs none. +(defmethod set-cspec! ((this comb-block)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; definition for method 30 of type comb-block +;; WARN: Return type mismatch int vs none. +(defmethod spawn-parts ((this comb-block)) + (dotimes (s5-0 4) + (let ((v1-0 (+ s5-0 5))) + (spawn (-> this parts s5-0) (-> this node-list data v1-0 bone transform trans)) + ) + ) + (ja-post) + 0 + (none) + ) + +;; definition for method 32 of type comb-block +;; WARN: Return type mismatch int vs none. +(defmethod go-explode ((this comb-block)) + (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 + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this explode)) + 0 + (none) + ) + +;; definition for method 27 of type comb-block +(defmethod get-inv-mass ((this comb-block)) + 0.5 + ) + +;; definition for method 33 of type comb-block +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-attack-vel! ((this comb-block) (arg0 vector)) + (set! (-> this attack-vel quad) (-> arg0 quad)) + (if (< 81920.0 (vector-length (-> this attack-vel))) + (vector-normalize! (-> this attack-vel) 81920.0) + ) + 0 + (none) + ) + +;; definition for method 34 of type comb-block +(defmethod on-attack ((this comb-block) (arg0 process) (arg1 attack-info) (arg2 object)) + (vector-reset! (-> this attack-vel)) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (f30-0 1.0) + ) + (vector-reset! a1-1) + (when (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0) + (set-attack-vel! this a1-1) + ) + (if (logtest? (attack-mask damage) (-> arg1 mask)) + (set! f30-0 (-> arg1 damage)) + ) + (set! (-> this hit-points) (- (-> this hit-points) f30-0)) + ) + (if (< (-> this hit-points) 0.0) + (go-explode this) + ) + #t + ) + +;; definition for method 35 of type comb-block +(defmethod on-impact ((this comb-block) (arg0 rigid-body-impact)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse)) + (set-attack-vel! this a1-1) + ) + (when (< 286720.0 (-> arg0 impulse)) + (go-explode this) + #t + ) + ) + +;; failed to figure out what this is: +(defstate idle (comb-block) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((a1-1 (-> block param 0))) + (on-impact self (the-as rigid-body-impact a1-1)) + ) + ) + (('attack) + (let ((s4-0 (the-as object (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (!= (-> (the-as attack-info s4-0) id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (the-as int (-> (the-as attack-info s4-0) id))) + (on-attack self proc (the-as attack-info s4-0) (-> block param 0)) + ) + ) + ) + ) + ) + :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 () + (spawn-parts self) + ) + ) + +;; failed to figure out what this is: +(defstate explode (comb-block) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (sound-play "sentry-explode") + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self node-list data 5 bone transform trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 40960.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 217)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-1 damage) 7.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (the-as process-drawable *default-pool*)) + ) + (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> gp-2 duration) (seconds 4)) + (set! (-> gp-2 gravity) -163840.0) + (set! (-> gp-2 rot-speed) 10.0) + (vector+! + (-> gp-2 fountain-rand-transv-lo) + (new 'static 'vector :x -245760.0 :y 245760.0 :z -245760.0 :w 1.0) + (-> self attack-vel) + ) + (vector+! + (-> gp-2 fountain-rand-transv-hi) + (new 'static 'vector :x 245760.0 :y 245760.0 :z 245760.0 :w 1.0) + (-> self attack-vel) + ) + (process-spawn + joint-exploder + (-> self exploder-skel) + (-> self exploder-anim) + gp-2 + (-> self exploder-params) + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 2)) + (suspend) + ) + ) + (cleanup-for-death self) + ) + :post #f + ) + +;; definition of type comb-energy-ring +(deftype comb-energy-ring (process-focusable) + ((speed float) + (hum-id sound-id) + (bolt lightning-bolt) + (shocked-player symbol) + ) + (:state-methods + idle + ) + (:methods + (update-sound-and-bolt (_type_) none) + (set-cspec! (_type_) none) + (comb-energy-ring-method-31 (_type_) none) + (init-bolt! (_type_) none) + (update-bolt (_type_ vector vector) none) + ) + ) + +;; definition for method 3 of type comb-energy-ring +(defmethod inspect ((this comb-energy-ring)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Thum-id: ~D~%" (-> this hum-id)) + (format #t "~2Tbolt: ~A~%" (-> this bolt)) + (format #t "~2Tshocked-player: ~A~%" (-> this shocked-player)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-energy-ring comb-energy-ring comb-energy-ring-lod0-jg comb-energy-ring-idle-ja + ((comb-energy-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 29) + ) + +;; failed to figure out what this is: +(if #t + (set! *comb-energy-ring-lightning-width* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 4.5 :z 5.5 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if (or (zero? *comb-energy-ring-lightning*) (!= loading-level global)) + (set! *comb-energy-ring-lightning* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* tex-id) (the-as uint #x403f00)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* alpha-1-curve) *curve-unity*) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* alpha-1-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* alpha-1-repeat-dist) 262144.0) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* width-curve) *comb-energy-ring-lightning-width*) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* regenerate-time-start) (seconds 0.167)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* regenerate-time-end) (seconds 0.25)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* width-range-start) 18841.6) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* width-range-end) 20480.0) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* fade-time) (seconds 0.1)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* uv-shift?) #f) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* uv-shift-speed) (seconds 0.1)) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *comb-energy-ring-lightning* use-accurate-interp?) #t) + +;; definition for method 32 of type comb-energy-ring +;; WARN: Return type mismatch int vs none. +(defmethod init-bolt! ((this comb-energy-ring)) + (set! (-> this bolt) (new 'process 'lightning-bolt)) + (init! (-> this bolt) 4 16 *comb-energy-ring-lightning*) + 0 + (none) + ) + +;; definition for method 33 of type comb-energy-ring +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod update-bolt ((this comb-energy-ring) (arg0 vector) (arg1 vector)) + (let ((gp-0 (-> this bolt))) + (set! (-> gp-0 inner-point-travel-time) (seconds 1)) + (set! (-> gp-0 snap-inner-points?) #t) + (set! (-> gp-0 fractal-reduction) 0.4) + (set! (-> gp-0 generate-mode) (the-as uint 1)) + (set! (-> gp-0 appearance) *comb-energy-ring-lightning*) + (set! (-> gp-0 num-active-spans) 1) + (dotimes (v1-6 4) + (set! (-> gp-0 spans data v1-6 random-offset-size-start) 4096.0) + (set! (-> gp-0 spans-internal data v1-6 num-inner-points) 14) + (set! (-> gp-0 spans data v1-6 inner-random-offset-size) 4096.0) + ) + (set! (-> gp-0 span-pts-start data 0 quad) (-> arg0 quad)) + (set! (-> gp-0 span-pts-start data 2 quad) (-> arg0 quad)) + (set! (-> gp-0 span-pts-start data 1 quad) (-> arg1 quad)) + (set! (-> gp-0 span-pts-start data 3 quad) (-> arg1 quad)) + (set! (-> gp-0 spans data 0 random-offset-size-start) 0.0) + (set! (-> gp-0 spans data 1 random-offset-size-start) 0.0) + (set! (-> gp-0 spans data 2 random-offset-size-start) 0.0) + (set! (-> gp-0 spans data 3 random-offset-size-start) 0.0) + (set! (-> gp-0 spans-internal data 3 num-inner-points) 0) + (if (and (!= (lightning-bolt-method-14 gp-0) 0) (!= (lightning-bolt-method-14 gp-0) 1)) + (lightning-bolt-method-13 gp-0 1) + ) + (lightning-bolt-method-11 gp-0) + (lightning-bolt-method-12 gp-0) + ) + 0 + (none) + ) + +;; definition for method 11 of type comb-energy-ring +(defmethod init-from-entity! ((this comb-energy-ring) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (the-as penetrate -1)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 114688.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 6) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 5) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-energy-ring" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (init-bolt! this) + (set! (-> this shocked-player) #f) + (set! (-> this speed) (rand-vu-float-range 0.25 0.5)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set! (-> this hum-id) (new 'static 'sound-id)) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +;; definition for method 7 of type comb-energy-ring +;; WARN: Return type mismatch process-focusable vs comb-energy-ring. +(defmethod relocate ((this comb-energy-ring) (offset int)) + (if (nonzero? (-> this bolt)) + (&+! (-> this bolt) offset) + ) + (the-as comb-energy-ring ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 30 of type comb-energy-ring +;; WARN: Return type mismatch int vs none. +(defmethod set-cspec! ((this comb-energy-ring)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :w 16384.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :w 16384.0)) + 16 + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; definition for method 29 of type comb-energy-ring +;; WARN: Return type mismatch int vs none. +(defmethod update-sound-and-bolt ((this comb-energy-ring)) + (cond + ((< (vector-vector-distance (-> this root trans) (target-pos 0)) 409600.0) + (if (zero? (-> this hum-id)) + (set! (-> this hum-id) (new-sound-id)) + ) + (sound-play "rotating-arc" :id (-> this hum-id)) + ) + (else + (when (nonzero? (-> this hum-id)) + (sound-stop (-> this hum-id)) + (set! (-> this hum-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (ja-post) + (update-transforms (-> this root)) + (let ((v1-13 (-> this root root-prim))) + (update-bolt + this + (the-as vector (-> (the-as collide-shape-prim-group v1-13) child 0 prim-core)) + (the-as vector (-> (the-as collide-shape-prim-group v1-13) child 1 prim-core)) + ) + ) + 0 + (none) + ) + +;; definition for method 27 of type comb-energy-ring +(defmethod get-inv-mass ((this comb-energy-ring)) + 0.125 + ) + +;; failed to figure out what this is: +(defstate idle (comb-energy-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('touched) + (format #t "energy-ring got touched event from ~s~%" proc) + (when (not (-> self shocked-player)) + (set! (-> self shocked-player) #t) + (sound-play "ring-shock") + (send-event + proc + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 32.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 0.0)) + ) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek! max (-> self speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self speed))) + ) + ) + #f + ) + :post (behavior () + (update-sound-and-bolt self) + ) + ) + +;; definition of type comb-turbo +(deftype comb-turbo (process-drawable) + ((root collide-shape :override) + (touch-time time-frame) + (player-got symbol) + (boost float) + (plane vector :inline) + (mat matrix :inline) + ) + (:state-methods + idle + die + ) + (:methods + (init-collision! (_type_) none) + (init-fields! (_type_) none) + (comb-turbo-method-24 (_type_) none) + ) + ) + +;; definition for method 3 of type comb-turbo +(defmethod inspect ((this comb-turbo)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Ttouch-time: ~D~%" (-> this touch-time)) + (format #t "~2Tplayer-got: ~A~%" (-> this player-got)) + (format #t "~2Tboost: ~f~%" (-> this boost)) + (format #t "~2Tplane: #~%" (-> this plane)) + (format #t "~2Tmat: #~%" (-> this mat)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (comb-turbo) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (format #t "comb-turbo: got event ~s from ~s~%" message proc) + (when (= message 'touched) + (let ((s5-1 proc)) + (when (and (if (type? s5-1 vehicle) + s5-1 + ) + (not (-> self player-got)) + ) + (set! (-> self player-got) #t) + (send-event proc 'turbo-pad (-> self boost)) + (let ((v0-1 (current-time))) + (set! (-> self touch-time) v0-1) + v0-1 + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (if (and (-> self player-got) (time-elapsed? (-> self touch-time) (seconds 3))) + (go-virtual die) + ) + 0 + ) + ) + +;; failed to figure out what this is: +(defstate die (comb-turbo) + :virtual #t + :code (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (until (time-elapsed? (-> self state-time) (seconds 2)) + (suspend) + ) + ) + ) + +;; definition for method 22 of type comb-turbo +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this comb-turbo)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrate-using) (the-as penetrate -1)) + (set! (-> s5-0 penetrated-by) (the-as penetrate -1)) + (let ((v1-4 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle)) + (set-vector! (-> v1-4 local-sphere) 0.0 0.0 0.0 32768.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! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 23 of type comb-turbo +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-fields! ((this comb-turbo)) + (let ((s5-0 (-> this mat))) + (let ((s4-0 (new 'stack-no-clear 'quaternion))) + (quaternion-rotate-local-y! s4-0 (-> this root quat) 16384.0) + (quaternion->matrix s5-0 s4-0) + ) + (set! (-> s5-0 trans quad) (-> this root trans quad)) + (set! (-> this plane quad) (-> s5-0 rvec quad)) + ) + (set! (-> this plane w) (- (vector-dot (-> this plane) (-> this root trans)))) + (update-transforms (-> this root)) + (set! (-> this player-got) #f) + (set! (-> this boost) 1.0) + (set-time! (-> this touch-time)) + 0 + (none) + ) + +;; definition for method 11 of type comb-turbo +(defmethod init-from-entity! ((this comb-turbo) (arg0 entity-actor)) + (init-collision! this) + (process-drawable-from-entity! this arg0) + (init-fields! this) + (go (method-of-object this idle)) + ) + +;; definition of type task-manager-lightjak-training-shield +(deftype task-manager-lightjak-training-shield (task-manager) + ((gui-id sound-id) + ) + (:methods + (print-text (_type_ text-id) none) + ) + ) + +;; definition for method 3 of type task-manager-lightjak-training-shield +(defmethod inspect ((this task-manager-lightjak-training-shield)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-lightjak-training-shield +;; WARN: Return type mismatch float vs none. +(defmethod print-text ((this task-manager-lightjak-training-shield) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-4 s5-1)) + (set! (-> v1-4 width) (the float 440)) + ) + (let ((v1-5 s5-1)) + (set! (-> v1-5 height) (the float 80)) + ) + (let ((v1-6 s5-1)) + (set! (-> v1-6 scale) 0.8) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* arg0 #f)) + (s4-0 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-lightjak-training-shield) + :virtual #t + :enter (behavior () + (if *target* + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + ) + (set! (-> self gui-id) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + (let ((t1-1 (the-as uint #x3810000040020))) + (set-setting! 'features 'clear (shr t1-1 32) t1-1) + ) + ) + :exit (behavior () + (send-event *target* 'get-pickup (pickup-type health) 100.0) + ) + :code (behavior () + (while (not (and *target* + (focus-test? *target* light) + (and (focus-test? *target* light) (nonzero? (-> *target* lightjak))) + (nonzero? (-> *target* lightjak shield-start-time)) + ) + ) + (if (not (and *target* (focus-test? *target* light))) + (send-event *target* 'get-pickup (pickup-type eco-pill-light) 100.0) + ) + (print-text self (text-id text-05f8)) + (suspend) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 6)) + (print-text self (text-id text-0776)) + (suspend) + ) + ) + (send-event *target* 'end-mode 'lightjak) + (go-virtual complete) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comb-part_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-part_REF.gc new file mode 100644 index 0000000000..fcb1370c2d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-part_REF.gc @@ -0,0 +1,1096 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-comb-hover-vehicle-exhaust-glow + :id 1233 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4192 :fade-after (meters 120) :flags (sp6)) (sp-item 4193 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4192 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 15.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4193 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 20.0 10.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-hover-vehicle-exhaust-distortion + :id 1234 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4194 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4194 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:z (meters 3)) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 20.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-obstacle-glow + :id 1235 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4195 :flags (sp6)) (sp-item 4196 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4195 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 5.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4196 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 4)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 60.0 5.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-arch-yellow-glow + :id 1236 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4197 :fade-after (meters 120) :flags (sp6)) (sp-item 4198 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4197 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4198 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hugelight-big-yellow-glow + :id 1237 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4199 :fade-after (meters 120) :flags (sp6)) (sp-item 4200 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4199 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4200 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 18) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hugelight-small-yellow-glow + :id 1238 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4201 :fade-after (meters 120) :flags (sp6)) (sp-item 4202 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4201 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4.5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4202 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-supp-blue-glow + :id 1239 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4203 :fade-after (meters 120) :flags (sp6)) (sp-item 4204 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4203 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 9) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 64.0) + (:b 128.0) + (:a 50.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4204 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-bigblue-glow + :id 1240 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4205 :fade-after (meters 120) :flags (sp6)) (sp-item 4206 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4205 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 64.0) + (:b 255.0) + (:a 80.0 20.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4206 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 50.0 30.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-marker-red-glow + :id 1241 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4207 :flags (sp6) :period (seconds 0.135) :length (seconds 0.035)) + (sp-item 4208 :flags (sp6) :period (seconds 0.135) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 4207 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 2.0) + (:omega (degrees 22511.25)) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4208 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2261.25)) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-marker-small-red-glow + :id 1242 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4209 :fade-after (meters 120) :flags (sp6)) (sp-item 4210 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4209 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 15.0 5.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4210 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-x (degrees 9)) + (:rot-z (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 20.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-shelltube-yellow-glow + :id 1243 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4211 :fade-after (meters 120) :flags (sp6)) (sp-item 4212 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4211 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 8.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4212 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15) (meters 2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-sphere-yellow-glow + :id 1244 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4213 :fade-after (meters 120) :flags (sp6)) (sp-item 4214 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4213 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 120.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4214 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-light-yellow-glow + :id 1245 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4215 :flags (sp6)) (sp-item 4216 :flags (sp6)) (sp-item 4217 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4215 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4216 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 4217 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-brightlight-big-yellow-glow + :id 1246 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4218 :flags (sp6)) (sp-item 4219 :flags (sp6)) (sp-item 4220 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4218 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 6.0 2.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4219 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 4220 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 12) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-powerdisc-blue-glow + :id 1247 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4221 :flags (sp6)) (sp-item 4222 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4221 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 5.0 2.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4222 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-lighttube-yellow-glow + :id 1248 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4223 :flags (sp6)) (sp-item 4224 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4223 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 100.0 5.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4224 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30) (meters 1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-widetube-yellow-glow + :id 1249 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4225 :fade-after (meters 120) :flags (sp6)) (sp-item 4226 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4225 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 80.0) + (:a 5.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4226 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-mainwall-blue-glow + :id 1250 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4227 :fade-after (meters 120) :flags (sp6)) (sp-item 4228 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4227 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 8.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4228 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 150.0) + (:b 255.0) + (:a 20.0 3.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-comb-ceiling-panel-yellow-glow + :id 1251 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4229 :fade-after (meters 120) :flags (sp6)) (sp-item 4230 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4229 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 0.0) + (:a 8.0 1.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4230 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 30.0 5.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 4231 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 30)) + (:r 0.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4232 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 4233 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g 0.8) + (:fade-b 1.6) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4234 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 0.0) + (:g 0.0 128.0) + (:b 128.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4235 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:omega (degrees 4515.75)) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-a -7.285714) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4236 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.25)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 0.0 16.0) + (:b 0.0 16.0) + (:a 128.0) + (:scalevel-x (meters 0.0016666667)) + (:fade-a -2.1333334) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4237 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.6) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4238 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4239 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 8.0 8.0) + (:z (meters 0) (meters -3)) + (:scale-x (meters 0.4) (meters 0.4)) + (:scale-y (meters 0.4) (meters 0.4)) + (:r 192.0) + (:g 0.0 16.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.00234375)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.2 -2.4) + (:fade-a -0.53333336 -2.1333334) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4240 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 4241 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 4515.75)) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-a -7.285714) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comb-scenes_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-scenes_REF.gc new file mode 100644 index 0000000000..5c461eb21f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-scenes_REF.gc @@ -0,0 +1,959 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "temple-tests-res-b" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-173" + :art-group "scenecamera" + :anim "temple-tests-res-b" + :parts 8 + :command-list '((0 + (fadein (frame-time-30 5)) + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)) 'hide) + (none) + ) + ) + ) + (2 + (apply + ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)) 'hide) + (none) + ) + ) + ) + (750 + (part-tracker + "group-fma-medallion-car-charge" + entity + "kidmedallion" + joint + "main" + track + #t + duration + (frame-range 750 810) + ) + ) + (860 (fadeout (frame-time-30 15))) + (10000 + (task-close! "comb-travel-introduction") + (apply ,(lambda :behavior scene-player + () + (send-event (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)) 'unhide) + (none) + ) + ) + ) + ) + :cut-list '(51 151 280 335 417 474 541 671 763 805) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'combx + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'combx + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'comba + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min 954)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "comb-rail-rider-fma" + :level 'comba + :art-group "skel-comb-rail-rider-fma" + :prefix "" + :draw-frames '((min 151) (280 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "kidmedallion" + :level 'comba + :art-group "skel-kidmedallion" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "comba-elevator" + :end-point "comba-movie-end" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "launch-amb-mov") + :on-complete #f + ) + ) + +;; definition for function comb-lightjak-do-effect +;; INFO: Used lq/sq +(defbehavior comb-lightjak-do-effect process-drawable () + (logior! (-> self draw global-effect) (draw-control-global-effect no-textures)) + (logior! (-> self draw global-effect) (draw-control-global-effect rim-lights)) + (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) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 3)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 4)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 5)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 6)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 8)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 13)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 17)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 14)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 18)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 15)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 19)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 25)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 26)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 32)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 27)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 33)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 28)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 34)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 31)) :rate f30-0) + (launch-particles (-> *part-id-table* 623) (vector<-cspace! gp-0 (-> self node-list data 37)) :rate f30-0) + ) + (none) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "catacomb-get-shield" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-224" + :art-group "scenecamera" + :anim "catacomb-get-shield" + :parts 5 + :command-list '((0 (fadein (frame-time-30 5))) + (1 + (joint-eval start-precursor-effect entity "precursor") + (send-event + "precursor" + 'eval + ,(lambda :behavior scene-player + () + (let* ((v1-3 (-> self draw lod-set lod (-> self draw cur-lod) geo length)) + (gp-0 3) + (s5-0 (+ v1-3 1)) + ) + (while (>= s5-0 gp-0) + (when (not (or (and (>= gp-0 13) (>= 21 gp-0)) (and (>= gp-0 26) (>= 34 gp-0)))) + (if (logtest? (-> *part-group-id-table* 1252 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1252) + :duration (seconds 17.135) + :target self + :mat-joint gp-0 + ) + (part-tracker-spawn + part-tracker + :to self + :group (-> *part-group-id-table* 1252) + :duration (seconds 17.135) + :target self + :mat-joint gp-0 + ) + ) + ) + (+! gp-0 1) + ) + ) + (none) + ) + ) + (part-tracker + "group-fma-precursor-entrance-flash" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 1 27) + ) + ) + (300 + (part-tracker + "group-fma-lightjak-getshield-gravitate" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 300 480) + ) + (part-tracker + "group-fma-lightjak-getshield" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-range 300 480) + ) + ) + (440 + (apply + ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + (part-tracker + "group-fma-lightjak-getshield-flash" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 440 441) + ) + ) + (445 + (send-event "jakc-highres" 'trans-hook comb-lightjak-do-effect) + (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (520 (fadeout (frame-time-30 20))) + (10000 (task-close! "comb-travel-resolution") (kill "pecker-ingame-2")) + ) + :cut-list '(396) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'comba + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'comba + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pecker-highres" + :level 'comba + :art-group "skel-pecker-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor" + :level 'comba + :art-group "skel-precursor" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'comba + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "combn-start" + :end-point "combn-lightjak" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "launch-amb-mov") (sound-play-loop "tunnel-amb-mov")) + :on-complete #f + ) + ) + +;; definition for symbol death-precursor, type death-info +(define death-precursor (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x1092)) + +;; definition for function start-precursor-effect +;; WARN: Return type mismatch int vs none. +(defun start-precursor-effect ((arg0 manipy)) + (let ((v1-0 (-> arg0 draw)) + (a1-0 death-precursor) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-0 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-0 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-0 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-0 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior scene-player + () + (set! (-> self draw death-timer) (the-as uint 200)) + (set! (-> self draw death-vertex-skip) (the-as uint (the int (rand-vu-float-range 8.0 24.0)))) + (none) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 4242 + :init-specs ((:scale-x (meters 0.08)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 196.0) + (:b 255.0) + (:a 64.0) + (:accel-y (meters 0) (meters 0.00066666666)) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-texture-glow-soft) + (:next-time (seconds 0.035)) + (:next-launcher 4243) + ) + ) + +;; failed to figure out what this is: +(defpart 4243 + :init-specs ((:r 64.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.0008)) + (:scalevel-y (meters 0) (meters 0.0026666666)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-outro-precursor-entity + :id 1252 + :duration (seconds 0.017) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4244 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4244 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 8.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-medallion-car-beam + :id 1253 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4245 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4245 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 3.0 3.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:scale-y (meters 0.1) (meters 0.4)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-z (meters 0.05)) + (:scalevel-x (meters 0.006666667)) + (:timer (seconds 0.667) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 20) (degrees -50.000004)) + (:conerot-y (degrees 0) (degrees -50.000004)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-medallion-car-charge + :id 1254 + :flags (sp0 sp4 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4246 :flags (sp7)) + (sp-item 4247 :flags (sp7)) + (sp-item 4248 :flags (sp6)) + (sp-item 4249 :flags (sp6)) + (sp-item 4250 :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4246 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0 1.0) + (:x (meters 0.6) (meters 0.1)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334) + (:accel-x (meters -0.00033333333)) + (:friction 0.98 0.01) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 left-multiply-quat)) + (:func 'spt-func-relative-pos) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 4247 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 20.0) + (:b 32.0) + (:a 0.0) + (:scalevel-x (meters -0.013333334) (meters -0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.335)) + (:next-launcher 4251) + ) + ) + +;; failed to figure out what this is: +(defpart 4251 + :init-specs ((:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 4248 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 128.0) + (:a 20.0 40.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.167)) + (:flags (glow)) + (:userdata 409.6) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpart 4249 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 64.0) + (:a 60.0 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpart 4250 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 10.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + (:func 'spt-func-relative-pos) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-precursor-entrance-flash + :id 1255 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4252 :flags (sp3)) (sp-item 4253 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 4252 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow left-multiply-quat)) + (:userdata 4096.0) + (:next-time (seconds 0.335)) + (:next-launcher 4254) + ) + ) + +;; failed to figure out what this is: +(defpart 4254 + :init-specs ((:scalevel-x (meters -0.06666667)) (:scalevel-y :copy scalevel-x) (:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpart 4253 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 4255) + ) + ) + +;; failed to figure out what this is: +(defpart 4255 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-lightjak-getshield + :id 1256 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4256 :flags (is-3d)) + (sp-item 4257 :flags (is-3d)) + (sp-item 4258 :flags (is-3d)) + (sp-item 4259 :flags (is-3d)) + (sp-item 4260) + ) + ) + +;; failed to figure out what this is: +(defpart 4256 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4261 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpart 4257 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4258 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4259 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 20)) + (: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 4261) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4260 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters -20)) + (: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 4262) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4262 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-lightjak-getshield-gravitate + :id 1257 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4263)) + ) + +;; failed to figure out what this is: +(defpart 4263 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (: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: +(defpartgroup group-fma-lightjak-getshield-flash + :id 1258 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4264 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 4264 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 255.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.23333333)) + (:scalevel-y (meters 0.033333335)) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow left-multiply-quat)) + (:userdata 409.6) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.167)) + (:next-launcher 4265) + ) + ) + +;; failed to figure out what this is: +(defpart 4265 + :init-specs ((:scalevel-x (meters -0.0033333334)) (:scalevel-y (meters -0.02)) (:fade-a -1.7)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc new file mode 100644 index 0000000000..ed45f69165 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-sentry_REF.gc @@ -0,0 +1,846 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type comb-sentry-shot +(deftype comb-sentry-shot (guard-shot) + () + ) + +;; definition for method 3 of type comb-sentry-shot +(defmethod inspect ((this comb-sentry-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type guard-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type comb-sentry-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this comb-sentry-shot)) + (draw-beam (-> *part-id-table* 4240) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4241)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type comb-sentry-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this comb-sentry-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 4236 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 4236) a1-0 s5-1 #f) + (set! (-> *part-id-table* 4236 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 4237) s4-0) + (launch-particles (-> *part-id-table* 4238) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000027126736 f30-0)) + (f30-1 (-> *part-id-table* 4239 init-specs 3 initial-valuef)) + (f28-1 (-> *part-id-table* 4239 init-specs 4 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) (* f26-0 f28-1)) + (launch-particles (-> *part-id-table* 4239) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 4239 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 4239 init-specs 4 initial-valuef) f28-1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type comb-sentry-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this comb-sentry-shot)) + (let* ((s4-0 (-> this root)) + (v1-1 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> s4-0 trans)) 2048.0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> s4-0 trans quad)) + (vector+! gp-0 gp-0 v1-1) + (cond + ((-> this hit-actor?) + (sound-play "sentry-hit") + (cond + ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 212 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 212)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type comb-sentry-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod init-proj-settings! ((this comb-sentry-shot)) + (let ((t9-0 (method-of-type guard-shot init-proj-settings!))) + (t9-0 this) + ) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this max-speed) 2048000.0) + (set! (-> this damage) 3.0) + (set! (-> this timeout) (seconds 0.4)) + (set! (-> this sound-id) (new-sound-id)) + (none) + ) + +;; definition of type comb-sentry +(deftype comb-sentry (process-focusable) + ((target-pos vector :inline) + (up-dir vector :inline) + (attack-vel vector :inline) + (exploder-params joint-exploder-static-params) + (exploder-skel skeleton-group) + (exploder-anim uint32) + (target-dist float) + (path-t float) + (path-dt float) + (hit-points float) + (incoming-attack-id int32) + (angle float) + (spin float) + (shooting symbol) + (should-attack symbol) + (i-barrel int8) + (hum-id sound-id) + (shot-time time-frame) + (attack-time time-frame) + (in-range-time time-frame) + (player-vehicle handle) + ) + (:state-methods + idle + path-follow + explode + ) + (:methods + (stop-hum (_type_) none) + (sentry-post (_type_) none) + (set-cspec! (_type_) none) + (go-explode (_type_) none) + (set-attack-vel! (_type_ vector) none) + (on-attack (_type_ process attack-info object) symbol) + (on-impact (_type_ rigid-body-impact) symbol) + (fire-shot (_type_) (pointer comb-sentry-shot)) + (draw-glow-sprites (_type_) none) + ) + ) + +;; definition for method 3 of type comb-sentry +(defmethod inspect ((this comb-sentry)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Ttarget-pos: #~%" (-> this target-pos)) + (format #t "~2Tup-dir: #~%" (-> this up-dir)) + (format #t "~2Tattack-vel: #~%" (-> this attack-vel)) + (format #t "~2Texploder-params: ~A~%" (-> this exploder-params)) + (format #t "~2Texploder-skel: ~A~%" (-> this exploder-skel)) + (format #t "~2Texploder-anim: ~D~%" (-> this exploder-anim)) + (format #t "~2Ttarget-dist: ~f~%" (-> this target-dist)) + (format #t "~2Tpath-t: ~f~%" (-> this path-t)) + (format #t "~2Tpath-dt: ~f~%" (-> this path-dt)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Tspin: ~f~%" (-> this spin)) + (format #t "~2Tshooting: ~A~%" (-> this shooting)) + (format #t "~2Tshould-attack: ~A~%" (-> this should-attack)) + (format #t "~2Ti-barrel: ~D~%" (-> this i-barrel)) + (format #t "~2Thum-id: ~D~%" (-> this hum-id)) + (format #t "~2Tshot-time: ~D~%" (-> this shot-time)) + (format #t "~2Tattack-time: ~D~%" (-> this attack-time)) + (format #t "~2Tin-range-time: ~D~%" (-> this in-range-time)) + (format #t "~2Tplayer-vehicle: ~D~%" (-> this player-vehicle)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-sentry comb-sentinel comb-sentinel-lod0-jg comb-sentinel-idle-ja + ((comb-sentinel-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + ) + +;; failed to figure out what this is: +(defskelgroup skel-comb-sentry-explode comb-sentinel comb-sentinel-explode-lod0-jg comb-sentinel-explode-idle-ja + ((comb-sentinel-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 6.5 0 7) + ) + +;; definition for symbol *comb-sentry-explode-params*, type joint-exploder-static-params +(define *comb-sentry-explode-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for method 11 of type comb-sentry +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this comb-sentry) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 61440.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (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! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-sentry" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this up-dir quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (if (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + (set! (-> this path-t) 0.0) + (set! (-> this path-dt) 0.0) + (set! (-> this hit-points) 6.0) + (set! (-> this shooting) #f) + (set! (-> this hum-id) (new 'static 'sound-id)) + (set! (-> this should-attack) #f) + (set! (-> this exploder-params) *comb-sentry-explode-params*) + (set! (-> this exploder-skel) + (the-as skeleton-group (art-group-get-by-name *level* "skel-comb-sentry-explode" (the-as (pointer level) #f))) + ) + (set! (-> this exploder-anim) (the-as uint 5)) + (set! (-> this draw lod-set lod 0 dist) 1228800.0) + (set! (-> this draw lod-set lod 1 dist) 1232896.0) + (set! (-> this player-vehicle) (the-as handle #f)) + (set! (-> this target-dist) 4096000.0) + (set-cspec! this) + (go (method-of-object this idle)) + ) + +;; definition for method 33 of type comb-sentry +;; WARN: Return type mismatch int vs none. +(defmethod set-cspec! ((this comb-sentry)) + (iterate-prims + (-> this root) + (lambda ((arg0 collide-shape-prim)) + (set! (-> arg0 prim-core collide-with) (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-player-list + hit-by-others-list + player-list + collectable + pusher + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> arg0 prim-core collide-as) (collide-spec obstacle vehicle-sphere vehicle-mesh)) + (none) + ) + ) + (let ((v1-3 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group v1-3) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :y 6144.0 :w 40960.0)) + 16 + ) + ) + (update-transforms (-> this root)) + 0 + (none) + ) + +;; definition for symbol *comb-sentry-glow-template*, type sprite-glow-data +(define *comb-sentry-glow-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 20480.0) + :size-probe 655.36 + :z-offset 819.2 + :size-y 20480.0 + :color (new 'static 'rgbaf :x 255.0 :y 64.0 :z 64.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #xd :page #x4) + ) + ) + +;; definition for symbol *comb-sentry-glow-ring-template*, type sprite-glow-data +(define *comb-sentry-glow-ring-template* (new 'static 'sprite-glow-data + :position (new 'static 'vector :w 20480.0) + :size-probe 655.36 + :z-offset 819.2 + :size-y 20480.0 + :color (new 'static 'rgbaf :x 255.0 :w 16.0) + :fade-a -0.0000122044 + :fade-b 8.997864 + :tex-id (new 'static 'texture-id :index #x9c :page #x4) + ) + ) + +;; definition for method 39 of type comb-sentry +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-glow-sprites ((this comb-sentry)) + (let ((gp-0 (new 'stack-no-clear 'comb-sentry-stack-var1))) + (matrix<-transformq! (-> gp-0 mat) (the-as transformq (-> this root trans))) + (let ((s5-0 (new 'static 'inline-array vector 3 + (new 'static 'vector :z 30720.0 :w 1.0) + (new 'static 'vector :x 9420.8 :y 9420.8 :z 24985.6 :w 1.0) + (new 'static 'vector :x -10240.0 :z 24576.0 :w 1.0) + ) + ) + (s4-0 *comb-sentry-glow-template*) + (s3-0 *comb-sentry-glow-ring-template*) + ) + (dotimes (s2-0 3) + (quad-copy! (the-as pointer (-> gp-0 glow)) (the-as pointer s4-0) 4) + (vector-matrix*! (-> gp-0 vec) (-> s5-0 s2-0) (-> gp-0 mat)) + (let* ((v1-2 (-> gp-0 glow)) + (a1-3 (-> gp-0 vec)) + (f0-0 (-> v1-2 position w)) + ) + (set! (-> v1-2 position quad) (-> a1-3 quad)) + (set! (-> v1-2 position w) f0-0) + ) + 0 + (set! (-> gp-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> gp-0 glow color w) (* 4.0 (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> gp-0 glow)) + (quad-copy! (the-as pointer (-> gp-0 glow)) (the-as pointer s3-0) 4) + (vector-matrix*! (-> gp-0 vec) (-> s5-0 s2-0) (-> gp-0 mat)) + (let* ((v1-10 (-> gp-0 glow)) + (a1-10 (-> gp-0 vec)) + (f0-5 (-> v1-10 position w)) + ) + (set! (-> v1-10 position quad) (-> a1-10 quad)) + (set! (-> v1-10 position w) f0-5) + ) + 0 + (set! (-> gp-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> gp-0 glow color w) (* 0.5 (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> gp-0 glow)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type comb-sentry +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer comb-sentry-shot). +(defmethod fire-shot ((this comb-sentry)) + (sound-play "sentry-fire") + (let ((s5-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) + (set! (-> s5-1 byte0) 0) + (let* ((v1-1 (-> s5-1 mat)) + (a3-1 (-> this node-list data 0 bone transform)) + (a0-5 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-1 rvec quad) a0-5) + (set! (-> v1-1 uvec quad) a1-1) + (set! (-> v1-1 fvec quad) a2-1) + (set! (-> v1-1 trans quad) a3-2) + ) + (let ((v1-2 (new 'static 'inline-array vector 1 (new 'static 'vector :z 14336.0 :w 1.0)))) + (vector-matrix*! (-> s5-1 vec2) (-> v1-2 (-> s5-1 byte0)) (-> s5-1 mat)) + ) + 0 + (set! (-> s5-1 vec3 quad) (-> s5-1 mat fvec quad)) + (vector-float*! (-> s5-1 vec4) (-> s5-1 vec3) 2048000.0) + (set! (-> s5-1 params ent) (-> this entity)) + (set! (-> s5-1 params charge) 1.0) + (set! (-> s5-1 params options) (projectile-options)) + (logclear! (-> s5-1 params options) (projectile-options po14 po15 po16)) + (set! (-> s5-1 params pos quad) (-> s5-1 vec2 quad)) + (set! (-> s5-1 params vel quad) (-> s5-1 vec4 quad)) + (set! (-> s5-1 params notify-handle) (the-as handle #f)) + (set! (-> s5-1 params owner-handle) (the-as handle #f)) + (set! (-> s5-1 params target-handle) (the-as handle #f)) + (set! (-> s5-1 params target-pos quad) (the-as uint128 0)) + (set! (-> s5-1 params ignore-handle) (process->handle this)) + (let* ((v1-17 *game-info*) + (a0-20 (+ (-> v1-17 attack-id) 1)) + ) + (set! (-> v1-17 attack-id) a0-20) + (set! (-> s5-1 params attack-id) a0-20) + ) + (set! (-> s5-1 params timeout) (seconds 4)) + (the-as + (pointer comb-sentry-shot) + (spawn-projectile comb-sentry-shot (-> s5-1 params) this *default-dead-pool*) + ) + ) + ) + +;; definition for method 31 of type comb-sentry +;; WARN: Return type mismatch int vs none. +(defmethod stop-hum ((this comb-sentry)) + (sound-stop (-> this hum-id)) + 0 + (none) + ) + +;; definition for method 10 of type comb-sentry +(defmethod deactivate ((this comb-sentry)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (stop-hum this) + (call-parent-method this) + (none) + ) + +;; definition for method 32 of type comb-sentry +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod sentry-post ((this comb-sentry)) + (local-vars (v1-25 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (if (and (= (-> this player-vehicle) #f) *target* (focus-test? *target* pilot-riding)) + (set! (-> this player-vehicle) (-> *target* pilot vehicle)) + ) + (set! (-> this should-attack) #f) + (let ((s5-0 (the-as process-focusable (handle->process (-> this player-vehicle))))) + (when s5-0 + (if (and (not (focus-test? s5-0 dead)) + (not (focus-test? s5-0 ignore)) + (let ((f0-0 (vector-vector-distance-squared (-> s5-0 root trans) (-> this root trans))) + (f1-0 409600.0) + ) + (< f0-0 (* f1-0 f1-0)) + ) + ) + (set! (-> this should-attack) #t) + ) + (let ((v1-23 (new 'stack-no-clear 'matrix))) + (set! (-> v1-23 rvec quad) (-> s5-0 root trans quad)) + (set! (-> v1-23 uvec quad) (-> s5-0 root transv quad)) + (vector+float*! (-> this target-pos) (-> v1-23 rvec) (-> v1-23 uvec) 0.1) + (set! (-> v1-23 fvec quad) (-> s5-0 node-list data 0 bone transform fvec quad)) + (vector-! (-> v1-23 trans) (-> this root trans) (-> v1-23 rvec)) + (set! (-> this target-dist) (vector-dot (-> v1-23 fvec) (-> v1-23 trans))) + (let* ((v1-24 (-> v1-23 trans)) + (f0-4 409600.0) + (f0-6 (* f0-4 f0-4)) + ) + (.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) + (if (< f0-6 v1-25) + (set! (-> this target-dist) 4096000.0) + ) + ) + ) + ) + ) + (if (not (-> this should-attack)) + (set-time! (-> this in-range-time)) + ) + (set! (-> this path-dt) (* 0.00024414062 (- 163840.0 (-> this target-dist)))) + (set! (-> this path-dt) (fmax -8.0 (fmin 8.0 (-> this path-dt)))) + (+! (-> this path-t) (* (-> this path-dt) (seconds-per-frame))) + (set! (-> this path-t) (fmax 0.0 (fmin (-> this path-t) (get-num-segments (-> this path))))) + (if (= (-> this path-t) (get-num-segments (-> this path))) + (go-explode this) + ) + (get-point-in-path! (-> this path) (-> this root trans) (-> this path-t) 'interp) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 5))) + (vector-! (-> s5-1 0) (-> this target-pos) (-> this root trans)) + (vector-normalize! (-> s5-1 0) 1.0) + (set! (-> s5-1 1 quad) (-> this up-dir quad)) + (set! (-> s5-1 4 x) (vector-dot (-> s5-1 0) (-> s5-1 1))) + (vector+float*! (-> s5-1 1) (-> s5-1 1) (-> s5-1 0) (- (-> s5-1 4 x))) + (vector-normalize! (-> s5-1 1) 1.0) + (set! (-> this up-dir quad) (-> s5-1 1 quad)) + (forward-up-nopitch->quaternion (the-as quaternion (-> s5-1 2)) (-> s5-1 0) (-> s5-1 1)) + (+! (-> this angle) (* (-> this spin) (seconds-per-frame))) + (set! (-> this angle) (the float (sar (shl (the int (-> this angle)) 48) 48))) + (quaternion-axis-angle! (the-as quaternion (-> s5-1 3)) 0.0 0.0 1.0 (-> this angle)) + (quaternion*! (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 2)) (the-as quaternion (-> s5-1 3))) + (quaternion-copy! (-> this root quat) (the-as quaternion (-> s5-1 2))) + ) + (cond + ((-> this shooting) + (seek! (-> this spin) 131072.0 (* 262144.0 (seconds-per-frame))) + (when (time-elapsed? (-> this shot-time) (seconds 0.2)) + (set-time! (-> this shot-time)) + (fire-shot this) + ) + (when (or (time-elapsed? (-> this attack-time) (seconds 1)) (not (-> this should-attack))) + (set-time! (-> this attack-time)) + (set! (-> this shooting) #f) + ) + ) + (else + (seek! (-> this spin) 32768.0 (* 65536.0 (seconds-per-frame))) + (when (and (time-elapsed? (-> this attack-time) (seconds 3)) + (time-elapsed? (-> this in-range-time) (seconds 4)) + (-> this should-attack) + ) + (set-time! (-> this attack-time)) + (set! (-> this shooting) #t) + ) + ) + ) + (cond + ((-> this should-attack) + (if (zero? (-> this hum-id)) + (set! (-> this hum-id) (new-sound-id)) + ) + (sound-play "sentry-engine" :id (-> this hum-id)) + ) + (else + (when (nonzero? (-> this hum-id)) + (sound-stop (-> this hum-id)) + (set! (-> this hum-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + (transform-post) + (draw-glow-sprites this) + 0 + (none) + ) + ) + +;; definition for method 34 of type comb-sentry +;; WARN: Return type mismatch int vs none. +(defmethod go-explode ((this comb-sentry)) + (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 + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this explode)) + 0 + (none) + ) + +;; definition for method 27 of type comb-sentry +(defmethod get-inv-mass ((this comb-sentry)) + 0.125 + ) + +;; definition for method 35 of type comb-sentry +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-attack-vel! ((this comb-sentry) (arg0 vector)) + (set! (-> this attack-vel quad) (-> arg0 quad)) + (if (< 81920.0 (vector-length (-> this attack-vel))) + (vector-normalize! (-> this attack-vel) 81920.0) + ) + 0 + (none) + ) + +;; definition for method 36 of type comb-sentry +(defmethod on-attack ((this comb-sentry) (arg0 process) (arg1 attack-info) (arg2 object)) + (vector-reset! (-> this attack-vel)) + (let ((a1-1 (new 'stack-no-clear 'vector)) + (f30-0 1.0) + ) + (vector-reset! a1-1) + (when (logtest? (attack-mask attacker-velocity) (-> arg1 mask)) + (vector-float*! a1-1 (-> arg1 attacker-velocity) 1.0) + (set-attack-vel! this a1-1) + ) + (if (logtest? (attack-mask damage) (-> arg1 mask)) + (set! f30-0 (-> arg1 damage)) + ) + (sound-play "impact-med") + (set! (-> this hit-points) (- (-> this hit-points) f30-0)) + ) + (if (< (-> this hit-points) 0.0) + (go-explode this) + ) + #t + ) + +;; definition for method 37 of type comb-sentry +(defmethod on-impact ((this comb-sentry) (arg0 rigid-body-impact)) + (let ((a1-1 (new 'stack-no-clear 'vector))) + (vector-float*! a1-1 (-> arg0 normal) (-> arg0 impulse)) + (set-attack-vel! this a1-1) + ) + (when (< 286720.0 (-> arg0 impulse)) + (go-explode this) + #t + ) + ) + +;; failed to figure out what this is: +(defstate idle (comb-sentry) + :virtual #t + :trans (behavior () + (set! (-> self path-dt) 0.0) + (go-virtual path-follow) + ) + :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 () + (sentry-post self) + ) + ) + +;; failed to figure out what this is: +(defstate path-follow (comb-sentry) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((a1-1 (-> block param 0))) + (on-impact self (the-as rigid-body-impact a1-1)) + ) + ) + (('attack) + (let ((s4-0 (the-as attack-info (-> block param 1)))) + (get-penetrate-using-from-attack-event (the-as process-drawable proc) block) + (when (!= (-> s4-0 id) (-> self incoming-attack-id)) + (set! (-> self incoming-attack-id) (the-as int (-> s4-0 id))) + (on-attack self proc s4-0 (-> block param 0)) + ) + ) + ) + ) + ) + :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 () + (sentry-post self) + ) + ) + +;; failed to figure out what this is: +(defstate explode (comb-sentry) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + :code (behavior () + (stop-hum self) + (sound-play "sentry-expl") + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 217)) + ) + ) + (let ((gp-3 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> gp-3 duration) (seconds 4)) + (set! (-> gp-3 gravity) -163840.0) + (set! (-> gp-3 rot-speed) 10.0) + (vector+! + (-> gp-3 fountain-rand-transv-lo) + (new 'static 'vector :x -245760.0 :y 245760.0 :z -245760.0 :w 1.0) + (-> self attack-vel) + ) + (vector+! + (-> gp-3 fountain-rand-transv-hi) + (new 'static 'vector :x 245760.0 :y 245760.0 :z 245760.0 :w 1.0) + (-> self attack-vel) + ) + (process-spawn + joint-exploder + (-> self exploder-skel) + (-> self exploder-anim) + gp-3 + (-> self exploder-params) + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((gp-4 (current-time))) + (until (time-elapsed? gp-4 (seconds 2)) + (suspend) + ) + ) + (cleanup-for-death self) + ) + :post #f + ) + +;; definition of type comb-sentinel +(deftype comb-sentinel (comb-sentry) + () + ) + +;; definition for method 3 of type comb-sentinel +(defmethod inspect ((this comb-sentinel)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type comb-sentry inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type rail-sentinel +(deftype rail-sentinel (comb-sentry) + () + ) + +;; definition for method 3 of type rail-sentinel +(defmethod inspect ((this rail-sentinel)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type comb-sentry inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc b/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc new file mode 100644 index 0000000000..ae4bca8ff3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comb-travel_REF.gc @@ -0,0 +1,388 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type task-manager-tube-ride +(deftype task-manager-tube-ride (task-manager) + ((suck-factor float) + (hp-scale float) + (intro-sequence basic) + (outro-sequence basic) + (no-shoot-time time-frame) + (end-sphere sphere :inline) + (end-plane vector :inline) + (intro-sphere sphere :inline) + (outro-sphere sphere :inline) + (intro-target vector :inline) + (outro-target vector :inline) + (outro-plane2 vector :inline) + (outro-target2 vector :inline) + ) + (:methods + (set-sbanks (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-tube-ride +(defmethod inspect ((this task-manager-tube-ride)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tsuck-factor: ~f~%" (-> this suck-factor)) + (format #t "~2Thp-scale: ~f~%" (-> this hp-scale)) + (format #t "~2Tintro-sequence: ~A~%" (-> this intro-sequence)) + (format #t "~2Toutro-sequence: ~A~%" (-> this outro-sequence)) + (format #t "~2Tno-shoot-time: ~D~%" (-> this no-shoot-time)) + (format #t "~2Tend-sphere: #~%" (-> this end-sphere)) + (format #t "~2Tend-plane: #~%" (-> this end-plane)) + (format #t "~2Tintro-sphere: #~%" (-> this intro-sphere)) + (format #t "~2Toutro-sphere: #~%" (-> this outro-sphere)) + (format #t "~2Tintro-target: #~%" (-> this intro-target)) + (format #t "~2Toutro-target: #~%" (-> this outro-target)) + (format #t "~2Toutro-plane2: #~%" (-> this outro-plane2)) + (format #t "~2Toutro-target2: #~%" (-> this outro-target2)) + (label cfg-4) + this + ) + +;; definition for method 26 of type task-manager-tube-ride +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-tube-ride)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (let* ((s4-0 (handle->process (-> this player-vehicle))) + (s5-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when s5-0 + (if (focus-test? s5-0 dead) + (send-event this 'fail) + ) + (if (time-elapsed? (-> this no-shoot-time) (seconds 0.1)) + (logclear! (-> s5-0 focus-status) (focus-status ignore)) + (logior! (-> s5-0 focus-status) (focus-status ignore)) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 21 of type task-manager-tube-ride +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-tube-ride)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this hp-scale) 1.0) + (set! (-> this intro-sequence) #f) + (set! (-> this outro-sequence) #f) + (let ((a2-0 (-> this node-info death-count))) + (set! (-> this suck-factor) (cond + ((< a2-0 (the-as uint 5)) + 0.0 + ) + ((< a2-0 (the-as uint 10)) + 0.25 + ) + (else + (fmin 1.0 (* 0.05 (the float a2-0))) + ) + ) + ) + (format #t "tube-ride::initialize death-count ~d, suck-factor ~f~%" a2-0 (-> this suck-factor)) + ) + (none) + ) + +;; definition for method 32 of type task-manager-tube-ride +;; WARN: Return type mismatch int vs none. +(defmethod set-sbanks ((this task-manager-tube-ride)) + (set-setting! 'music 'combs 0.0 0) + 0 + (none) + ) + +;; definition for method 30 of type task-manager-tube-ride +(defmethod taskman-event-handler ((this task-manager-tube-ride) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('no-shoot) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> this no-shoot-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-tube-ride) + :virtual #t + :code (behavior () + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + (until #f + (if (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (goto cfg-8) + ) + (suspend) + ) + #f + (label cfg-8) + (suspend) + (until #f + (let ((v1-13 (handle->process (-> *vehicle-info* handle-by-vehicle-type 10)))) + (when v1-13 + (set! (-> self player-vehicle) (process->handle v1-13)) + (goto cfg-23) + ) + ) + (suspend) + ) + #f + (label cfg-23) + (cond + ((-> self intro-sequence) + (send-event (handle->process (-> self player-vehicle)) 'ignore-impulse #t) + (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #t) + (until #f + (if (and *target* (focus-test? *target* pilot-riding)) + (goto cfg-46) + ) + (suspend) + ) + #f + (label cfg-46) + (set-sbanks self) + (send-event (handle->process (-> self player-vehicle)) 'ignore-impulse #f) + (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #f) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-speed 0) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-position (-> self intro-target)) + (until #f + (let* ((s5-0 (handle->process (-> self player-vehicle))) + (gp-0 (if (type? s5-0 process-focusable) + (the-as process-focusable s5-0) + ) + ) + ) + (when gp-0 + (send-event gp-0 'set-control-hook-ai) + (if (< (vector-vector-distance (-> gp-0 root trans) (-> self intro-sphere)) (-> self intro-sphere r)) + (goto cfg-89) + ) + ) + ) + (suspend) + ) + #f + (label cfg-89) + (send-event (handle->process (-> self player-vehicle)) 'set-control-hook-player) + (send-event (handle->process (-> self player-vehicle)) 'in-tunnel #t) + ) + (else + (set-sbanks self) + ) + ) + (send-event + (handle->process (-> self player-vehicle)) + 'scale-max-hit-points + (* (-> self hp-scale) (+ 1.0 (-> self suck-factor))) + ) + (send-event (handle->process (-> self player-vehicle)) 'ignore-impulse #f) + (send-event (handle->process (-> self player-vehicle)) 'ignore-damage #f) + (when (-> self outro-sequence) + (until #f + (let* ((gp-1 (handle->process (-> self player-vehicle))) + (v1-134 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (when v1-134 + (if (< (vector-vector-distance (-> (the-as process-focusable v1-134) root trans) (-> self outro-sphere)) + (-> self outro-sphere r) + ) + (goto cfg-139) + ) + ) + ) + (suspend) + ) + #f + (label cfg-139) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-position (-> self outro-target)) + (send-event (handle->process (-> self player-vehicle)) 'set-control-hook-ai) + (until #f + (let* ((gp-2 (handle->process (-> self player-vehicle))) + (v1-156 (if (type? gp-2 process-focusable) + gp-2 + ) + ) + ) + (when v1-156 + (if (< 0.0 (vector4-dot (-> (the-as process-focusable v1-156) root trans) (-> self outro-plane2))) + (goto cfg-166) + ) + ) + ) + (suspend) + ) + #f + (label cfg-166) + (send-event (handle->process (-> self player-vehicle)) 'in-tunnel #f) + (send-event (handle->process (-> self player-vehicle)) 'ai-set-target-position (-> self outro-target2)) + ) + (until #f + (let* ((s5-1 (handle->process (-> self player-vehicle))) + (gp-3 (if (type? s5-1 process-focusable) + (the-as process-focusable s5-1) + ) + ) + ) + (when gp-3 + (if (and (< (vector-vector-distance (-> gp-3 root trans) (-> self end-sphere)) (-> self end-sphere r)) + (< 0.0 (vector4-dot (-> gp-3 root trans) (-> self end-plane))) + ) + (send-event self 'complete) + ) + ) + ) + (suspend) + ) + #f + (let ((t9-29 (-> (find-parent-state) code))) + (if t9-29 + ((the-as (function none) t9-29)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate complete (task-manager-tube-ride) + :virtual #t + :code (behavior () + (remove-setting! 'pilot-exit) + (set-setting! 'pilot #f 0.0 0) + (let ((t9-3 (-> (find-parent-state) code))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + +;; definition of type task-manager-comb-travel +(deftype task-manager-comb-travel (task-manager-tube-ride) + () + ) + +;; definition for method 3 of type task-manager-comb-travel +(defmethod inspect ((this task-manager-comb-travel)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-tube-ride inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-comb-travel +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-comb-travel)) + (call-parent-method this) + (set! (-> this end-sphere quad) + (-> (new 'static 'vector :x 14454784.0 :y -163840.0 :z 607027.2 :w 409600.0) quad) + ) + (set! (-> this end-plane quad) (-> (new 'static 'vector :x 1.0 :w 1.0) quad)) + (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) + (set! (-> this intro-sequence) (the-as basic #t)) + (set! (-> this intro-sphere quad) + (-> (new 'static 'vector :x 1083801.6 :y -81920.0 :z 45056.0 :w 122880.0) quad) + ) + (set! (-> this intro-target quad) (-> this intro-sphere quad)) + (set! (-> this outro-sequence) (the-as basic #t)) + (set! (-> this outro-sphere quad) + (-> (new 'static 'vector :x 13798605.0 :y -226099.2 :z 614400.0 :w 491520.0) quad) + ) + (set! (-> this outro-target quad) + (-> (new 'static 'vector :x 13798605.0 :y -4096000.0 :z 614400.0 :w 1.0) quad) + ) + (set! (-> this outro-target2 quad) + (-> (new 'static 'vector :x 13549568.0 :y -225280.0 :z 614400.0 :w 1.0) quad) + ) + (set! (-> this outro-plane2 quad) (-> this end-plane quad)) + (set! (-> this outro-plane2 w) (- (vector-dot (-> this outro-plane2) (-> this outro-target2)))) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate complete (task-manager-comb-travel) + :virtual #t + :code (behavior () + (send-event *target* 'end-mode 'pilot) + (send-event (handle->process (-> self player-vehicle)) 'sled-disable) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (let ((t9-3 (-> (find-parent-state) code))) + (if t9-3 + ((the-as (function none) t9-3)) + ) + ) + ) + ) + +;; definition of type task-manager-comb-wild-ride +(deftype task-manager-comb-wild-ride (task-manager-tube-ride) + () + ) + +;; definition for method 3 of type task-manager-comb-wild-ride +(defmethod inspect ((this task-manager-comb-wild-ride)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-tube-ride inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-comb-wild-ride +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-comb-wild-ride)) + (call-parent-method this) + (set! (-> this hp-scale) 2.0) + (set! (-> this end-sphere quad) + (-> (new 'static 'vector :x 68403.2 :y -14056653.0 :z -3796582.5 :w 409600.0) quad) + ) + (set! (-> this end-plane quad) (-> (new 'static 'vector :x -0.0162 :y -0.3505 :z -0.9364 :w 1.0) quad)) + (set! (-> this end-plane w) (- (vector-dot (-> this end-plane) (the-as vector (-> this end-sphere))))) + (set-blackout-frames (seconds 0.3)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/comba-init_REF.gc b/test/decompiler/reference/jak3/levels/comb/comba-init_REF.gc new file mode 100644 index 0000000000..df70b43bc9 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/comba-init_REF.gc @@ -0,0 +1,49 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function comba-login +;; WARN: Return type mismatch int vs none. +(defun comba-login ((arg0 level)) + (format 0 "comba-login~%") + 0 + (none) + ) + +;; definition for function comba-activate +;; WARN: Return type mismatch int vs none. +(defun comba-activate ((arg0 level)) + (format 0 "comba-activate~%") + (let ((v1-0 *traffic-info*) + (a0-2 (-> arg0 name)) + ) + (set! (-> v1-0 vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 10) a0-2) + (set! (-> v1-0 vehicle-levels 12) a0-2) + (set! (-> v1-0 vehicle-levels 13) a0-2) + (set! (-> v1-0 vehicle-levels 14) a0-2) + (set! (-> v1-0 vehicle-levels 15) a0-2) + (set! (-> v1-0 vehicle-levels 16) a0-2) + (set! (-> v1-0 vehicle-levels 17) a0-2) + (set! (-> v1-0 vehicle-levels 18) a0-2) + (set! (-> v1-0 vehicle-levels 19) a0-2) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +;; definition for function comba-deactivate +;; WARN: Return type mismatch int vs none. +(defun comba-deactivate ((arg0 level)) + (format 0 "comba-deactivate~%") + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 vehicle-level) (the-as level #f)) + ) + (vehicle-manager-kill) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/combx-scenes_REF.gc b/test/decompiler/reference/jak3/levels/comb/combx-scenes_REF.gc new file mode 100644 index 0000000000..ae2495c4e7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/combx-scenes_REF.gc @@ -0,0 +1,112 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-tpl-elevator-movie tpl-elevator tpl-elevator-lod0-jg tpl-elevator-idle-ja + ((tpl-elevator-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "comb-entrance-temple" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-206" + :art-group "scenecamera" + :anim "comb-entrance-temple" + :parts 5 + :command-list '((0 + (fadein (frame-time-30 10)) + (kill "tpl-mardoor-5") + (kill "tpl-elevator-2") + (kill "combx-elevator-1") + (send-event "tpl-elevator-movie" 'segment 1 2) + ) + (65 (send-event "tpl-elevator-movie" 'segment 3)) + (91 (want-load 'comba 'combx 'combb)) + (450 (want-display 'comba 'display)) + (532 (send-event "tpl-elevator-movie" 'segment 1 2)) + (555 (fadeout (frame-time-30 15))) + (10000 (restore "tpl-elevator-2") (restore "combx-elevator-1") (task-close! "temple-tests-resolution") (save)) + ) + :cut-list '(91 211 391) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'combx + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '(((90 500) set-flags local-space)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'combx + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "tpl-elevator-movie" + :level 'combx + :art-group "skel-tpl-elevator-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x1 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "temple-comb-entrance" + :end-point "comba-elevator" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(begin (sound-play-loop "tunnel-amb-mov") (sound-play-loop "launch-amb-mov")) + :on-complete #f + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc new file mode 100644 index 0000000000..1f4fa36e52 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/h-sled_REF.gc @@ -0,0 +1,2143 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hud-sled-health +(deftype hud-sled-health (hud) + () + ) + +;; definition for method 3 of type hud-sled-health +(defmethod inspect ((this hud-sled-health)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-sled-health +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-sled-health)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 5 366) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 4 6) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-1 (fmax 0.0 (fmin 1.0 (-> *game-info* health-bar-vehicle))))) + (set! (-> this sprites 1 color x) (the int (* 255.0 (- 1.0 f0-1)))) + (set! (-> this sprites 1 color y) (the int (* 255.0 f0-1))) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* 20.5 f0-1)) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-sled-health +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-sled-health)) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-sled-health +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-sled-health)) + (vehicle-entity-hack 27) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-lower-left-1) (gui-action play) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (lookup-texture-by-name + "hud-small-vehicle-health-bar-02" + (the-as string #f) + (the-as (pointer texture-page) #f) + ) + ) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags)) + (set! (-> this sprites 0 scale-x) 1.43) + (set! (-> this sprites 0 scale-y) 1.3) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 2.5) + (set! (-> this sprites 1 color w) 48) + 0 + (none) + ) + +;; definition for function hud-sled-health-spawn +(defun hud-sled-health-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn hud-sled-health :init hud-init-by-other :name "hud-sled-health" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + gp-0 + ) + ) + +;; definition of type pre-sled +(deftype pre-sled (process-drawable) + () + ) + +;; definition for method 3 of type pre-sled +(defmethod inspect ((this pre-sled)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type pre-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this pre-sled) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (vector+! (-> this root trans) (-> this root trans) (new 'static 'vector :w 1.0)) + (quaternion-rotate-y! (-> this root quat) (-> this root quat) 32768.0) + (let ((s4-0 (new 'stack 'traffic-object-spawn-params))) + (set! (-> s4-0 object-type) (the-as uint 6)) + (set! (-> s4-0 behavior) (the-as uint 0)) + (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)) + (set! (-> s4-0 guard-type) (the-as uint 11)) + (set! (-> s4-0 entity) arg0) + (vector-reset! (-> s4-0 velocity)) + (set! (-> s4-0 position quad) (-> this root trans quad)) + (quaternion-copy! (-> s4-0 rotation) (-> this root quat)) + (vehicle-spawn (vehicle-type h-sled) s4-0) + ) + (cleanup-for-death this) + ) + +;; definition for function sled-find-mesh-dir +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun sled-find-mesh-dir ((arg0 vector) (arg1 vector) (arg2 collide-tri-result)) + (local-vars (a0-8 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (new 'stack-no-clear 'h-sled-stack-var0))) + (vector-! (the-as vector (-> s4-0 vec)) (-> arg2 vertex 2) (-> arg2 vertex 1)) + (vector-! (-> s4-0 vec 1) (the-as vector (-> arg2 vertex)) (-> arg2 vertex 2)) + (vector-! (-> s4-0 vec 2) (-> arg2 vertex 1) (the-as vector (-> arg2 vertex))) + (set! (-> s4-0 byte0) -1) + (set! (-> s4-0 float1) -1.0) + (dotimes (v1-5 3) + (.lvf vf1 (&-> (-> s4-0 vec v1-5) 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 a0-8 vf1) + (set! (-> s4-0 float0) a0-8) + (when (< (-> s4-0 float1) (-> s4-0 float0)) + (set! (-> s4-0 float1) (-> s4-0 float0)) + (set! (-> s4-0 byte0) v1-5) + ) + ) + (if (< (-> s4-0 byte0) 2) + (set! (-> s4-0 vec (-> s4-0 byte0) quad) (-> s4-0 vec 2 quad)) + ) + (dotimes (s3-0 2) + (let ((s2-0 (-> s4-0 vec1 s3-0))) + (vector-normalize-copy! s2-0 (-> s4-0 vec s3-0) 1.0) + (let ((f0-5 (vector-dot s2-0 arg1))) + (when (< f0-5 0.0) + (vector-float*! s2-0 s2-0 -1.0) + (set! f0-5 (* -1.0 f0-5)) + ) + (if (>= f0-5 0.866) + (set! (-> arg0 quad) (-> s2-0 quad)) + ) + ) + ) + ) + ) + 0 + 0 + (none) + ) + ) + +;; definition of type sled-shot +(deftype sled-shot (projectile) + ((tail-pos vector :inline) + ) + ) + +;; definition for method 3 of type sled-shot +(defmethod inspect ((this sled-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (label cfg-4) + this + ) + +;; definition for method 24 of type sled-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this sled-shot)) + (draw-beam (-> *part-id-table* 4234) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 4235)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type sled-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this sled-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 4231 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 4231) a1-0 s5-1 #f) + (set! (-> *part-id-table* 4231 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 4232) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix))) + (* 0.000027126736 f30-0) + (-> *part-id-table* 4233 init-specs 3 initial-valuef) + (-> *part-id-table* 4233 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (launch-particles (-> *part-id-table* 4233) s4-1 :origin-is-matrix #t) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type sled-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this sled-shot)) + (let* ((gp-0 (-> this root)) + (a0-3 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> gp-0 trans)) 2048.0)) + (v1-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-2 quad) (-> gp-0 trans quad)) + (vector+! v1-2 v1-2 a0-3) + (cond + ((logtest? (-> *part-group-id-table* 211 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> v1-2 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 211)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function sled-shot-move +;; WARN: Return type mismatch int vs none. +(defun sled-shot-move ((arg0 sled-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s4-0 (-> arg0 root)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (vector-! s5-0 (-> arg0 tail-pos) (-> s4-0 trans)) + (let ((f0-0 (vector-length s5-0))) + (when (< 36864.0 f0-0) + (vector-normalize! s5-0 36864.0) + (vector+! (-> arg0 tail-pos) (-> s4-0 trans) s5-0) + ) + ) + ) + (if (or (logtest? (-> arg0 root status) (collide-status touch-actor)) (< 0.5 (-> arg0 root touch-angle))) + (go (method-of-object arg0 impact)) + ) + 0 + (none) + ) + +;; definition for function sled-shot-reaction +;; INFO: Used lq/sq +(defun sled-shot-reaction ((arg0 control-info) (arg1 collide-query) (arg2 vector) (arg3 vector)) + (cshape-reaction-update-state arg0 arg1 arg3) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 1))) + (vector+float*! + (-> s4-0 0) + arg3 + (-> arg0 surface-normal) + (* -1.01 (vector-dot arg3 (-> arg0 surface-normal))) + ) + (vector-normalize! (-> s4-0 0) 1024000.0) + (set! (-> arg2 quad) (-> s4-0 0 quad)) + ) + (-> arg0 status) + ) + +;; definition for method 30 of type sled-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this sled-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) sled-shot-reaction) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 4)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type sled-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod init-proj-settings! ((this sled-shot)) + (let ((t9-0 (method-of-type projectile init-proj-settings!))) + (t9-0 this) + ) + (set! (-> this attack-mode) 'sled-shot) + (set! (-> this move) sled-shot-move) + (set! (-> this max-speed) 1024000.0) + (set! (-> this damage) 1.0) + (set! (-> this timeout) (seconds 1)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-h-sled comb-rail-rider comb-rail-rider-lod0-jg comb-rail-rider-idle-ja + ((comb-rail-rider-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5.5) + :shadow comb-rail-rider-shadow-mg + ) + +;; definition for symbol *h-sled-explosion-info*, type vehicle-explosion-info +(define *h-sled-explosion-info* + (new 'static 'vehicle-explosion-info + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level 'comba + :skel #f + :skel-name "skel-vehicle-explosion" + :anim 2 + ) + ) + +;; definition for symbol *h-sled-constants*, type rigid-body-vehicle-constants +(define *h-sled-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 8.0 + :inv-mass 0.125 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.1 + :friction-factor 0.05 + :cm-offset-joint (new 'static 'vector :y 4096.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 5) (meters 2) (meters 10)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 72) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*h-sled-constants* + :flags #x4009 + :object-type #x14 + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 50) + :inv-max-engine-thrust 0.0000048828124 + :engine-response-rate 20.0 + :engine-intake-factor 1.0 + :brake-factor 1.0 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 400) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 3) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 2.0 + :air-drag-factor 1.0 + :steering-thruster-factor 3.0 + :steering-thruster-max-gain 3.5 + :steering-thruster-half-gain-speed (meters 15) + :tire-steering-angle 1274.3112 + :tire-steering-speed-factor 61440.0 + :tire-static-friction 0.5 + :tire-static-friction-speed (meters 1) + :tire-dynamic-friction 0.25 + :tire-dynamic-friction-speed (meters 3) + :tire-inv-max-friction-speed 0.000024414063 + :drag-force-factor 0.7 + :speed-scrubbing-drag 10.0 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters 3) + :turning-accel (meters 20) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 4.5) + :string-max-height (meters 4.5) + :string-min-length (meters 5) + :string-max-length (meters 12.5) + :min-fov 15109.688 + :max-fov 17476.268 + :head-offset 8192.0 + :foot-offset 4096.0 + :normal-max-angle-offset 5461.3335 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 16384.0 :z -41779.2 :w 1.0) + (new 'static 'vector :x -10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :x 10240.0 :y 8192.0 :w 1.0) + (new 'static 'vector :y 8192.0 :z 10240.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.09 + :engine-pitch-mod-amp 0.01 + :engine-sound-select 5 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "car-scrape-stn") + :glance-sound (static-sound-name "impact-soft") + :impact-sound (static-sound-name "impact-hard") + :explode-sound (static-sound-name "vehicle-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-1") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "combveh-start") + :engine-sound (static-sound-name "combveh-engine") + :engine-load-sound (static-sound-name "combveh-high") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 2 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3072.0 :z -14336.0 :w 1.0) + (new 'static 'vector :x -3072.0 :z -14336.0 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 (new 'static 'vector :w 1.0) (new 'static 'vector :w 1.0)) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1638.4 :y 4096.0 :z -13926.4 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -13926.4 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 12288.0 :w 1.0) + (new 'static 'vector :x -12288.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector :x -2867.2 :y 2048.0 :z 10240.0 :w 1.0) + (new 'static 'vector) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3276.8 :y 3276.8 :z -14131.2 :w 1.0) + (new 'static 'vector :x -3276.8 :y 3276.8 :z -14131.2 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 1.0 + :hit-points 40.0 + :inv-hit-points 0.025 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 4 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.25 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :y 819.2 :z 12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :y 819.2 :z 12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 8192.0 :y 819.2 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -8192.0 :y 819.2 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 819.2 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z 8192.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :z -8192.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 4096.0 :w 1.0) + :brake-local-pos (new 'static 'vector :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 4915.2 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 2 + :rider-stance #x1 + :grab-rail-array #f + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -2252.8 :y 5734.4 :z -1146.88 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 2252.8 :y 5734.4 :z -1146.88 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x -2252.8 :y 8192.0 :z 2375.68 :w 1.0) + (new 'static 'vector :x -2252.8 :y 8192.0 :z 2375.68 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xda + :debris #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *h-sled-constants* explosion) *h-sled-explosion-info*) + +;; definition of type h-sled-probe-work +(deftype h-sled-probe-work (structure) + ((local-pos vector :inline) + (local-normal vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (probe-pos vector :inline) + (ground-pos vector :inline) + (ground-normal vector :inline) + (velocity vector :inline) + (u-dir vector :inline) + (probe-uu float) + ) + ) + +;; definition for method 3 of type h-sled-probe-work +(defmethod inspect ((this h-sled-probe-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'h-sled-probe-work) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tlocal-normal: #~%" (-> this local-normal)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tprobe-pos: #~%" (-> this probe-pos)) + (format #t "~1Tground-pos: #~%" (-> this ground-pos)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tu-dir: #~%" (-> this u-dir)) + (format #t "~1Tprobe-uu: ~f~%" (-> this probe-uu)) + (label cfg-4) + this + ) + +;; definition of type h-sled-physics-work +(deftype h-sled-physics-work (structure) + ((mat matrix :inline) + (force vector :inline) + (velocity vector :inline) + (world-pos vector :inline) + (world-normal vector :inline) + (local-pos vector :inline) + (steering-axis vector :inline) + (lift-dir vector :inline) + (normal vector :inline) + (tmp vector :inline) + (p-body vector :inline) + (axis vector :inline) + (dir vector :inline) + (ground-normal vector :inline) + (edges vector 3 :inline) + (edge-dirs vector 3 :inline) + (impulse float) + (vel-dot-norm float) + (friction-coef float) + (speed-factor float) + (best-len float) + (len float) + (i-longest int8) + (probe-work-array h-sled-probe-work 4 :inline) + ) + ) + +;; definition for method 3 of type h-sled-physics-work +(defmethod inspect ((this h-sled-physics-work)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'h-sled-physics-work) + (format #t "~1Tmat: #~%" (-> this mat)) + (format #t "~1Tforce: #~%" (-> this force)) + (format #t "~1Tvelocity: #~%" (-> this velocity)) + (format #t "~1Tworld-pos: #~%" (-> this world-pos)) + (format #t "~1Tworld-normal: #~%" (-> this world-normal)) + (format #t "~1Tlocal-pos: #~%" (-> this local-pos)) + (format #t "~1Tsteering-axis: #~%" (-> this steering-axis)) + (format #t "~1Tlift-dir: #~%" (-> this lift-dir)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Ttmp: #~%" (-> this tmp)) + (format #t "~1Tp-body: #~%" (-> this p-body)) + (format #t "~1Taxis: #~%" (-> this axis)) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tground-normal: #~%" (-> this ground-normal)) + (format #t "~1Tedges[3] @ #x~X~%" (-> this edges)) + (format #t "~1Tedge-dirs[3] @ #x~X~%" (-> this edge-dirs)) + (format #t "~1Timpulse: ~f~%" (-> this impulse)) + (format #t "~1Tvel-dot-norm: ~f~%" (-> this vel-dot-norm)) + (format #t "~1Tfriction-coef: ~f~%" (-> this friction-coef)) + (format #t "~1Tspeed-factor: ~f~%" (-> this speed-factor)) + (format #t "~1Tbest-len: ~f~%" (-> this best-len)) + (format #t "~1Tlen: ~f~%" (-> this len)) + (format #t "~1Ti-longest: ~D~%" (-> this i-longest)) + (format #t "~1Tprobe-work-array[4] @ #x~X~%" (-> this probe-work-array)) + (label cfg-4) + this + ) + +;; definition of type h-sled +(deftype h-sled (vehicle) + ((health-hud handle) + (overturned-time time-frame) + (shoot-time time-frame) + (shoot-delay uint16) + (rider-hand-joint-array int8 2) + (i-barrel int8) + (ai-target-speed float) + (engine-thrust float) + (engine-sound-envelope float) + (engine-sound-id sound-id) + (steer-sound-id sound-id) + (turbo-sound-id sound-id) + (in-tunnel symbol :offset 756) + (whoosh-time time-frame) + (parts sparticle-launch-control 4) + (gravity-dir vector :inline) + (path-pos vector :inline) + (path-dir vector :inline) + (tunnel-dir vector :inline) + (prev-tunnel-dir vector :inline) + (sum-ground-normal vector :inline) + (normal-dir vector :inline) + (impact-normal vector :inline) + (side-dir vector :inline) + (ai-target-pos vector :inline) + (whoosh-pos vector :inline) + (ground-pos-array vector 4 :inline) + ) + (:methods + (fire-shot (_type_) none) + ) + ) + +;; definition for method 3 of type h-sled +(defmethod inspect ((this h-sled)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type vehicle inspect))) + (t9-0 this) + ) + (format #t "~2Thealth-hud: ~D~%" (-> this health-hud)) + (format #t "~2Toverturned-time: ~D~%" (-> this overturned-time)) + (format #t "~2Tshoot-time: ~D~%" (-> this shoot-time)) + (format #t "~2Tshoot-delay: ~D~%" (-> this shoot-delay)) + (format #t "~2Trider-hand-joint-array[2] @ #x~X~%" (-> this rider-hand-joint-array)) + (format #t "~2Ti-barrel: ~D~%" (-> this i-barrel)) + (format #t "~2Tai-target-speed: ~f~%" (-> this ai-target-speed)) + (format #t "~2Tengine-thrust: ~f~%" (-> this engine-thrust)) + (format #t "~2Tengine-sound-envelope: ~f~%" (-> this engine-sound-envelope)) + (format #t "~2Tengine-sound-id: ~D~%" (-> this engine-sound-id)) + (format #t "~2Tsteer-sound-id: ~D~%" (-> this steer-sound-id)) + (format #t "~2Tturbo-sound-id: ~D~%" (-> this turbo-sound-id)) + (format #t "~2Tengine-sound-envelope: ~f~%" (-> this engine-sound-envelope)) + (format #t "~2Tin-tunnel: ~A~%" (-> this in-tunnel)) + (format #t "~2Twhoosh-time: ~D~%" (-> this whoosh-time)) + (format #t "~2Tparts[4] @ #x~X~%" (-> this parts)) + (format #t "~2Tgravity-dir: #~%" (-> this gravity-dir)) + (format #t "~2Tpath-pos: #~%" (-> this path-pos)) + (format #t "~2Tpath-dir: #~%" (-> this path-dir)) + (format #t "~2Ttunnel-dir: #~%" (-> this tunnel-dir)) + (format #t "~2Tprev-tunnel-dir: #~%" (-> this prev-tunnel-dir)) + (format #t "~2Tsum-ground-normal: #~%" (-> this sum-ground-normal)) + (format #t "~2Tnormal-dir: #~%" (-> this normal-dir)) + (format #t "~2Timpact-normal: #~%" (-> this impact-normal)) + (format #t "~2Tside-dir: #~%" (-> this side-dir)) + (format #t "~2Tai-target-pos: #~%" (-> this ai-target-pos)) + (format #t "~2Twhoosh-pos: #~%" (-> this whoosh-pos)) + (format #t "~2Tground-pos-array[4] @ #x~X~%" (-> this ground-pos-array)) + (label cfg-4) + this + ) + +;; definition for method 7 of type h-sled +(defmethod relocate ((this h-sled) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this parts v1-0)) + (&+! (-> this parts v1-0) offset) + ) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type h-sled +(defmethod deactivate ((this h-sled)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (dotimes (s5-0 4) + (let ((a0-1 (-> this parts s5-0))) + (if (nonzero? a0-1) + (kill-particles a0-1) + ) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 113 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-113 ((this h-sled) (arg0 vector) (arg1 int) (arg2 int)) + (vector-matrix*! + arg0 + (-> this info rider rider-hand-offset arg2) + (-> this node-list data (-> this rider-hand-joint-array arg1) bone transform) + ) + 0 + (none) + ) + +;; definition for method 152 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod fire-shot ((this h-sled)) + (sound-play "combveh-fire") + (dotimes (s5-1 2) + (set! (-> this i-barrel) (logand (+ (-> this i-barrel) 1) 1)) + (let ((s4-1 (new 'stack-no-clear 'comb-sentry-stack-var0))) + (set! (-> s4-1 byte0) (-> this i-barrel)) + (let* ((v1-5 (-> s4-1 mat)) + (a3-1 (-> this rbody matrix)) + (a0-4 (-> a3-1 rvec quad)) + (a1-1 (-> a3-1 uvec quad)) + (a2-1 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-5 rvec quad) a0-4) + (set! (-> v1-5 uvec quad) a1-1) + (set! (-> v1-5 fvec quad) a2-1) + (set! (-> v1-5 trans quad) a3-2) + ) + (let ((v1-6 (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 5324.8 :z 6144.0 :w 1.0) + (new 'static 'vector :x -3686.4 :y 5324.8 :z 6144.0 :w 1.0) + ) + ) + ) + (vector-matrix*! (-> s4-1 vec2) (-> v1-6 (-> s4-1 byte0)) (-> s4-1 mat)) + ) + 0 + (let ((v1-8 (new 'static 'inline-array vector 2 + (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) + (new 'static 'vector :y 0.0871 :z 0.9961 :w 1.0) + ) + ) + ) + (vector-rotate*! (-> s4-1 vec3) (-> v1-8 (-> s4-1 byte0)) (-> s4-1 mat)) + ) + (vector-float*! (-> s4-1 vec4) (-> s4-1 vec3) 1024000.0) + (vector+! (-> s4-1 vec4) (-> s4-1 vec4) (-> this rbody lin-velocity)) + (set! (-> s4-1 params ent) (-> this entity)) + (set! (-> s4-1 params charge) 1.0) + (set! (-> s4-1 params options) (projectile-options)) + (logclear! (-> s4-1 params options) (projectile-options po14 po15 po16)) + (set! (-> s4-1 params pos quad) (-> s4-1 vec2 quad)) + (set! (-> s4-1 params vel quad) (-> s4-1 vec4 quad)) + (set! (-> s4-1 params notify-handle) (the-as handle #f)) + (set! (-> s4-1 params owner-handle) (the-as handle #f)) + (set! (-> s4-1 params target-handle) (the-as handle #f)) + (set! (-> s4-1 params target-pos quad) (the-as uint128 0)) + (set! (-> s4-1 params ignore-handle) (process->handle this)) + (let* ((v1-23 *game-info*) + (a0-20 (+ (-> v1-23 attack-id) 1)) + ) + (set! (-> v1-23 attack-id) a0-20) + (set! (-> s4-1 params attack-id) a0-20) + ) + (set! (-> s4-1 params timeout) (seconds 4)) + (spawn-projectile sled-shot (-> s4-1 params) this *default-dead-pool*) + ) + ) + (none) + ) + +;; definition for method 34 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-sled)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 8) 0))) + (set! (-> s5-0 total-prims) (the-as uint 9)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((a0-5 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> a0-5 prim-core action) (collide-action solid)) + (set! (-> a0-5 transform-index) 0) + ) + (let ((a0-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> a0-7 prim-core action) (collide-action solid)) + (set! (-> a0-7 transform-index) 0) + ) + (let ((a0-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> a0-9 prim-core action) (collide-action solid)) + (set! (-> a0-9 transform-index) 0) + ) + (let ((a0-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> a0-11 prim-core action) (collide-action solid)) + (set! (-> a0-11 transform-index) 0) + ) + (let ((a0-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 5)))) + (set! (-> a0-13 prim-core action) (collide-action solid)) + (set! (-> a0-13 transform-index) 0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 80)))) + (set! (-> v1-20 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-20 transform-index) 0) + (set! (-> v1-20 nav-radius) 20480.0) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-22 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-22 transform-index) 0) + (set! (-> v1-22 nav-radius) 20480.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-24 prim-core action) (collide-action solid rideable)) + (set! (-> v1-24 transform-index) 3) + (set-vector! (-> v1-24 local-sphere) 0.0 0.0 0.0 18432.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-26 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-26 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-26 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 62 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-62 ((this h-sled)) + (let ((s5-0 (-> this root root-prim))) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 0 local-sphere)) + (the-as pointer (new 'static 'vector :x 6144.0 :y 5324.8 :z 7864.32 :w 5324.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 1 local-sphere)) + (the-as pointer (new 'static 'vector :x -6144.0 :y 5324.8 :z 7864.32 :w 5324.8)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 2 local-sphere)) + (the-as pointer (new 'static 'vector :x 7372.8 :y 4096.0 :z -11878.4 :w 4096.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 3 local-sphere)) + (the-as pointer (new 'static 'vector :x -7372.8 :y 4096.0 :z -11878.4 :w 4096.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 4 local-sphere)) + (the-as pointer (new 'static 'vector :y 4505.6 :z 15155.2 :w 4505.6)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 5 local-sphere)) + (the-as pointer (new 'static 'vector :y 6144.0 :z -1638.4 :w 6144.0)) + 16 + ) + (mem-copy! + (the-as pointer (-> (the-as collide-shape-prim-group s5-0) child 6 local-sphere)) + (the-as pointer (new 'static 'vector :y 5734.4 :z -13516.8 :w 5734.4)) + 16 + ) + ) + (call-parent-method this) + 0 + (none) + ) + +;; definition for method 33 of type h-sled +(defmethod alloc-rbody-control! ((this h-sled) (arg0 rigid-body-object-constants)) + (let ((s4-0 (new 'stack-no-clear 'inline-array 'vector 2))) + (vector-y-quaternion! (-> s4-0 0) (-> this root quat)) + (vector+float*! + (-> this root trans) + (-> this root trans) + (-> s4-0 0) + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-height) + ) + (quaternion-axis-angle! + (the-as quaternion (-> s4-0 1)) + 1.0 + 0.0 + 0.0 + (-> (the-as rigid-body-vehicle-constants arg0) setup settle-rot-x) + ) + (quaternion*! (-> this root quat) (-> this root quat) (the-as quaternion (-> s4-0 1))) + ) + ((method-of-type vehicle alloc-rbody-control!) this (the-as rigid-body-vehicle-constants arg0)) + (none) + ) + +;; definition for method 35 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-sled)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-sled" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-sled-constants*) + (set! (-> this draw light-index) (the-as uint 10)) + (set! (-> this draw lod-set lod 0 dist) 2457600.0) + (set! (-> this draw lod-set lod 1 dist) 2457600.0) + (set! (-> this draw lod-set lod 2 dist) 2457600.0) + (set! (-> this draw lod-set lod 3 dist) 2457600.0) + (set! (-> this rider-hand-joint-array 0) 3) + (set! (-> this rider-hand-joint-array 1) 3) + (set! (-> this path-pos quad) (-> this root trans quad)) + (set! (-> this shoot-delay) (the-as uint 30)) + (set! (-> this in-tunnel) #f) + (dotimes (s5-1 4) + (set! (-> this parts s5-1) (create-launch-control (-> *part-group-id-table* 1234) this)) + ) + (set! (-> this health-hud) (the-as handle #f)) + (set! (-> this max-time-step) 0.02) + 0 + (none) + ) + +;; definition for method 132 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-132 ((this h-sled) (arg0 traffic-object-spawn-params)) + (set! (-> this entity) (the-as entity-actor (-> arg0 entity))) + (if (not (-> this entity)) + (set! (-> this entity) (entity-by-type pre-sled)) + ) + (set! (-> this v-flags) + (the-as vehicle-flag (logior (vehicle-flag ignore-damage ignore-impulse) (-> this v-flags))) + ) + (when (-> this entity) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (if (nonzero? (-> this path)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + ) + ) + (call-parent-method this arg0) + 0 + (none) + ) + +;; definition for method 92 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-92 ((this h-sled) (arg0 vehicle-controls)) + (seek! (-> this controls steering) (-> arg0 steering) (* 8.0 (seconds-per-frame))) + (seek! (-> this controls lean-z) (-> arg0 lean-z) (* 8.0 (seconds-per-frame))) + (let ((f0-10 (-> arg0 throttle)) + (f30-0 (-> arg0 brake)) + ) + (seek! (-> this controls throttle) f0-10 (* 4.0 (seconds-per-frame))) + (set! (-> this controls brake) f30-0) + ) + (set! (-> this controls prev-flags) (-> this controls flags)) + (set! (-> this controls flags) (-> arg0 flags)) + 0 + (none) + ) + +;; definition for method 88 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-88 ((this h-sled) (arg0 vehicle-controls)) + (set! (-> arg0 steering) (analog-input (the-as int (-> *cpad-list* cpads 0 leftx)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 lean-z) (analog-input (the-as int (-> *cpad-list* cpads 0 lefty)) 128.0 48.0 110.0 -1.0)) + (set! (-> arg0 throttle) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 6))))) + (set! (-> arg0 brake) (fmin 1.0 (* 0.023529412 (the float (-> *cpad-list* cpads 0 abutton 7))))) + (if (cpad-pressed? 0 r1) + (logior! (-> arg0 flags) (vehicle-controls-flag vcf1)) + ) + 0 + (none) + ) + +;; definition for method 90 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod control-hook-ai ((this h-sled) (arg0 vehicle-controls)) + (let ((gp-0 (new 'stack-no-clear 'h-sled-physics-work))) + (mem-set32! (the-as pointer (-> gp-0 mat)) 6 0) + (set! (-> gp-0 p-body y) (seconds-per-frame)) + (set! (-> gp-0 mat fvec quad) (-> this rbody position quad)) + (set! (-> gp-0 mat trans quad) (-> this rbody lin-velocity quad)) + (set! (-> gp-0 steering-axis quad) (-> this rbody matrix fvec quad)) + (set! (-> gp-0 local-pos quad) (-> this rbody matrix rvec quad)) + (set! (-> gp-0 tmp x) (vector-length (-> gp-0 mat trans))) + (set! (-> gp-0 p-body x) (vector-dot (-> gp-0 mat trans) (-> gp-0 steering-axis))) + (set! (-> gp-0 tmp z) (-> this ai-target-speed)) + (set! (-> gp-0 world-pos quad) (-> this ai-target-pos quad)) + (vector-! (-> gp-0 lift-dir) (-> gp-0 world-pos) (-> gp-0 mat fvec)) + (set! (-> gp-0 tmp w) (* 0.00036621094 + (- (-> gp-0 tmp z) (-> gp-0 p-body x)) + (-> this info handling ai-throttle-factor) + (-> gp-0 p-body y) + ) + ) + (set! (-> gp-0 mat rvec y) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) (-> gp-0 tmp w))))) + (set! (-> gp-0 mat rvec x) (fmax -1.0 (fmin 1.0 (* 0.000012207031 + (-> this info handling ai-steering-factor) + (vector-dot (-> gp-0 local-pos) (-> gp-0 lift-dir)) + ) + ) + ) + ) + (vehicle-method-92 this (the-as vehicle-controls (-> gp-0 mat))) + ) + 0 + (none) + ) + +;; definition for method 82 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-82 ((this h-sled)) + 0 + (none) + ) + +;; definition for method 83 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-83 ((this h-sled)) + 0 + (none) + ) + +;; definition for method 94 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-94 ((this h-sled)) + 0 + (none) + ) + +;; definition for method 48 of type h-sled +;; INFO: Used lq/sq +(defmethod on-impact ((this h-sled) (arg0 rigid-body-impact)) + (set! (-> this impact-normal quad) (-> arg0 normal quad)) + (call-parent-method this arg0) + (none) + ) + +;; definition for method 49 of type h-sled +;; INFO: Used lq/sq +(defmethod rbody-event-handler ((this h-sled) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-4 object)) + (case arg2 + (('turbo-pad) + (when (not (logtest? (vehicle-flag turbo-boost) (-> this v-flags))) + (sound-play "special-pickup") + (sound-play "launch-whoosh") + ) + (the-as float (-> arg3 param 0)) + (set! (-> this turbo-boost-factor) 4.0) + (set! (-> this turbo-boost-time) (the-as uint (current-time))) + (set! (-> this turbo-boost-duration) (the-as uint 60)) + (set! v0-4 (logior (vehicle-flag turbo-boost) (-> this v-flags))) + (set! (-> this v-flags) (the-as vehicle-flag v0-4)) + v0-4 + ) + (('sled-disable) + (set! v0-4 (logior (-> this v-flags) (vehicle-flag dead))) + (set! (-> this v-flags) (the-as vehicle-flag v0-4)) + v0-4 + ) + (('ai-set-target-speed) + (set! (-> this ai-target-speed) (the-as float (-> arg3 param 0))) + ) + (('ai-set-target-position) + (let ((v1-15 (the-as object (-> arg3 param 0)))) + (set! v0-4 (-> this ai-target-pos)) + (set! (-> (the-as vector v0-4) quad) (-> (the-as vector v1-15) quad)) + ) + v0-4 + ) + (('hide) + (set! v0-4 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-4)) + v0-4 + ) + (('unhide) + (set! v0-4 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-4)) + v0-4 + ) + (('in-tunnel) + (set! (-> this in-tunnel) (the-as symbol (-> arg3 param 0))) + (set! (-> this whoosh-pos quad) (-> this root trans quad)) + (set! v0-4 (current-time)) + (set! (-> this whoosh-time) (the-as time-frame v0-4)) + v0-4 + ) + (else + ((method-of-type vehicle rbody-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 93 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-93 ((this h-sled)) + (let ((t9-0 (method-of-type vehicle vehicle-method-93))) + (t9-0 this) + ) + (let ((f0-0 (vector-vector-distance (-> this path-pos) (-> this root trans)))) + (when (-> this in-tunnel) + (if (or (< 204800.0 f0-0) (< (vector-dot (-> this tunnel-dir) (-> this rbody lin-velocity)) 40960.0)) + (set! (-> this hit-points) -1.0) + ) + ) + ) + 0 + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((a0-4 (camera-matrix))) + (vector-float*! (-> s5-0 rvec) (-> a0-4 uvec) -1.0) + ) + (set! (-> s5-0 uvec quad) (-> this tunnel-dir quad)) + (vector+float*! (-> s5-0 rvec) (-> s5-0 rvec) (-> s5-0 uvec) (- (vector-dot (-> s5-0 rvec) (-> s5-0 uvec)))) + (vector-normalize! (-> s5-0 rvec) 1.0) + (set! (-> this gravity-dir quad) (-> s5-0 rvec quad)) + ) + (if (or (not (logtest? (-> this v-flags) (vehicle-flag on-ground))) + (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + ) + (set! (-> this gravity-dir quad) (-> (new 'static 'vector :y -1.0 :w 1.0) quad)) + ) + (cond + ((logtest? (vehicle-flag ignition) (-> this v-flags)) + (let ((f1-4 (+ 0.75 (* 0.25 (-> this controls throttle))))) + (if (logtest? (vehicle-flag turbo-boost) (-> this v-flags)) + (set! f1-4 (+ 1.0 (* (-> this turbo-boost-factor) (-> this info handling turbo-boost-factor)))) + ) + (if (< (-> this engine-thrust) f1-4) + (+! (-> this engine-thrust) + (* (- f1-4 (-> this engine-thrust)) + (fmin 1.0 (* (-> this info handling engine-response-rate) (seconds-per-frame))) + ) + ) + (seek! (-> this engine-thrust) f1-4 (seconds-per-frame)) + ) + ) + ) + (else + (set! (-> this engine-thrust) 0.0) + ) + ) + 0 + (none) + ) + +;; definition for method 77 of type h-sled +(defmethod vehicle-method-77 ((this h-sled)) + (local-vars (v1-10 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag sounds particles) (-> this v-flags)))) + (let ((v1-3 (-> this rbody))) + (cond + ((logtest? (vehicle-flag overturned) (-> this v-flags)) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag in-air))) (< 0.0 (-> v1-3 matrix uvec y))) + (set! (-> this v-flags) (the-as vehicle-flag (logclear (-> this v-flags) (vehicle-flag overturned)))) + ) + ) + (else + (when (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (-> v1-3 matrix uvec y) 0.0) + (let ((v1-9 (-> v1-3 ang-velocity)) + (f1-2 4.0) + ) + (.lvf vf1 (&-> v1-9 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-10 vf1) + (< v1-10 (* f1-2 f1-2)) + ) + ) + (set! (-> this v-flags) (the-as vehicle-flag (logior (vehicle-flag overturned) (-> this v-flags)))) + (set-time! (-> this overturned-time)) + ) + ) + ) + ) + (when (logtest? (vehicle-flag player-driving) (-> this v-flags)) + (when (and (logtest? (-> this controls flags) (vehicle-controls-flag vcf1)) + (time-elapsed? (-> this shoot-time) (the-as time-frame (-> this shoot-delay))) + ) + (set-time! (-> this shoot-time)) + (fire-shot this) + ) + (set! (-> *game-info* health-bar-vehicle) (-> this hit-points)) + ) + ((method-of-type vehicle vehicle-method-77) this) + (none) + ) + ) + +;; definition for method 106 of type h-sled +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-106 ((this h-sled)) + (let ((t9-0 (method-of-type vehicle vehicle-method-106))) + (t9-0 this) + ) + (sound-stop (-> this engine-sound-id)) + (sound-stop (-> this steer-sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this engine-sound-envelope) 0.0) + 0 + (none) + ) + +;; definition for method 38 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-38 ((this h-sled)) + (let ((t9-0 (method-of-type vehicle rigid-body-object-method-38))) + (t9-0 this) + ) + (if (logtest? (vehicle-flag ignition) (-> this v-flags)) + (seek! (-> this engine-sound-envelope) 1.0 (* 2.0 (seconds-per-frame))) + (seek! (-> this engine-sound-envelope) 0.0 (seconds-per-frame)) + ) + (when (-> this in-tunnel) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> s5-0 fvec x) + (fmax 0.0 (fmin 2.0 (* 0.0000030517579 (vector-dot (-> this tunnel-dir) (-> this root transv))))) + ) + (set! (-> s5-0 uvec quad) (-> this root trans quad)) + (vector-! (-> s5-0 rvec) (-> s5-0 uvec) (-> this whoosh-pos)) + (when (< 131072.0 (vector-dot (-> this tunnel-dir) (-> s5-0 rvec))) + (sound-play-by-name + (static-sound-name "pass-whoosh1") + (new-sound-id) + 1024 + (the int (* 1524.0 (-> s5-0 fvec x))) + 0 + (sound-group) + #t + ) + (set! (-> this whoosh-pos quad) (-> s5-0 uvec quad)) + (set-time! (-> this whoosh-time)) + ) + (set! (-> s5-0 fvec x) + (fmax 0.0 (fmin 2.0 (* 0.000002325149 (vector-dot (-> this tunnel-dir) (-> this root transv))))) + ) + ) + ) + (cond + ((< 0.0 (-> this engine-sound-envelope)) + (when (zero? (-> this engine-sound-id)) + (set! (-> this engine-sound-id) (new-sound-id)) + (set! (-> this steer-sound-id) (new-sound-id)) + (set! (-> this turbo-sound-id) (new-sound-id)) + ) + (let ((s5-1 (new 'stack-no-clear 'inline-array 'vector 2))) + (set! (-> s5-1 0 x) + (fmax 0.0 (fmin 2.0 (* 0.000002325149 (vector-dot (-> this tunnel-dir) (-> this root transv))))) + ) + (set! (-> s5-1 0 y) + (fmax 0.0 (fmin 1.0 (* 0.0000048828124 (fabs (vector-dot (-> this side-dir) (-> this root transv)))))) + ) + (set! (-> s5-1 0 z) (fmin 1.0 (* (-> this engine-sound-envelope) (+ 0.6 (* 0.4 (-> s5-1 0 x)))))) + (set! (-> s5-1 0 w) (fmin 1.0 (-> s5-1 0 x))) + (set! (-> s5-1 1 x) (fmax 0.0 (fmin 1.0 (+ -1.0 (-> s5-1 0 x))))) + (set! (-> s5-1 1 y) (* 0.0 (-> s5-1 1 x))) + (set! (-> s5-1 1 z) (-> s5-1 0 y)) + (set! (-> s5-1 1 w) (* 0.5 (-> s5-1 0 y))) + (set! (-> s5-1 0 z) (cube-root (-> s5-1 0 z))) + (set! (-> s5-1 1 x) (cube-root (-> s5-1 1 x))) + (set! (-> s5-1 1 z) (cube-root (-> s5-1 1 z))) + (sound-play-by-name + (static-sound-name "combveh-engine") + (-> this engine-sound-id) + (the int (* 1024.0 (-> s5-1 0 z))) + (the int (* 1524.0 (-> s5-1 0 w))) + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "combveh-airloop") + (-> this steer-sound-id) + (the int (* 1024.0 (-> s5-1 1 z))) + (the int (* 1524.0 (-> s5-1 1 w))) + 0 + (sound-group) + #t + ) + (sound-play-by-name + (static-sound-name "combveh-high") + (-> this turbo-sound-id) + (the int (* 1024.0 (-> s5-1 1 x))) + (the int (* 1524.0 (-> s5-1 1 y))) + 0 + (sound-group) + #t + ) + ) + ) + (else + (when (nonzero? (-> this engine-sound-id)) + (sound-stop (-> this engine-sound-id)) + (sound-stop (-> this steer-sound-id)) + (sound-stop (-> this turbo-sound-id)) + (set! (-> this engine-sound-id) (new 'static 'sound-id)) + 0 + ) + ) + ) + 0 + (none) + ) + +;; definition for method 97 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-97 ((this h-sled) (arg0 float) (arg1 vehicle-physics-work)) + (local-vars (v1-59 float) (v1-63 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (-> this rbody))) + (mem-copy! (the-as pointer (-> (the-as h-sled-physics-work arg1) mat)) (the-as pointer (-> s3-0 matrix)) 64) + (logior! (-> this v-flags) (vehicle-flag in-air)) + (logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (vector-reset! (-> this sum-ground-normal)) + (let ((f30-0 (-> this info handling ground-probe-distance)) + (s2-0 (new 'stack-no-clear 'collide-query)) + ) + (set! (-> (the-as h-sled-physics-work arg1) speed-factor) + (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 lin-velocity)))))) + ) + (vector-float*! + (-> (the-as h-sled-physics-work arg1) lift-dir) + (-> (the-as h-sled-physics-work arg1) mat uvec) + -1.0 + ) + (vector-float*! (-> s2-0 move-dist) (-> (the-as h-sled-physics-work arg1) lift-dir) (the-as float f30-0)) + (let ((v1-15 s2-0)) + (set! (-> v1-15 radius) 409.6) + (set! (-> v1-15 collide-with) (collide-spec + backgnd + bot + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-15 ignore-process0) #f) + (set! (-> v1-15 ignore-process1) #f) + (set! (-> v1-15 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-15 action-mask) (collide-action solid)) + ) + (dotimes (s1-0 (-> this info physics-model lift-thruster-count)) + (let ((v1-18 (-> this info physics-model lift-thruster-array s1-0)) + (s0-0 (-> (the-as h-sled-physics-work arg1) probe-work-array s1-0)) + ) + (set! (-> s0-0 local-pos quad) (-> v1-18 local-pos quad)) + (set! (-> s0-0 local-normal quad) (-> v1-18 rot quad)) + (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> (the-as h-sled-physics-work arg1) mat)) + (set! (-> s0-0 probe-pos quad) (-> s0-0 world-pos quad)) + (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) + (vector-reset! (-> s0-0 ground-normal)) + (vector-reset! (-> s0-0 u-dir)) + (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) + (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (set! (-> s0-0 probe-uu) (probe-using-line-sphere *collide-cache* s2-0)) + (cond + ((and (>= (-> s0-0 probe-uu) 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) + (logclear! (-> this v-flags) (vehicle-flag in-air)) + (logior! (-> this v-flags) (vehicle-flag on-ground)) + (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) + (vector+! (-> this sum-ground-normal) (-> this sum-ground-normal) (-> s0-0 ground-normal)) + (sled-find-mesh-dir (-> s0-0 u-dir) (-> this path-dir) (-> s2-0 best-other-tri)) + ) + (else + (set! (-> s0-0 probe-uu) 1.0) + ) + ) + (vector+float*! + (-> s0-0 ground-pos) + (-> s0-0 probe-pos) + (-> (the-as h-sled-physics-work arg1) lift-dir) + (the-as float f30-0) + ) + 0 + ) + ) + ) + ) + (set! (-> this prev-tunnel-dir quad) (-> this tunnel-dir quad)) + (vector-reset! (-> this tunnel-dir)) + (dotimes (v1-55 (-> this info physics-model lift-thruster-count)) + (let ((a2-5 (-> (the-as h-sled-physics-work arg1) probe-work-array v1-55))) + (vector+! (-> this tunnel-dir) (-> this tunnel-dir) (-> a2-5 u-dir)) + ) + ) + (let ((f0-9 0.0)) + (.lvf vf1 (&-> (-> this tunnel-dir) 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-59 vf1) + (if (< f0-9 v1-59) + (vector-normalize! (-> this tunnel-dir) 1.0) + (set! (-> this tunnel-dir quad) (-> this path-dir quad)) + ) + ) + (let ((f0-10 0.0)) + (.lvf vf1 (&-> (-> this sum-ground-normal) 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-63 vf1) + (when (< f0-10 v1-63) + (set! (-> this normal-dir quad) (-> this sum-ground-normal quad)) + (vector-normalize! (-> this normal-dir) 1.0) + (vector-float*! (-> this gravity-dir) (-> this normal-dir) -1.0) + (vector-cross! (-> this side-dir) (-> this normal-dir) (-> this tunnel-dir)) + (vector-normalize! (-> this side-dir) 1.0) + ) + ) + (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) + (let ((s2-1 (new 'stack-no-clear 'inline-array 'vector 1))) + (matrix-from-two-vectors! (the-as matrix (-> s2-1 0)) (-> this prev-tunnel-dir) (-> this tunnel-dir)) + (vector-rotate*! (-> s3-0 lin-momentum) (-> s3-0 lin-momentum) (the-as matrix (-> s2-1 0))) + ) + (init-velocities! (-> this rbody)) + ) + (dotimes (s2-2 (-> this info physics-model lift-thruster-count)) + (let ((v1-78 (-> (the-as h-sled-physics-work arg1) probe-work-array s2-2))) + (set! (-> (the-as h-sled-physics-work arg1) world-pos quad) (-> v1-78 world-pos quad)) + (set! (-> (the-as h-sled-physics-work arg1) velocity quad) (-> v1-78 velocity quad)) + (let ((s1-1 (new 'stack-no-clear 'vector))) + (when (< (-> v1-78 probe-uu) 1.0) + (set! (-> s1-1 x) (- 0.5 (-> v1-78 probe-uu))) + (let ((a0-54 (-> (the-as h-sled-physics-work arg1) force)) + (a1-26 (-> v1-78 ground-normal)) + (f0-15 0.5) + (f1-7 arg0) + ) + (vector-float*! + a0-54 + a1-26 + (* f0-15 + (/ 1.0 f1-7) + (-> this info physics-model inv-lift-thruster-count) + (-> this info info mass) + (- (vector-dot (-> (the-as h-sled-physics-work arg1) velocity) (-> v1-78 ground-normal))) + ) + ) + ) + (apply-impact! + s3-0 + (-> (the-as h-sled-physics-work arg1) world-pos) + (-> (the-as h-sled-physics-work arg1) force) + ) + (let ((f0-25 + (* 16.0 + (-> this info info mass) + (-> this info extra gravity) + (-> this info physics-model inv-lift-thruster-count) + (-> s1-1 x) + (-> this info handling spring-lift-factor) + ) + ) + ) + (vector-float*! + (-> (the-as h-sled-physics-work arg1) force) + (-> (the-as h-sled-physics-work arg1) lift-dir) + (* -1.0 f0-25) + ) + ) + (apply-impact! + s3-0 + (-> (the-as h-sled-physics-work arg1) world-pos) + (-> (the-as h-sled-physics-work arg1) force) + ) + ) + ) + ) + 0 + ) + ) + 0 + (none) + ) + ) + +;; definition for method 31 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-gravity! ((this h-sled) (arg0 float)) + (let ((s4-0 (new 'stack-no-clear 'h-sled-physics-work)) + (s3-0 (-> this rbody)) + ) + (let ((s2-0 (-> this info))) + (mem-copy! (the-as pointer (-> s4-0 mat)) (the-as pointer (-> s3-0 matrix)) 64) + (when (nonzero? (-> this path)) + (let ((s1-0 (new 'stack-no-clear 'matrix))) + (set! (-> s1-0 fvec x) (path-control-method-24 (-> this path) (-> s3-0 position))) + (displacement-between-two-points-normalized! (-> this path) (-> s1-0 rvec) (-> s1-0 fvec x)) + (get-point-in-path! (-> this path) (-> s1-0 uvec) (-> s1-0 fvec x) 'interp) + (set! (-> this path-pos quad) (-> s1-0 uvec quad)) + (vector-float*! (-> this path-dir) (-> s1-0 rvec) -1.0) + ) + 0 + ) + (dotimes (v1-12 4) + (vector-reset! (-> this ground-pos-array v1-12)) + ) + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (vehicle-method-97 this arg0 (the-as vehicle-physics-work s4-0)) + (dotimes (v1-20 4) + (let ((a0-15 (-> s4-0 probe-work-array v1-20))) + (if (< (-> a0-15 probe-uu) 1.0) + (set! (-> this ground-pos-array v1-20 quad) (-> a0-15 ground-pos quad)) + ) + ) + ) + (let ((s1-1 (new 'stack-no-clear 'matrix))) + (set! (-> s1-1 fvec quad) (-> s3-0 matrix fvec quad)) + (set! (-> s1-1 uvec quad) (-> s3-0 matrix uvec quad)) + (set! (-> s1-1 trans quad) (-> s3-0 matrix rvec quad)) + (vector-! (-> s1-1 rvec) (-> this tunnel-dir) (-> s1-1 fvec)) + (vector+float*! (-> s1-1 rvec) (-> s1-1 rvec) (-> s1-1 uvec) (- (vector-dot (-> s1-1 rvec) (-> s1-1 uvec)))) + (vector+float*! (-> s4-0 world-pos) (-> s3-0 position) (-> s1-1 fvec) 4096.0) + (vector-float*! + (-> s4-0 force) + (-> s1-1 trans) + (+ (* 8192000.0 (vector-dot (-> s1-1 trans) (-> s1-1 rvec))) + (* -1638400.0 (vector-dot (-> s1-1 uvec) (-> s3-0 ang-velocity))) + ) + ) + (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + (add-debug-vector #t (bucket-id debug-no-zbuf1) (-> s4-0 world-pos) (-> s1-1 rvec) (meters 1) *color-red*) + ) + (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) + (let ((v1-39 (new 'stack-no-clear 'matrix))) + (set! (-> v1-39 rvec quad) (-> s3-0 matrix rvec quad)) + (set! (-> v1-39 rvec quad) (-> this side-dir quad)) + (set! (-> v1-39 uvec w) (vector-dot (-> v1-39 rvec) (-> s3-0 lin-velocity))) + (set! (-> v1-39 uvec z) (* (fabs (-> v1-39 uvec w)) (-> s2-0 info mass) (/ 1.0 arg0))) + (set! (-> v1-39 uvec y) + (fmax (fmin (* -4.0 (-> s2-0 info mass) (-> v1-39 uvec w)) (-> v1-39 uvec z)) (- (-> v1-39 uvec z))) + ) + (set! (-> v1-39 uvec x) (* 4.8 (-> s2-0 extra gravity) (-> s2-0 info mass) (-> this controls steering))) + (vector-float*! (-> s4-0 force) (-> v1-39 rvec) (+ (-> v1-39 uvec x) (-> v1-39 uvec y))) + ) + (add-force! s3-0 (-> s4-0 force)) + ) + (when (or (and (logtest? (-> this v-flags) (vehicle-flag in-air)) + (logtest? (-> this v-flags) (vehicle-flag impact)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (< (vector-dot (-> s3-0 matrix uvec) (-> this impact-normal)) 0.0) + ) + (logtest? (vehicle-flag overturned) (-> this v-flags)) + ) + (vector-reset! (-> s4-0 local-pos)) + (set! (-> s4-0 local-pos y) -6144.0) + (when (logtest? (vehicle-flag overturned) (-> this v-flags)) + (let ((f0-33 (* 0.0033333334 (the float (- (current-time) (-> this overturned-time)))))) + (set! (-> s4-0 local-pos y) (* (+ -32768.0 (* -16384.0 f0-33)) (fmax 0.1 (- (-> s3-0 matrix uvec y))))) + ) + ) + (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) + (vector-float*! (-> s4-0 force) (-> this impact-normal) (* -0.5 (-> s2-0 extra gravity) (-> s2-0 info mass))) + (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (when (logtest? (-> this v-flags) (vehicle-flag on-ground)) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (vector-matrix*! (-> s4-0 world-pos) (-> s2-0 physics-model engine-thrust-local-pos) (-> s4-0 mat)) + (set! (-> s4-0 dir quad) (-> s4-0 mat fvec quad)) + (let ((f0-42 (* (-> this engine-thrust) (-> s2-0 handling max-engine-thrust) (-> s2-0 info mass)))) + (vector-float*! (-> s4-0 force) (-> s4-0 dir) f0-42) + ) + (apply-impact! s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (when (not (logtest? (vehicle-flag player-driving) (-> this v-flags))) + (vector-matrix*! (-> s4-0 world-pos) (-> s2-0 physics-model brake-local-pos) (-> s4-0 mat)) + (rigid-body-control-method-23 s3-0 (-> s4-0 world-pos) (-> s4-0 velocity)) + (let* ((f3-0 (vector-length (-> s4-0 velocity))) + (f0-43 (-> s2-0 info mass)) + (f1-28 (/ 0.5 arg0)) + (f2-7 98304.0) + (f3-1 (fmax 16384.0 f3-0)) + (f0-44 (* f0-43 (fmin f1-28 (* f2-7 (/ 1.0 f3-1) (-> s2-0 handling brake-factor))))) + ) + (vector-float*! (-> s4-0 force) (-> s4-0 velocity) (- f0-44)) + ) + (apply-impact! s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (set! (-> s4-0 dir quad) (-> this tunnel-dir quad)) + (let ((f0-47 (vector-dot (-> s4-0 dir) (-> s3-0 lin-velocity)))) + (vector-float*! + (-> s4-0 force) + (-> s4-0 dir) + (* -0.000012207031 (fabs f0-47) f0-47 (-> s2-0 handling drag-force-factor)) + ) + ) + (add-force! s3-0 (-> s4-0 force)) + ) + (set! (-> s4-0 local-pos quad) (-> (new 'static 'vector :z -16384.0 :w 1.0) quad)) + (vector-matrix*! (-> s4-0 world-pos) (-> s4-0 local-pos) (-> s4-0 mat)) + (rigid-body-control-method-23 s3-0 (-> s4-0 world-pos) (-> s4-0 velocity)) + (vector-reset! (-> s4-0 force)) + (set! (-> s4-0 dir quad) (-> s4-0 mat uvec quad)) + (vector+float*! + (-> s4-0 force) + (-> s4-0 force) + (-> s4-0 dir) + (* -1.0 (vector-dot (-> s4-0 dir) (-> s4-0 velocity))) + ) + (set! (-> s4-0 dir quad) (-> s4-0 mat rvec quad)) + (vector+float*! + (-> s4-0 force) + (-> s4-0 force) + (-> s4-0 dir) + (* -1.0 (vector-dot (-> s4-0 dir) (-> s4-0 velocity))) + ) + (rigid-body-control-method-22 s3-0 (-> s4-0 world-pos) (-> s4-0 force)) + ) + (vector-float*! (-> s4-0 force) (-> this gravity-dir) (* (-> s2-0 info mass) (-> s2-0 extra gravity))) + ) + (add-force! s3-0 (-> s4-0 force)) + ) + (rigid-body-object-method-53 this arg0) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate explode (h-sled) + :virtual #t + :enter (behavior () + (rlet ((vf0 :class vf)) + (init-vf0-vector) + (logior! (-> self draw status) (draw-control-status no-draw)) + (send-event (vehicle-method-68 self) 'draw #f) + (let ((t9-2 (-> (method-of-type vehicle explode) enter))) + (if t9-2 + (t9-2) + ) + ) + (sound-play "combveh-explode") + (let ((a0-6 (-> self draw color-mult))) + (vector-float*! (the-as vector a0-6) (the-as vector a0-6) 0.25) + ) + (disable-physics! self) + (rigid-body-object-method-43 self) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-2 spawn-quat)) + (set! (-> gp-2 radius) (+ 12288.0 (-> self root root-prim local-sphere w))) + (set! (-> gp-2 scale) (* 0.00008877841 (-> self draw bounds w))) + (set! (-> gp-2 group) (-> *part-group-id-table* (-> self info explosion-part))) + (set! (-> gp-2 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-2 damage) 2.0) + (set! (-> gp-2 damage-scale) 1.0) + (set! (-> gp-2 vehicle-damage-factor) 1.0) + (set! (-> gp-2 vehicle-impulse-factor) 1.0) + (set! (-> gp-2 ignore-proc) (process->handle #f)) + (explosion-spawn gp-2 (the-as process-drawable *default-pool*)) + ) + (let ((gp-3 (-> self info explosion))) + (when gp-3 + (set! (-> gp-3 skel) + (the-as skeleton-group (art-group-get-by-name *level* (-> gp-3 skel-name) (the-as (pointer level) #f))) + ) + (let ((s5-2 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (set! (-> s5-2 duration) (seconds 4)) + (set! (-> s5-2 gravity) -327680.0) + (set! (-> s5-2 rot-speed) 10.2) + (set-vector! (-> s5-2 fountain-rand-transv-lo) -81920.0 61440.0 -81920.0 1.0) + (set-vector! (-> s5-2 fountain-rand-transv-hi) 81920.0 131072.0 81920.0 1.0) + (let ((v1-51 + (process-spawn joint-exploder (-> gp-3 skel) (-> gp-3 anim) s5-2 gp-3 :name "joint-exploder" :to self :unk 0) + ) + ) + (when v1-51 + (let ((v1-54 (-> (the-as joint-exploder (-> v1-51 0)) draw))) + (if v1-54 + (.svf (&-> (-> v1-54 color-mult) quad) vf0) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate player-control (h-sled) + :virtual #t + :enter (behavior () + (set! (-> self health-hud) (process->handle (hud-sled-health-spawn self))) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + (send-event (handle->process (-> self health-hud)) 'hide-and-die) + (set! (-> self health-hud) (the-as handle #f)) + ) + ) + +;; definition for method 78 of type h-sled +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod vehicle-method-78 ((this h-sled)) + (local-vars (a0-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'h-sled-stack-var1))) + (let* ((v1-0 (-> s5-0 mat)) + (a3-0 (-> this node-list data 0 bone transform)) + (a0-3 (-> a3-0 rvec quad)) + (a1-0 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-0 rvec quad) a0-3) + (set! (-> v1-0 uvec quad) a1-0) + (set! (-> v1-0 fvec quad) a2-0) + (set! (-> v1-0 trans quad) a3-1) + ) + (let ((s4-0 (new 'static 'inline-array vector 8 + (new 'static 'vector :x 6144.0 :y 4096.0 :z -20480.0 :w 1.0) + (new 'static 'vector :x -6144.0 :y 4096.0 :z -20480.0 :w 1.0) + (new 'static 'vector :x 1638.4 :y 4096.0 :z -17203.2 :w 1.0) + (new 'static 'vector :x -1638.4 :y 4096.0 :z -17203.2 :w 1.0) + (new 'static 'vector :x 7782.4 :y 7782.4 :z -12288.0 :w 1.0) + (new 'static 'vector :x -7782.4 :y 7782.4 :z -12288.0 :w 1.0) + (new 'static 'vector :x 11059.2 :y 5734.4 :z -1638.4 :w 1.0) + (new 'static 'vector :x -11059.2 :y 5734.4 :z -1638.4 :w 1.0) + ) + ) + ) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (dotimes (s3-0 8) + (quad-copy! + (the-as pointer (-> s5-0 glow)) + (the-as pointer (-> this info particle-common headlight-glow-template)) + 4 + ) + (vector-matrix*! (-> s5-0 vec0) (-> s4-0 s3-0) (-> s5-0 mat)) + (let* ((v1-7 (-> s5-0 glow)) + (a1-3 (-> s5-0 vec0)) + (f0-0 (-> v1-7 position w)) + ) + (set! (-> v1-7 position quad) (-> a1-3 quad)) + (set! (-> v1-7 position w) f0-0) + ) + 0 + (set! (-> s5-0 glow rot-angle) (* 182.04445 (rand-vu-float-range -17.0 -13.0))) + (set! (-> s5-0 glow color x) 0.0) + (set! (-> s5-0 glow color y) 0.0) + (set! (-> s5-0 glow color z) 255.0) + (set! (-> s5-0 glow color w) (* 2.0 (rand-vu-float-range 16.0 18.0))) + (add! *simple-sprite-system* (-> s5-0 glow)) + ) + ) + ) + (when (logtest? (vehicle-flag ignition) (-> this v-flags)) + (dotimes (s4-1 4) + (let ((v1-21 (-> this ground-pos-array s4-1)) + (f0-8 0.0) + ) + (.lvf vf1 (&-> v1-21 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 a0-13 vf1) + (when (< f0-8 a0-13) + (set! (-> s5-0 mat trans quad) (-> v1-21 quad)) + (spawn-from-mat (-> this parts s4-1) (-> s5-0 mat)) + ) + ) + ) + ) + ) + (none) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc b/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc new file mode 100644 index 0000000000..ed4990acb1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/pecker/pecker-ingame_REF.gc @@ -0,0 +1,145 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type pecker-ingame +(deftype pecker-ingame (process-drawable) + ((path-u float) + ) + (:state-methods + idle + active + die + ) + ) + +;; definition for method 3 of type pecker-ingame +(defmethod inspect ((this pecker-ingame)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-pecker-ingame pecker-ingame pecker-ingame-lod0-jg pecker-ingame-fly-ja + ((pecker-ingame-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :shadow pecker-ingame-shadow-mg + :origin-joint-index 3 + :shadow-joint-index 3 + ) + +;; definition for function pecker-ingame-handler +(defbehavior pecker-ingame-handler pecker-ingame ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die) + (go-virtual die) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (pecker-ingame) + :virtual #t + :event pecker-ingame-handler + :trans (behavior () + (let ((v1-1 (res-lump-value (-> self entity) 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (cond + ((zero? v1-1) + (if (task-node-closed? (game-task-node comb-travel-introduction)) + (go-virtual active) + ) + ) + ((= (the-as uint v1-1) 1) + (if (task-node-closed? (game-task-node comb-travel-resolution)) + (go-virtual active) + ) + ) + (else + (go-virtual active) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate active (pecker-ingame) + :virtual #t + :event pecker-ingame-handler + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek! max 0.78) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.78)) + ) + ) + #f + ) + :post (behavior () + (let* ((f0-0 (path-control-method-23 (-> self path) (target-pos 0))) + (f0-3 (lerp-scale 0.01 0.1 (fmax 0.0 (- (-> self path-u) f0-0)) 0.1 0.0)) + ) + (seek! (-> self path-u) 1.0 (* f0-3 (seconds-per-frame))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-u) 'interp) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (displacement-between-points-at-percent-normalized! (-> self path) gp-1 (-> self path-u)) + (forward-up-nopitch->quaternion (-> self root quat) gp-1 *y-vector*) + ) + (debug-draw (-> self path)) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (pecker-ingame) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +;; definition for method 11 of type pecker-ingame +(defmethod init-from-entity! ((this pecker-ingame) (arg0 entity-actor)) + (let ((v1-1 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (cond + ((zero? v1-1) + (when (task-node-closed? (game-task-node comb-travel-resolution)) + (cleanup-for-death this) + (deactivate this) + ) + ) + ((= (the-as uint v1-1) 1) + (when (task-node-closed? (game-task-node mine-explore-introduction)) + (cleanup-for-death this) + (deactivate this) + ) + ) + ) + ) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-pecker-ingame" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 30)) + (logior! (-> this skel status) (joint-control-status eye-anim)) + (set! (-> this path) (new 'process 'curve-control this 'path -1000000000.0)) + (set! (-> this path-u) 0.0) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc b/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc new file mode 100644 index 0000000000..500259503b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/railx-mood_REF.gc @@ -0,0 +1,178 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type railx-states +(deftype railx-states (structure) + ((pulses pulse-state 6 :inline) + (blue pulse-state :inline :overlay-at (-> pulses 0)) + (yellow pulse-state :inline :overlay-at (-> pulses 1)) + (warp pulse-state :inline :overlay-at (-> pulses 2)) + (spill pulse-state :inline :overlay-at (-> pulses 3)) + (egg pulse-state :inline :overlay-at (-> pulses 4)) + (transform pulse-state :inline :overlay-at (-> pulses 5)) + (flicker float) + ) + ) + +;; definition for method 3 of type railx-states +(defmethod inspect ((this railx-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'railx-states) + (format #t "~1Tpulses[6] @ #x~X~%" (-> this pulses)) + (format #t "~1Tblue: #~%" (-> this pulses)) + (format #t "~1Tyellow: #~%" (-> this yellow)) + (format #t "~1Twarp: #~%" (-> this warp)) + (format #t "~1Tspill: #~%" (-> this spill)) + (format #t "~1Tegg: #~%" (-> this egg)) + (format #t "~1Ttransform: #~%" (-> this transform)) + (format #t "~1Tflicker: ~f~%" (-> this flicker)) + (label cfg-4) + this + ) + +;; definition for function init-mood-railx +;; WARN: Return type mismatch vector vs float. +(defun init-mood-railx ((arg0 mood-context)) + (-> arg0 state) + (set-vector! (-> arg0 times 1) 0.0 0.5 1.0 1.0) + (let ((v0-0 (-> arg0 times 2))) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 1.0) + (set! (-> v0-0 z) 0.5) + (set! (-> v0-0 w) 1.0) + (the-as float v0-0) + ) + ) + +;; definition for function update-railx-lights +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defun update-railx-lights ((arg0 mood-context)) + (let ((v1-0 (-> arg0 current-fog))) + (set! (-> v1-0 fog-color x) 0.0) + (set! (-> v1-0 fog-color y) 0.0) + (set! (-> v1-0 fog-color z) 0.0) + (set! (-> v1-0 fog-color w) 128.0) + ) + (set! (-> arg0 current-fog fog-dists x) 819200.0) + (set! (-> arg0 current-fog fog-dists y) 1392640.0) + (set! (-> arg0 current-fog fog-dists w) 128.0) + (set! (-> arg0 current-fog fog-dists z) 255.0) + (let ((s1-0 (-> arg0 light-group)) + (gp-0 (-> arg0 light-group 1)) + ) + (let ((s4-0 (new 'static 'vector :z 1.0)) + (s2-0 (new 'static 'vector :x 1.0 :y 1.0)) + (s3-0 (the-as object (-> arg0 state))) + (s5-0 (-> *math-camera* inv-camera-rot)) + ) + (vector-float*! + (the-as vector (-> s1-0 0 ambi color)) + s4-0 + (fmax 0.333 (-> (the-as railx-states s3-0) blue brightness)) + ) + (vector+float*! + (the-as vector (-> s1-0 0 ambi color)) + (the-as vector (-> s1-0 0 ambi color)) + s2-0 + (fmax 0.333 (-> (the-as railx-states s3-0) yellow brightness)) + ) + (set! (-> s1-0 0 dir0 color quad) (-> s1-0 0 ambi color quad)) + (set! (-> s1-0 0 dir1 color quad) (-> s1-0 0 ambi color quad)) + (let ((a1-3 (new 'static 'vector :x 0.834 :y 0.4815 :z 0.2691)) + (s0-0 (new 'static 'vector :x -0.8451 :y -0.2182 :z -0.488)) + ) + (vector-matrix*! (the-as vector (-> s1-0 0)) a1-3 s5-0) + (vector-matrix*! (the-as vector (-> s1-0 0 dir1)) s0-0 s5-0) + ) + (set! (-> s1-0 0 ambi extra x) 0.2) + (set! (-> s1-0 0 dir0 extra x) 0.8) + (set! (-> s1-0 0 dir1 extra x) 0.8) + (set! (-> s1-0 0 dir2 extra x) 0.0) + (vector-float*! (the-as vector (-> gp-0 ambi color)) s4-0 (-> (the-as railx-states s3-0) blue brightness)) + (vector+float*! + (the-as vector (-> gp-0 ambi color)) + (the-as vector (-> gp-0 ambi color)) + s2-0 + (* 0.5 (-> (the-as railx-states s3-0) yellow brightness)) + ) + (vector-float*! (the-as vector (-> gp-0 dir0 color)) s4-0 (-> (the-as railx-states s3-0) blue brightness)) + (set! (-> gp-0 dir1 color quad) (-> gp-0 ambi color quad)) + (let ((a1-6 (new 'static 'vector :x 0.44725248 :y 0.77455187 :z 0.44725248)) + (s4-1 (new 'static 'vector :x -0.44725248 :y -0.77455187 :z -0.44725248)) + ) + (vector-matrix*! (the-as vector (-> gp-0 dir0)) a1-6 s5-0) + (vector-matrix*! (the-as vector (-> gp-0 dir1)) s4-1 s5-0) + ) + ) + (set! (-> gp-0 ambi extra x) 0.2) + (set! (-> gp-0 dir0 extra x) 0.5) + (set! (-> gp-0 dir1 extra x) 0.4) + (set! (-> gp-0 dir2 extra x) 0.0) + ) + (none) + ) + +;; definition for function update-mood-railx +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-railx time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (update-railx-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as object (-> arg0 state)))) + (set! (-> arg0 times 0 w) 1.0) + (update-mood-pulse arg0 1 0 0.0 1.0 0.0 0.0) + (update-mood-pulse arg0 2 16 0.0 1.0 0.0 0.0) + (update-mood-pulse arg0 3 32 0.875 0.125 (* 65536.0 (seconds-per-frame)) 0.0) + (update-mood-pulse arg0 4 48 0.0 1.0 0.0 0.0) + (set! (-> arg0 times 5 w) (if (< 36408.89 (-> (the-as railx-states gp-0) flicker)) + 0.475 + 0.55 + ) + ) + (update-mood-pulse arg0 6 64 0.0 1.0 0.0 0.0) + (update-mood-pulse arg0 7 80 0.0 1.0 0.0 0.0) + (when (not (paused?)) + (let ((f0-6 (+ (-> (the-as railx-states gp-0) flicker) (* 393216.0 (seconds-per-frame))))) + (set! (-> (the-as railx-states gp-0) flicker) (- f0-6 (* (the float (the int (/ f0-6 65536.0))) 65536.0))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-railx-light-brightness! +;; WARN: Return type mismatch float vs none. +(defun set-railx-light-brightness! ((arg0 int) (arg1 float) (arg2 float)) + (let ((v1-1 (level-get *level* 'railx))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as railx-states v1-2) pulses arg0 target-brightness) arg1) + (set! (-> (the-as railx-states (+ (the-as uint v1-2) (* arg0 16))) blue speed) arg2) + ) + ) + ) + (let ((v1-5 (level-get *level* 'railcst))) + (when v1-5 + (let ((v1-6 (the-as object (-> v1-5 mood-context state)))) + (set! (-> (the-as railx-states v1-6) pulses arg0 target-brightness) arg1) + (set! (-> (the-as railx-states (+ (the-as uint v1-6) (* arg0 16))) blue speed) arg2) + ) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc b/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc new file mode 100644 index 0000000000..052aabec37 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/railx-obs_REF.gc @@ -0,0 +1,651 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type rail-warp-gate +(deftype rail-warp-gate (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type rail-warp-gate +(defmethod inspect ((this rail-warp-gate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-rail-warp-gate rail-warp-gate rail-warp-gate-lod0-jg rail-warp-gate-idle-ja + ((rail-warp-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 125) + ) + +;; failed to figure out what this is: +(defstate idle (rail-warp-gate) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! rail-warp-gate-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type rail-warp-gate +(defmethod init-from-entity! ((this rail-warp-gate) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-rail-warp-gate" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this draw light-index) (the-as uint 11)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-big-yellow-glow + :id 1259 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4266 :flags (sp6)) (sp-item 4267 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4266 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4267 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-medium-yellow-glow + :id 1260 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4268 :flags (sp6)) (sp-item 4269 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4268 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4269 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 25) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-small-yellow-glow + :id 1261 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4270 :flags (sp6)) (sp-item 4271 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4270 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4271 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 18) (meters 0.1)) + (:rot-x (degrees 45)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 45011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 36864.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-pedestal-blue-glow + :id 1262 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4272 :flags (sp6)) (sp-item 4273 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4272 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 5.0 1.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + ) + ) + +;; failed to figure out what this is: +(defpart 4273 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-yellowoval + :id 1263 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4274 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4274 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-blueoval + :id 1264 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4275 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4275 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 80.0) + (:g 128.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-yellowled + :id 1265 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4276 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4276 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.6) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-blueled + :id 1266 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4277 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4277 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-yellowledglow + :id 1267 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4278 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4278 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 128.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-rimlight + :id 1268 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4279 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4279 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-orbblueglow + :id 1269 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4280 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4280 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-yellowstrip + :id 1270 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4281 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4281 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-bigscreen + :id 1271 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4282 :flags (is-3d sp7)) (sp-item 4283 :flags (is-3d sp7)) (sp-item 4284 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4282 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 0.5) + (:x (meters -4.5) (meters 8.5)) + (:y (meters -0.2)) + (:z (meters -1)) + (:scale-x (meters 0.3) (meters 0.5)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 4.6)) + (:r 128.0) + (:g 40.0) + (:b 20.0) + (:a 0.0) + (:fade-a 0.32 0.32) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4285) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4285 + :init-specs ((:fade-a -0.128 -0.128)) + ) + +;; failed to figure out what this is: +(defpart 4283 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 0.05) + (:x (meters -4.8)) + (:y (meters 1) 6 (meters -0.5)) + (:z (meters -1)) + (:scale-x (meters 1.2)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 0.35)) + (:r 200.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-x (meters 0.008)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4284 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 0.1) + (:x (meters -4.8)) + (:y (meters 1.5) 11 (meters -0.3)) + (:z (meters -1)) + (:scale-x (meters 0.3)) + (:rot-x (degrees 90)) + (:rot-y (degrees 90)) + (:rot-z (degrees 90)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 32.0 64.0) + (:b 0.0) + (:a 64.0) + (:vel-x (meters 0.004)) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-mediumscreen + :id 1272 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4286 :flags (is-3d sp7)) (sp-item 4287 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4286 + :init-specs ((:texture (laser-hit level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.8) 2 (meters 1.2)) + (:rot-x (degrees 0) 3 (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 50.0) + (:b 128.0) + (:a 128.0) + (:rotvel-y (degrees -0.16666667) 1 (degrees 0.33333334)) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4287 + :init-specs ((:texture (green-lightning level-default-sprite)) + (:num 0.015) + (:y (meters 1.5)) + (:scale-x (meters 0.3) (meters 0.5)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 3.4)) + (:r 0.0) + (:g 50.0) + (:b 128.0) + (:a 32.0) + (:vel-y (meters -0.01)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-smallscreen + :id 1273 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4288 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4288 + :init-specs ((:texture (laser-hit-rim level-default-sprite)) + (:num 0.1) + (:scale-x (meters 1.2)) + (:rot-x (degrees 0) 3 (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0 64.0) + (:b 0.0 2.0 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:rotvel-y (degrees -1) (degrees 2)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-combx-capsulescreen + :id 1274 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4289 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4289 + :init-specs ((:texture (static1 level-default-sprite)) + (:birth-func 'spt-birth-func-capsulescreen) + (:num 20.0) + (:x (meters 0.1)) + (:y (meters -0.2) (meters 0.4)) + (:z (meters -0.7) (meters 1.4)) + (:scale-x (meters 1)) + (:rot-x (degrees 0) 1 (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters -2) 1 (meters 4)) + (:r 30.0) + (:g 64.0 64.0) + (:b 128.0) + (:a 8.0 100.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x404a00 #x40b000 #x40b100)) + (:rotate-y (degrees 90)) + ) + ) + +;; definition for function spt-birth-func-capsulescreen +(defun spt-birth-func-capsulescreen ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 object) (arg3 object) (arg4 object)) + (birth-func-texture-group (the-as int arg0) arg1 (the-as sparticle-launchinfo arg2)) + (birth-func-flip-based-on-scale + arg0 + arg1 + (the-as sprite-vec-data-3d arg2) + (the-as sparticle-launcher arg3) + (the-as sparticle-launch-state arg4) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/comb/railx-scenes_REF.gc b/test/decompiler/reference/jak3/levels/comb/railx-scenes_REF.gc new file mode 100644 index 0000000000..8b75c7ba59 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/comb/railx-scenes_REF.gc @@ -0,0 +1,2303 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-fma-gun fma-gun fma-gun-lod0-jg fma-gun-idle-ja + ((fma-gun-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rail-oracle-door-fma rail-oracle-door rail-oracle-door-lod0-jg rail-oracle-door-idle-ja + ((rail-oracle-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rail-warp-gate-fma rail-warp-gate rail-warp-gate-lod0-jg rail-warp-gate-idle-ja + ((rail-warp-gate-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 145) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-eco-crystal-sphere-fma eco-crystal-sphere eco-crystal-sphere-lod0-jg eco-crystal-sphere-idle-ja + ((eco-crystal-sphere-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rail-gun-light-fma rail-gun-light 0 2 + ((1 (meters 999999))) + :bounds (static-spherem 0 0 0 70) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rail-gun-dark-fma rail-gun-dark rail-gun-dark-lod0-jg rail-gun-dark-idle-ja + ((rail-gun-dark-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-rail-oracle-eyes-fma rail-oracle-eyes rail-oracle-eyes-lod0-jg rail-oracle-eyes-idle-ja + ((rail-oracle-eyes-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 70) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-plat-fma plat-fma plat-fma-lod0-jg plat-fma-idle-ja + ((plat-fma-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-precursor-controller precursor-controller precursor-controller-lod0-jg precursor-controller-idle-ja + ((precursor-controller-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-pre-mike pre-mike pre-mike-lod0-jg pre-mike-idle-ja + ((pre-mike-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-railx-precursor-entrance-flash + :id 1275 + :flags (sp0) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4290 :flags (sp3)) (sp-item 4291 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 4290 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 2)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 4511.25)) + (:scalevel-x (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow left-multiply-quat)) + (:userdata 4096.0) + (:next-time (seconds 0.335)) + (:next-launcher 4292) + ) + ) + +;; failed to figure out what this is: +(defpart 4292 + :init-specs ((:scalevel-x (meters -0.06666667)) (:scalevel-y :copy scalevel-x) (:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpart 4291 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 1.0) + (:y (meters -0.5)) + (:scale-x (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.835)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 4293) + ) + ) + +;; failed to figure out what this is: +(defpart 4293 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y :copy scalevel-x) (:fade-a -0.85333335)) + ) + +;; definition for symbol railx-death-precursor, type death-info +(define railx-death-precursor + (new 'static 'death-info :vertex-skip #x8 :timer #xe0 :overlap #xff :effect #x10c6) + ) + +;; definition for function start-railx-precursor-effect +;; WARN: Return type mismatch int vs none. +(defun start-railx-precursor-effect ((arg0 process-drawable)) + (let ((v1-0 (-> arg0 draw)) + (a1-0 railx-death-precursor) + ) + (set! (-> v1-0 death-vertex-skip) (-> a1-0 vertex-skip)) + (set! (-> v1-0 death-effect) (-> a1-0 effect)) + (set! (-> v1-0 death-timer) (+ (-> a1-0 timer) 1)) + (set! (-> v1-0 death-timer-org) (-> v1-0 death-timer)) + (set! (-> v1-0 death-draw-overlap) (-> a1-0 overlap)) + ) + (send-event + arg0 + 'trans-hook + (lambda :behavior scene-player + () + (set! (-> self draw death-timer) (the-as uint 200)) + (set! (-> self draw death-vertex-skip) (the-as uint (the int (rand-vu-float-range 8.0 24.0)))) + (none) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 4294 + :init-specs ((:scale-x (meters 0.25)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 196.0) + (:b 255.0) + (:a 64.0) + (:accel-y (meters 0) (meters 0.00066666666)) + (:timer (seconds 0.017) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-texture-glow-soft) + (:next-time (seconds 0.035)) + (:next-launcher 4295) + ) + ) + +;; failed to figure out what this is: +(defpart 4295 + :init-specs ((:r 64.0) + (:g 128.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters -0.0008)) + (:scalevel-y (meters 0) (meters 0.0026666666)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-precursor-entity + :id 1276 + :duration (seconds 0.017) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4296 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4296 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 255.0) + (:a 8.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "catacombs-wild-ride-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-194" + :art-group "scenecamera" + :anim "catacombs-wild-ride-res" + :parts #x73 + :command-list '((0 + (send-event *time-of-day* 'change 'ratio (float (new 'static 'bfloat))) + (send-event *time-of-day* 'change 'hour (int 18)) + (kill "rail-warp-gate-2") + (kill "rail-oracle-door-2") + (kill "rail-oracle-eyes-2") + (kill "rail-gun-dark-2") + (kill "rail-gun-dark-3") + (apply + ,(lambda :behavior scene-player + () + (set-railx-light-brightness! 0 0.0 100000.0) + (set-railx-light-brightness! 1 0.0 100000.0) + (set-railx-light-brightness! 2 0.0 100000.0) + (set-railx-light-brightness! 3 0.0 100000.0) + (set-railx-light-brightness! 4 0.0 100000.0) + (set-railx-light-brightness! 5 0.0 100000.0) + (none) + ) + ) + ) + (1 + (part-tracker + "group-fma-hover-vehicle-exhaust-glow" + entity + "particleman" + joint + "particleF" + track + #t + duration + (frame-range 1 578) + ) + (part-tracker + "group-fma-hover-vehicle-exhaust-glow" + entity + "particleman" + joint + "particleG" + track + #t + duration + (frame-range 1 578) + ) + ) + (141 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 0 1.0 0.2521) (none)))) + (261 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 1 1.0 0.43478) (none)))) + (155 (want-load 'railx 'precura 'railcst)) + (156 (hide-cloth "jakc-highres")) + (281 (show-cloth "jakc-highres")) + (466 + (part-tracker + "group-railx-oracle-eye-open" + entity + "rail-oracle-eyes-fma" + joint + "rightlowerlid" + track + #t + duration + (frame-range 466 467) + ) + (part-tracker + "group-railx-oracle-eye-open" + entity + "rail-oracle-eyes-fma" + joint + "leftlowerlid" + track + #t + duration + (frame-range 466 467) + ) + ) + (478 + (part-tracker + "group-railx-oracle-eye-glow" + entity + "rail-oracle-eyes-fma" + joint + "rightlowerlid" + track + #t + duration + (frame-range 478 6770) + ) + (part-tracker + "group-railx-oracle-eye-glow" + entity + "rail-oracle-eyes-fma" + joint + "leftlowerlid" + track + #t + duration + (frame-range 478 6770) + ) + ) + (536 + (part-tracker + "group-railcst-dust-landing" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 536 590) + ) + ) + (740 + (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 4 2.0 1.0) (none))) + (part-tracker + "group-railx-eco-sphere-glow-ramp-up" + entity + "eco-crystal-sphere-fma" + joint + "main" + track + #t + duration + (frame-range 740 800) + ) + ) + (800 + (part-tracker + "group-railx-eco-sphere-glow" + entity + "eco-crystal-sphere-fma" + joint + "main" + track + #t + duration + (frame-range 800 6770) + ) + ) + (865 + (part-tracker + "group-dark-eco-cannon-charge" + entity + "particleman" + joint + "particleZ" + track + #t + duration + (frame-range 865 6770) + ) + ) + (870 + (part-tracker + "group-light-eco-cannon-charge" + entity + "particleman" + joint + "particleY" + track + #t + duration + (frame-range 870 6770) + ) + ) + (1081 + (joint-eval start-railx-precursor-effect entity "precursor") + (send-event + "precursor" + 'eval + ,(lambda :behavior scene-player + () + (let* ((v1-3 (-> self draw lod-set lod (-> self draw cur-lod) geo length)) + (gp-0 3) + (s5-0 (+ v1-3 1)) + ) + (while (>= s5-0 gp-0) + (when (not (or (and (>= gp-0 13) (>= 21 gp-0)) (and (>= gp-0 26) (>= 34 gp-0)))) + (if (logtest? (-> *part-group-id-table* 1276 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1276) + :duration (seconds 56.867) + :target self + :mat-joint gp-0 + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1276) + :duration (seconds 56.867) + :target self + :mat-joint gp-0 + ) + ) + ) + (+! gp-0 1) + ) + ) + (none) + ) + ) + ) + (1328 + (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 5 2.0 1.0) (none))) + (part-tracker + "group-railx-rod-of-god" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 1328 1870) + ) + ) + (1812 + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "main" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "chest" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "neck" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "head" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Lshoulder" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Rshoulder" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Lelbow" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Relbow" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "hips" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Lcollar" + track + #t + duration + (frame-range 1812 2000) + ) + (part-tracker + "group-railx-veger-glow" + entity + "veger-highres" + joint + "Rcollar" + track + #t + duration + (frame-range 1812 2000) + ) + ) + (2000 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 5 0.0 1.0) (none)))) + (2932 + (part-tracker + "group-railx-room-light" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 2932 3165) + ) + ) + (2938 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 3 2.0 0.8108) (none)))) + (3100 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 3 0.0 0.5) (none)))) + (3151 + (part-tracker + "group-leader-staff-shot-glow" + entity + "particleman" + joint + "particleX" + track + #t + duration + (frame-range 3151 6770) + ) + ) + (4736 + (part-tracker + "group-railx-shoot-at-veger" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 4736 4738) + ) + ) + (4745 + (part-tracker + "group-railx-veger-bubble" + entity + "veger-highres" + joint + "main" + track + #t + duration + (frame-range 4745 5848) + ) + ) + (5849 + (part-tracker + "group-railx-veger-bubble" + entity + "veger-highres" + joint + "main" + track + #f + duration + (frame-range 5849 5890) + ) + ) + (5830 + (part-tracker + "group-railx-veger-transform" + entity + "veger-highres" + joint + "main" + track + #t + duration + (frame-range 5830 5900) + ) + ) + (5860 + (part-tracker + "group-veger-to-otsel-zap" + entity + "veger-highres" + joint + "main" + track + #f + duration + (frame-range 5860 5890) + ) + ) + (5891 + (part-tracker + "group-railx-ottsel-bubble" + entity + "ottsel-veger" + joint + "main" + track + #t + duration + (frame-range 5891 6770) + ) + ) + (6241 + (part-tracker + "group-railx-warpgate" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 6241 6770) + ) + ) + (6250 (apply ,(lambda :behavior scene-player () (set-railx-light-brightness! 2 1.0 1.0) (none)))) + (10000 (task-close! "comb-wild-ride-resolution") (task-close! "precursor-destroy-ship-introduction")) + ) + :cut-list '(76 + 166 + 281 + 401 + 461 + 546 + 621 + 701 + 761 + 836 + 896 + 966 + 1081 + 1231 + 1316 + 1411 + 1583 + 1661 + 1731 + 1801 + 1861 + 1919 + 1961 + 2006 + 2071 + 2161 + 2233 + 2371 + 2506 + 2651 + 2711 + 2776 + 2861 + 2961 + 3016 + 3081 + 3151 + 3221 + 3381 + 3491 + 3591 + 3701 + 3761 + 3841 + 3985 + 4036 + 4156 + 4226 + 4306 + 4396 + 4466 + 4611 + 4656 + 4701 + 4781 + 4861 + 5011 + 5116 + 5191 + 5261 + 5401 + 5441 + 5591 + 5656 + 5731 + 5826 + 5931 + 6036 + 6111 + 6316 + 6381 + 6606 + 6650 + 6755 + 6802 + ) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'railcst + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'railcst + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((min max)) + :shadow-frames '((min max)) + :cloth-reset-frames '(76 165 166 167 281 621 1081 1643 2157 2161 2307 4988 6298 6590) + :cloth-commands '((2161 reset)) + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "veger-highres" + :level 'railcst + :art-group "skel-veger-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '((965 1081) (1550 5866)) + :shadow-frames '((min max)) + :cloth-reset-frames '(970 1544 1661 1781 1914 2060 4701 (5866 max)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'railcst + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-leader" + :level 'railcst + :art-group "skel-ottsel-leader" + :prefix "" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '(3753 4010 4215 4400 4642 4743 5090 5565 6390) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-surfer" + :level 'railcst + :art-group "skel-ottsel-surfer" + :prefix "" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-veger" + :level 'railcst + :art-group "skel-ottsel-veger" + :prefix "" + :draw-frames '((5866 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "ottsel-dummy" + :level 'railcst + :art-group "skel-ottsel-dummy" + :prefix "" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor" + :level 'railcst + :art-group "skel-precursor" + :prefix "" + :draw-frames '((1080 2915)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "comb-rail-rider-fma" + :level 'railcst + :art-group "skel-comb-rail-rider-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fma-gun" + :level 'railcst + :art-group "skel-fma-gun" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-oracle-door-fma" + :level 'railx + :art-group "skel-rail-oracle-door-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-warp-gate-fma" + :level 'railx + :art-group "skel-rail-warp-gate-fma" + :prefix "" + :draw-frames '((min 701) + (895 966) + (1410 1583) + (1660 1731) + (1800 1861) + (2070 2233) + (2370 2651) + (2710 2776) + (2960 3016) + (3080 3151) + (3380 3491) + (3590 3701) + (4155 4226) + (4305 4396) + (4610 4656) + (4700 4781) + (5010 5116) + (5260 5401) + (5440 5591) + (5655 5931) + (6110 6316) + (6605 6755) + ) + :scissor-frames '((min 483)) + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xb + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-gun-dark-fma" + :level 'railx + :art-group "skel-rail-gun-dark-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-gun-dark-fma" + :level 'railx + :art-group "skel-rail-gun-dark-fma" + :prefix "b-" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "eco-crystal-sphere-fma" + :level 'railcst + :art-group "skel-eco-crystal-sphere-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "rail-oracle-eyes-fma" + :level 'railx + :art-group "skel-rail-oracle-eyes-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "pre-mike" + :level 'railcst + :art-group "skel-pre-mike" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-controller" + :level 'railcst + :art-group "skel-precursor-controller" + :prefix "" + :draw-frames '((3150 3985)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "precursor-controller" + :level 'railcst + :art-group "skel-precursor-controller" + :prefix "b-" + :draw-frames '((3150 3985)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "plat-fma" + :level 'railcst + :art-group "skel-plat-fma" + :prefix "a-" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "plat-fma" + :level 'railcst + :art-group "skel-plat-fma" + :prefix "b-" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "plat-fma" + :level 'railcst + :art-group "skel-plat-fma" + :prefix "c-" + :draw-frames '((3150 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "railx-start" + :end-point "precura-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running '(sound-play-loop "launch-amb-mov2") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-leader-staff-shot-glow + :id 1277 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4297)) + ) + +;; failed to figure out what this is: +(defpart 4297 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.2) + (:scale-x (meters 0.6) (meters 0.3)) + (:rot-x (degrees 45)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:fade-a 0.6) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:func 'spt-func-relative-pos) + (:next-time (seconds 0.167)) + (:next-launcher 4298) + ) + ) + +;; failed to figure out what this is: +(defpart 4298 + :init-specs ((:fade-a -0.6)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-hover-vehicle-exhaust-glow + :id 1278 + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4299 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4299 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0 64.0) + (:b 255.0) + (:a 80.0 20.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railcst-dust-landing + :id 1279 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 4300 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4300 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.5) + (:x (meters 0) (meters 3)) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0 60.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28) + (:accel-y (meters 0) (meters 0.00016666666)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.167)) + (:next-launcher 4301) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4301 + :init-specs ((:fade-a -0.256 -0.256)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-oracle-eye-open + :id 1280 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4302 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4302 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.1)) + (:rot-x (degrees 225)) + (:scale-y (meters 15)) + (:r 128.0) + (:g 120.0) + (:b 120.0) + (:a 40.0) + (:scalevel-x (meters 0.033333335)) + (:fade-g -0.26666668) + (:fade-b -0.26666668) + (:timer (seconds 1.3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:next-time (seconds 0.3)) + (:next-launcher 4303) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4303 + :init-specs ((:scale-x (meters 6)) + (:scale-y (meters 40)) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.42666668) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-oracle-eye-glow + :id 1281 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4304 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4304 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 15) (meters 0.1)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 20.0) + (:b 20.0) + (:a 50.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4305 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0.2)) + (:y (meters 0)) + (:z (meters 3)) + (:scale-x (meters 3)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (: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 4306) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -40)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4306 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-eco-sphere-glow-ramp-up + :id 1282 + :flags (sp0 sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4307 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4307 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:fade-a 0.033333335) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:func 'spt-func-relative-pos) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-eco-sphere-glow + :id 1283 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4308 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4308 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 0.1)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-light-eco-cannon-charge + :id 1284 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4309 :flags (sp7)) + (sp-item 4310 :flags (sp7)) + (sp-item 4311 :flags (sp6)) + (sp-item 4312 :flags (sp6)) + ) + ) + +;; failed to figure out what this is: +(defpart 4309 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 0.5) + (:x (meters 10)) + (:scale-x (meters 25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 60.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g 0.4) + (:fade-a 0.07111111) + (:accel-x (meters -0.0013333333)) + (:friction 0.98 0.01) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 4310 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 25) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 80.0 80.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.06666667) (meters -0.05)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 4313) + ) + ) + +;; failed to figure out what this is: +(defpart 4313 + :init-specs ((:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 4311 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 40.0) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4312 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 30)) + (:rot-x (degrees 225)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 80.0) + (:b 255.0) + (:a 5.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-dark-eco-cannon-charge + :id 1285 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4314 :flags (sp6)) (sp-item 4315 :flags (sp6)) (sp-item 4316) (sp-item 4317)) + ) + +;; failed to figure out what this is: +(defpart 4314 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 20.0 40.0) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4315 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 40) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3599)) + (:scale-y :copy scale-x) + (:r 64.0 20.0) + (:g 64.0) + (:b 255.0) + (:a 60.0 10.0) + (:omega (degrees 13511.25)) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4316 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 1.0 20.0) + (:scale-x (meters 1) (meters 3)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 5) (meters 2.5)) + (:r 50.0 100.0) + (:g 60.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.035)) + (:next-launcher 4318) + ) + ) + +;; failed to figure out what this is: +(defpart 4317 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 1.0 5.0) + (:scale-x (meters 5) (meters 5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 3598.0002)) + (:scale-y (meters 5) (meters 2.5)) + (:r 50.0 100.0) + (:g 60.0) + (:b 255.0) + (:a 128.0) + (:fade-a -1.6) + (:timer (seconds 0.3) (seconds 0.197)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405700 #x405800 #x405900)) + (:next-time (seconds 0.035)) + (:next-launcher 4318) + ) + ) + +;; failed to figure out what this is: +(defpart 4318 + :init-specs ((:r 64.0) (:g 64.0) (:fade-r -2.0) (:fade-g -0.8) (:fade-a -4.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-rod-of-god + :id 1286 + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4319 :flags (is-3d)) + (sp-item 4320 :flags (is-3d)) + (sp-item 4321 :flags (is-3d)) + (sp-item 4322 :flags (is-3d)) + (sp-item 4323) + ) + ) + +;; failed to figure out what this is: +(defpart 4319 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 80)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4324 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpart 4320 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 124.99999)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4321 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 35)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4322 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters -10) (meters 1)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 170)) + (:scale-y (meters 30)) + (: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 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees -90)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4323 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 0.5 0.5) + (:x (meters -0.5) (meters 1)) + (:y (meters 0) (meters 30)) + (: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 4325) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4325 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-veger-glow + :id 1287 + :flags (sp12) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4326 :flags (sp3))) + ) + +;; failed to figure out what this is: +(defpart 4326 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 60.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:fade-a 0.10666667) + (:timer (seconds 6.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1638.4) + (:func 'spt-func-relative-pos) + (:next-time (seconds 1)) + (:next-launcher 4327) + ) + ) + +;; failed to figure out what this is: +(defpart 4327 + :init-specs ((:fade-a -0.013333334) (:next-time (seconds 4)) (:next-launcher 4328)) + ) + +;; failed to figure out what this is: +(defpart 4328 + :init-specs ((:fade-a -0.08)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-room-light + :id 1288 + :duration (seconds 1) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4329 :period (seconds 1) :length (seconds 0.017)) + (sp-item 4330 :flags (is-3d)) + (sp-item 4331 :flags (is-3d)) + (sp-item 4332 :flags (is-3d)) + (sp-item 4333 :flags (is-3d)) + ) + ) + +;; failed to figure out what this is: +(defpart 4329 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4330 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 18) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4334) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4334 + :init-specs ((:fade-a -2.56)) + ) + +;; failed to figure out what this is: +(defpart 4331 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 16) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 30)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4334) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4332 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 18) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -30)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4334) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 4333 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 0.1 0.1) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 12) (meters 1)) + (:scale-x (meters 7) (meters 1)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 30)) + (:r 128.0) + (:g 128.0) + (:b 255.0) + (:a 0.0) + (:rotvel-z (degrees 0.010000001)) + (:fade-a 2.56) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:next-time (seconds 0.167)) + (:next-launcher 4324) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-shoot-at-veger + :id 1289 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4335 :flags (sp7)) (sp-item 4336 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4335 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.4) (meters 1)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0) + (:b 30.0) + (:a 128.0) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.12) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4336 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.1) (meters 0.4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 30.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.013333334)) + (:scalevel-x (meters -0.00066666666)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.033333335 -0.033333335) + (:fade-a -0.42666668) + (:accel-y (meters -0.001)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 launch-along-z)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-veger-bubble + :id 1290 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4337)) + ) + +;; failed to figure out what this is: +(defpart 4337 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 0.3) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 5.12) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 4338) + ) + ) + +;; failed to figure out what this is: +(defpart 4338 + :init-specs ((:fade-a -5.12)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-ottsel-bubble + :id 1291 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4339)) + ) + +;; failed to figure out what this is: +(defpart 4339 + :init-specs ((:texture (shockwave level-default-sprite)) + (:num 0.3) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:fade-a 5.12) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 4340) + ) + ) + +;; failed to figure out what this is: +(defpart 4340 + :init-specs ((:fade-a -5.12)) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-veger-transform + :id 1292 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 4343 :fade-after (meters 100) :period (seconds 0.167) :length (seconds 0.017) :binding 4341) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4341 :fade-after (meters 100) :flags (sp2 sp3) :binding 4342) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + (sp-item 4342 :fade-after (meters 100) :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 4343 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.0033333334) (meters 0.0016666667)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 4341 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:z (meters 1)) + (:scale-x (meters 0.2)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0 30.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0) (degrees 3600)) + (:vel-x (meters 0.059259262) (meters 0.0074074077)) + (:vel-y (meters 0)) + (:vel-z (meters 0.0016666667)) + (:friction 0.99) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 ready-to-launch sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 4344 + :init-specs ((:fade-a -0.21333334)) + ) + +;; failed to figure out what this is: +(defpart 4342 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.0026666666)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-railx-warpgate + :id 1293 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 50) + :parts ((sp-item 4345 :flags (sp7)) + (sp-item 4346 :flags (sp7)) + (sp-item 4347 :flags (sp6)) + (sp-item 4348 :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4345 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 50)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 5.12) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 4349) + ) + ) + +;; failed to figure out what this is: +(defpart 4349 + :init-specs ((:fade-a -5.12)) + ) + +;; failed to figure out what this is: +(defpart 4346 + :init-specs ((:texture (radial-halo level-default-sprite)) + (:num 0.01) + (:scale-x (meters 50)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 2.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.42666668) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 4350) + ) + ) + +;; failed to figure out what this is: +(defpart 4350 + :init-specs ((:fade-a -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 4347 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 2250)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 0.0) + (:b 255.0) + (:a 100.0 4.0) + (:fade-a -0.10666667) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4348 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 100)) + (:rot-x (degrees 1800)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 8.0 1.0) + (:fade-a -0.10666667) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-veger-to-otsel-zap + :id 1294 + :duration (seconds 0) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4351 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4351 + :init-specs ((:texture (laser-hit level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5 0.5) + (:scale-x (meters 0.01)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0 128.0) + (:scalevel-x (meters 0.033333335) (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -10.2) + (:fade-b -10.2) + (:fade-a -1.7) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3 left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x405400 #x406400 #x40b900 #x404b00)) + (:rotate-y (degrees 0)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/ai/ai-task-h_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ai-task-h_REF.gc new file mode 100644 index 0000000000..feb6da7a4e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/ai-task-h_REF.gc @@ -0,0 +1,306 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ai-task +(deftype ai-task (basic) + ((next ai-task) + (prev ai-task) + (pool ai-task-pool) + (unique-id uint32) + (bytes int8 16 :offset 32) + ) + (:methods + (reset-task! (_type_) none) + (ai-task-method-10 (_type_ bot) none) + (ai-task-method-11 (_type_ bot) object) + ) + ) + +;; definition for method 3 of type ai-task +(defmethod inspect ((this ai-task)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (label cfg-4) + this + ) + +;; definition of type ai-task-pool +(deftype ai-task-pool (basic) + ((anchor ai-task) + (tasks (pointer uint32)) + (tasks-length uint32) + (unique-id uint32) + ) + (:methods + (assign-ids! (_type_ type) ai-task) + (set-next-task! (_type_ ai-task) ai-task) + (ai-task-pool-method-11 (_type_) ai-task) + ) + ) + +;; definition for method 3 of type ai-task-pool +(defmethod inspect ((this ai-task-pool)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tanchor: ~A~%" (-> this anchor)) + (format #t "~1Ttasks: #x~X~%" (-> this tasks)) + (format #t "~1Ttasks-length: ~D~%" (-> this tasks-length)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (label cfg-4) + this + ) + +;; definition of type ai-task-control +(deftype ai-task-control (basic) + ((anchor ai-task) + (pool ai-task-pool) + ) + (:methods + (new (symbol type ai-task-pool) _type_) + (ai-task-control-method-9 (_type_) symbol) + (ai-task-control-method-10 (_type_ bot) none) + (get-task-by-type (_type_ type bot) ai-task) + (ai-task-control-method-12 (_type_ bot) symbol) + (ai-task-control-method-13 (_type_ ai-task bot) ai-task) + (ai-task-control-method-14 (_type_ ai-task bot) none) + (init-task! (_type_ type bot) ai-task) + (set-next-task-for-pool! (_type_ ai-task) none) + (set-next-task! (_type_ ai-task) ai-task) + ) + ) + +;; definition for method 3 of type ai-task-control +(defmethod inspect ((this ai-task-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tanchor: ~A~%" (-> this anchor)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (label cfg-4) + this + ) + +;; definition for method 11 of type ai-task +;; WARN: Return type mismatch int vs object. +(defmethod ai-task-method-11 ((this ai-task) (arg0 bot)) + 0 + ) + +;; definition for method 10 of type ai-task +;; WARN: Return type mismatch int vs none. +(defmethod ai-task-method-10 ((this ai-task) (arg0 bot)) + 0 + (none) + ) + +;; definition for method 9 of type ai-task +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! ((this ai-task)) + 0 + (none) + ) + +;; definition for method 11 of type ai-task-pool +;; WARN: Return type mismatch (pointer uint32) vs ai-task. +(defmethod ai-task-pool-method-11 ((this ai-task-pool)) + (set! (-> this unique-id) (the-as uint 0)) + (let ((t0-0 (the-as (pointer uint32) #f)) + (a1-0 (the-as (pointer uint32) #f)) + (v1-0 (-> this tasks)) + ) + (let ((a2-0 (-> this tasks-length))) + (dotimes (a3-0 (the-as int a2-0)) + (set! a1-0 (&+ v1-0 (* 48 a3-0))) + (set! (-> a1-0 2) (the-as uint this)) + (set! (-> a1-0 3) (the-as uint 0)) + (set! (-> a1-0 1) (the-as uint t0-0)) + (if t0-0 + (set! (-> t0-0 0) (the-as uint a1-0)) + ) + (set! t0-0 a1-0) + ) + ) + (set! (-> a1-0 0) (the-as uint #f)) + (let ((v0-0 (&-> v1-0 0))) + (set! (-> this anchor) (the-as ai-task v0-0)) + (the-as ai-task v0-0) + ) + ) + ) + +;; definition for method 9 of type ai-task-pool +(defmethod assign-ids! ((this ai-task-pool) (arg0 type)) + (let ((v1-1 (-> this anchor next))) + (when v1-1 + (let ((a2-0 (-> v1-1 prev)) + (a3-0 (-> v1-1 next)) + ) + (set! (-> v1-1 prev) #f) + (set! (-> v1-1 next) #f) + (let ((t0-1 (the-as int (+ (-> this unique-id) 1)))) + (if (zero? (the-as uint t0-1)) + (set! t0-1 1) + ) + (set! (-> this unique-id) (the-as uint t0-1)) + (set! (-> v1-1 unique-id) (the-as uint t0-1)) + ) + (set! (-> a2-0 next) a3-0) + (if a3-0 + (set! (-> a3-0 prev) a2-0) + ) + ) + (set! (-> v1-1 type) arg0) + v1-1 + ) + ) + ) + +;; definition for method 10 of type ai-task-pool +(defmethod set-next-task! ((this ai-task-pool) (arg0 ai-task)) + (let* ((v1-0 (-> this anchor)) + (v0-0 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) v0-0) + v0-0 + ) + ) + +;; definition for method 0 of type ai-task-control +(defmethod new ai-task-control ((allocation symbol) (type-to-make type) (arg0 ai-task-pool)) + (let ((s5-0 (object-new allocation type-to-make (the-as int (-> type-to-make size))))) + (set! (-> s5-0 pool) arg0) + (set! (-> s5-0 anchor) (assign-ids! arg0 ai-task)) + s5-0 + ) + ) + +;; definition for method 12 of type ai-task-control +(defmethod ai-task-control-method-12 ((this ai-task-control) (arg0 bot)) + (let ((gp-0 (-> this anchor))) + (let ((s3-0 (-> this anchor next))) + (while s3-0 + (let ((s4-0 (-> s3-0 next))) + (if arg0 + (ai-task-method-10 s3-0 arg0) + ) + (set-next-task! (-> s3-0 pool) s3-0) + (set! s3-0 s4-0) + ) + ) + ) + (set! (-> gp-0 prev) #f) + (set! (-> gp-0 next) #f) + ) + #f + ) + +;; definition for method 9 of type ai-task-control +(defmethod ai-task-control-method-9 ((this ai-task-control)) + (ai-task-control-method-12 this (the-as bot #f)) + (let ((a1-1 (-> this anchor))) + (when a1-1 + (set-next-task! (-> a1-1 pool) a1-1) + (set! (-> this anchor) #f) + #f + ) + ) + ) + +;; definition for method 15 of type ai-task-control +(defmethod init-task! ((this ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (assign-ids! (-> this pool) arg0))) + (if s5-0 + (reset-task! s5-0) + ) + s5-0 + ) + ) + +;; definition for method 17 of type ai-task-control +(defmethod set-next-task! ((this ai-task-control) (arg0 ai-task)) + (let* ((v1-0 (-> this anchor)) + (a0-1 (-> v1-0 next)) + ) + (set! (-> v1-0 next) arg0) + (set! (-> arg0 prev) v1-0) + (set! (-> arg0 next) a0-1) + ) + arg0 + ) + +;; definition for method 16 of type ai-task-control +;; WARN: Return type mismatch ai-task vs none. +(defmethod set-next-task-for-pool! ((this ai-task-control) (arg0 ai-task)) + (set-next-task! (-> this pool) arg0) + (none) + ) + +;; definition for method 11 of type ai-task-control +(defmethod get-task-by-type ((this ai-task-control) (arg0 type) (arg1 bot)) + (let ((s5-0 (init-task! this arg0 arg1))) + (if s5-0 + (set-next-task! this s5-0) + ) + s5-0 + ) + ) + +;; definition for method 13 of type ai-task-control +(defmethod ai-task-control-method-13 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((gp-0 (-> arg0 prev)) + (s5-0 (-> arg0 next)) + ) + (if arg1 + (ai-task-method-10 arg0 arg1) + ) + (set-next-task! (-> this pool) arg0) + (if gp-0 + (set! (-> gp-0 next) s5-0) + ) + (if s5-0 + (set! (-> s5-0 prev) gp-0) + ) + s5-0 + ) + ) + +;; definition for method 10 of type ai-task-control +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-control-method-10 ((this ai-task-control) (arg0 bot)) + (let ((a0-1 (-> this anchor next))) + (if a0-1 + (ai-task-method-11 a0-1 arg0) + ) + ) + (none) + ) + +;; definition for method 14 of type ai-task-control +;; WARN: Return type mismatch object vs none. +(defmethod ai-task-control-method-14 ((this ai-task-control) (arg0 ai-task) (arg1 bot)) + (let ((a0-1 (ai-task-control-method-13 this arg0 arg1))) + (if a0-1 + (ai-task-method-11 a0-1 arg1) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-h_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-h_REF.gc new file mode 100644 index 0000000000..df10048bd0 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-h_REF.gc @@ -0,0 +1,157 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ashelin-course +(deftype ashelin-course (bot-course) + ((ouch-speeches bot-speech-list-shuffle) + (victory-speeches bot-speech-list-shuffle) + ) + ) + +;; definition for method 3 of type ashelin-course +(defmethod inspect ((this ashelin-course)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (format #t "~1Touch-speeches: ~A~%" (-> this ouch-speeches)) + (format #t "~1Tvictory-speeches: ~A~%" (-> this victory-speeches)) + (label cfg-4) + this + ) + +;; definition of type ashelin +(deftype ashelin (bot) + ((self ashelin :override) + (course ashelin-course :override) + (knocked-anim art-joint-anim) + (travel-anim-interp float) + (fired-gun-count uint32) + (last-fire-time time-frame) + (victory-speech-time time-frame) + (frontline plane :inline) + ) + (:state-methods + back-spring + cartwheel-left + tumble-right + chase + traveling + traveling-blocked + waiting-idle + standing-idle + standing-turn + standing-blast + ) + (:methods + (ashelin-method-247 (_type_ symbol) symbol) + (ashelin-method-248 (_type_ vector float float float float) symbol) + (fire-shot (_type_ vector) (pointer process)) + (ashelin-method-250 (_type_ symbol symbol) symbol) + (go-dodge-state (_type_ int) object) + (ashelin-method-252 (_type_) int) + (ashelin-method-253 (_type_) int) + (ashelin-method-254 (_type_ float) none) + (ashelin-method-255 (_type_) none) + (ashelin-method-256 (_type_) none) + (ashelin-method-257 (_type_) int) + (ashelin-method-258 (_type_) symbol) + (ashelin-method-259 (_type_) none) + (ashelin-method-260 (_type_) int) + (ashelin-method-261 (_type_ symbol) penetrate) + ) + ) + +;; definition for method 3 of type ashelin +(defmethod inspect ((this ashelin)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bot inspect))) + (t9-0 this) + ) + (format #t "~2Tknocked-anim: ~A~%" (-> this knocked-anim)) + (format #t "~2Ttravel-anim-interp: ~f~%" (-> this travel-anim-interp)) + (format #t "~2Tfired-gun-count: ~D~%" (-> this fired-gun-count)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tvictory-speech-time: ~D~%" (-> this victory-speech-time)) + (format #t "~2Tfrontline: #~%" (-> this frontline)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-ashelin ashelin ashelin-lod0-jg ashelin-idle0-ja + ((ashelin-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 2.7) + :shadow ashelin-shadow-mg + :origin-joint-index 13 + ) + +;; definition of type asht-wait-spot +(deftype asht-wait-spot (ai-task) + ((check-done (function asht-wait-spot ashelin symbol) :overlay-at (-> bytes 0)) + (which-spot int8 :overlay-at (-> bytes 4)) + (num-spots uint8 :overlay-at (-> bytes 5)) + (spot-indexes uint8 6 :overlay-at (-> bytes 6)) + ) + ) + +;; definition for method 3 of type asht-wait-spot +(defmethod inspect ((this asht-wait-spot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (format #t "~1Tcheck-done: ~A~%" (-> this check-done)) + (format #t "~1Twhich-spot: ~D~%" (-> this which-spot)) + (format #t "~1Tnum-spots: ~D~%" (-> this num-spots)) + (format #t "~1Tspot-indexes[6] @ #x~X~%" (-> this spot-indexes)) + (label cfg-4) + this + ) + +;; definition of type asht-fight-focus +(deftype asht-fight-focus (ai-task) + () + ) + +;; definition for method 3 of type asht-fight-focus +(defmethod inspect ((this asht-fight-focus)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tnext: ~A~%" (-> this next)) + (format #t "~1Tprev: ~A~%" (-> this prev)) + (format #t "~1Tpool: ~A~%" (-> this pool)) + (format #t "~1Tunique-id: ~D~%" (-> this unique-id)) + (format #t "~1Tbytes[16] @ #x~X~%" (-> this bytes)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc new file mode 100644 index 0000000000..7fe825e184 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-shot_REF.gc @@ -0,0 +1,505 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 900 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.75)) + (:scale-y (meters 10)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 901 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 902 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.5) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 32.0) + (:scalevel-x (meters 0.013333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.28) + (:fade-b -1.28) + (:fade-a -0.48) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 903 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ashelin-shot-hit + :id 222 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 904 :period (seconds 2) :length (seconds 0.017)) + (sp-item 905 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017)) + (sp-item 906 :period (seconds 2) :length (seconds 0.017)) + (sp-item 907 :fade-after (meters 50) :falloff-to (meters 50) :period (seconds 2) :length (seconds 0.667)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.667)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.5)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.417)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.335)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.25)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.217)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.167)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.135)) + (sp-item 908 :fade-after (meters 100) :falloff-to (meters 100) :period (seconds 2) :length (seconds 0.085)) + ) + ) + +;; failed to figure out what this is: +(defpart 907 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.0 0.2) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 32.0 64.0) + (:vel-y (meters 0.06666667) (meters 0.013333334)) + (:scalevel-x (meters -0.001) (meters -0.00033333333)) + (:rotvel-z (degrees -2.4) 1 (degrees 4.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 909) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 908 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 96.0) + (:vel-y (meters 0.006666667) (meters 0.013333334)) + (:scalevel-x (meters -0.0005) (meters -0.0005)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.10666667) + (:fade-b -0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.8) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 909) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 909 + :init-specs ((:fade-a -0.96)) + ) + +;; failed to figure out what this is: +(defpart 905 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 128.0) + (:rotvel-z (degrees -0.1)) + (:fade-a -0.32) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 910) + ) + ) + +;; failed to figure out what this is: +(defpart 910 + :init-specs ((:scale-x (meters 2) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:next-time (seconds 0.017)) + (:next-launcher 910) + ) + ) + +;; failed to figure out what this is: +(defpart 906 + :init-specs ((:texture (glow level-default-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 8.0) + (:b 32.0 8.0) + (:a 48.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.9142857) + (:fade-b -0.9142857) + (:timer (seconds 1.335)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.117)) + (:next-launcher 911) + ) + ) + +;; failed to figure out what this is: +(defpart 911 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.010958904)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.38356164) + (:fade-b 0.0) + (:fade-a -0.13150685) + ) + ) + +;; failed to figure out what this is: +(defpart 904 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.185)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.05)) + (:next-launcher 912) + ) + ) + +;; failed to figure out what this is: +(defpart 912 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.0875)) + (:scalevel-y :copy scalevel-x) + (:fade-b -6.4) + ) + ) + +;; definition of type ashelin-shot +(deftype ashelin-shot (projectile) + ((parent (pointer ashelin) :override) + (tail-pos vector :inline) + (hit-pos vector :inline) + ) + ) + +;; definition for method 3 of type ashelin-shot +(defmethod inspect ((this ashelin-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) + (label cfg-4) + this + ) + +;; definition for method 24 of type ashelin-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this ashelin-shot)) + (draw-beam (-> *part-id-table* 903) (-> this tail-pos) (-> this starting-dir) #f) + 0 + (none) + ) + +;; definition for method 25 of type ashelin-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this ashelin-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((v1-1 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) v1-1 a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-2 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> gp-0 quad) vf6) + (let ((f30-0 (-> *part-id-table* 900 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 900 init-specs 4 initial-valuef) (fmin f30-0 (vector-length s5-1))) + (draw-beam (-> *part-id-table* 900) a1-0 s5-1 #f) + (set! (-> *part-id-table* 900 init-specs 4 initial-valuef) f30-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 901) gp-0) + (let ((f0-4 (vector-dot s5-1 (-> (camera-matrix) fvec)))) + (when (< 0.0 f0-4) + (let ((f0-5 (* f0-4 f0-4)) + (f30-1 (-> *part-id-table* 902 init-specs 8 initial-valuef)) + (f28-0 (-> *part-id-table* 902 init-specs 8 random-rangef)) + ) + (set! (-> *part-id-table* 902 init-specs 8 initial-valuef) (* f30-1 f0-5)) + (set! (-> *part-id-table* 902 init-specs 8 random-rangef) (* f28-0 f0-5)) + (launch-particles (-> *part-id-table* 902) gp-0) + (set! (-> *part-id-table* 902 init-specs 8 initial-valuef) f30-1) + (set! (-> *part-id-table* 902 init-specs 8 random-rangef) f28-0) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type ashelin-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this ashelin-shot)) + (cond + ((logtest? (-> *part-group-id-table* 222 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 222)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 222)) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type ashelin-shot +;; WARN: Return type mismatch object vs none. +(defmethod play-impact-sound ((this ashelin-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "ashelin-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "ashelin-shot-hi") + ) + ((= v1-0 (projectile-options po0 po1)) + ((method-of-type projectile play-impact-sound) this arg0) + ) + ) + ) + (none) + ) + +;; definition for method 38 of type ashelin-shot +(defmethod made-impact? ((this ashelin-shot)) + (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) (ppointer->process (-> this parent))) + (set! (-> a1-0 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> a1-0 action-mask) (collide-action solid)) + ) + (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + ) + ) + +;; definition for function ashelin-shot-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun ashelin-shot-move ((arg0 ashelin-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 40960.0 f0-0) + (vector-normalize! s4-0 40960.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (let ((v1-9 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-9) + (move-to-point! (-> arg0 root) a1-5) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type ashelin-shot +;; WARN: Return type mismatch symbol vs none. +(defmethod setup-collision! ((this ashelin-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (when (not (logtest? (-> (ppointer->process (-> this parent)) bot-flags) (bot-flag attacked))) + (let* ((a0-17 (-> this root)) + (v1-27 (-> a0-17 root-prim)) + ) + (countdown (a0-18 (-> a0-17 total-prims)) + (logclear! (-> v1-27 prim-core collide-with) (collide-spec jak)) + (&+! v1-27 80) + ) + ) + ) + (none) + ) + +;; definition for method 31 of type ashelin-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this ashelin-shot)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 307200.0) + (set! (-> this move) ashelin-shot-move) + (set! (-> this timeout) (seconds 1.335)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc new file mode 100644 index 0000000000..93c5ad0b6f --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-states_REF.gc @@ -0,0 +1,1090 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate waiting-idle (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (bot-method-235 self #f) + (when (not (focus-test? self grabbed)) + (cond + ((bot-method-226 self) + (go-hostile self) + ) + ((not (outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #f)) + (go-virtual traveling) + ) + ) + ) + 0 + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 ashelin-idle0-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 ashelin-standing-idle-ja)) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + (ja-no-eval :group! ashelin-standing-to-waiting-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (let ((v1-55 (ja-group))) + (cond + ((and v1-55 (= v1-55 ashelin-standing-to-waiting-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + ) + ) + ) + (until #f + (ja-no-eval :group! ashelin-idle0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate standing-idle (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flag bf21)) + ) + :trans (behavior () + (bot-method-235 self #t) + (cond + ((bot-method-226 self) + (cond + ((ashelin-method-250 self #t #t) + (when (and (ashelin-method-247 self #t) (let ((v1-11 (ja-group))) + (and v1-11 (= v1-11 ashelin-standing-idle-ja)) + ) + ) + (cond + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ((ashelin-method-247 self #f) + (go-virtual standing-blast) + ) + (else + (let ((a1-4 (ashelin-method-253 self))) + (if (nonzero? a1-4) + (go-dodge-state self a1-4) + ) + ) + ) + ) + ) + (let ((a1-5 (ashelin-method-257 self))) + (cond + ((nonzero? a1-5) + (go-dodge-state self a1-5) + ) + ((and (-> self focus-info fproc) (< 8192.0 (fabs (-> self focus-info ry-diff)))) + (go-virtual standing-turn) + ) + ) + ) + ) + (else + (let ((a1-6 (ashelin-method-257 self))) + (cond + ((nonzero? a1-6) + (go-dodge-state self a1-6) + ) + (else + (if (and (time-elapsed? (-> self state-time) (-> self reaction-time)) (ashelin-method-258 self)) + (go-virtual chase) + ) + ) + ) + ) + ) + ) + (when (logtest? (bot-flag bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flag bf21)) + (let ((a1-7 (ashelin-method-252 self))) + (if (nonzero? a1-7) + (go-dodge-state self a1-7) + ) + ) + ) + ) + (else + (if (time-elapsed? (-> self state-time) (-> self reaction-time)) + (go-idle self) + ) + ) + ) + ) + :code (behavior () + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 ashelin-standing-idle-ja)) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (or (= v1-16 ashelin-waiting-to-standing-ja) + (= v1-16 ashelin-standing-turn-left-ja) + (= v1-16 ashelin-standing-turn-right-ja) + ) + ) + ) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + ((let ((v1-31 (ja-group))) + (and v1-31 (= v1-31 ashelin-idle0-ja)) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! ashelin-waiting-to-standing-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (ja-channel-push! 1 (seconds 0.03)) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + ) + ) + ) + (until #f + (ja-no-eval :group! ashelin-standing-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate standing-turn (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + (logclear! (-> self bot-flags) (bot-flag bf21)) + ) + :trans (behavior () + (bot-method-235 self #f) + (when (bot-method-226 self) + (let ((a1-1 (ashelin-method-257 self))) + (if (nonzero? a1-1) + (go-dodge-state self a1-1) + ) + ) + (when (logtest? (bot-flag bf21) (-> self bot-flags)) + (logclear! (-> self bot-flags) (bot-flag bf21)) + (let ((a1-2 (ashelin-method-252 self))) + (if (nonzero? a1-2) + (go-dodge-state self a1-2) + ) + ) + ) + ) + ) + :code (behavior () + (let ((gp-0 (new 'stack-no-clear 'bot-turn-info))) + (let ((s5-0 (-> self focus-info fproc))) + (if (not s5-0) + (go-idle self) + ) + (bot-method-194 self gp-0 s5-0 0.335) + ) + (let ((s4-0 (-> self draw art-group data (if (>= (-> gp-0 predicted-ry-diff) 0.0) + 31 + 32 + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (let ((s5-1 (new 'stack-no-clear 'quaternion)) + (f0-1 (-> gp-0 predicted-ry-diff)) + (f30-0 0.0) + (f28-0 10.0) + ) + (quaternion-rotate-y! s5-1 (-> gp-0 src-quat) f0-1) + (ja-no-eval :group! s4-0 :num! (seek! max 2.0) :frame-num 0.0) + (until (ja-done? 0) + (let ((f0-6 (ja-aframe-num 0))) + (cond + ((< f0-6 f28-0) + (if (>= f0-6 f30-0) + (quaternion-slerp! (-> self root quat) (-> gp-0 src-quat) s5-1 (/ (- f0-6 f30-0) (- f28-0 f30-0))) + ) + ) + (else + (quaternion-copy! (-> self root quat) s5-1) + ) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + ) + ) + (go-virtual standing-idle) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate traveling (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-2 enemy-flags))) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-2 enemy-flags)))) + ) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-2 enemy-flags)))) + (set! (-> v1-2 nav callback-info) (-> v1-2 enemy-info callback-info)) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef38) (-> v1-5 enemy-flags)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-176 self) + (set! (-> self player-blocking) 0.0) + ) + :trans (behavior () + (if (focus-test? self grabbed) + (go-virtual waiting-idle) + ) + (bot-method-235 self #f) + (cond + ((bot-method-226 self) + (go-hostile self) + ) + ((outside-spot-radius? self (the-as bot-spot #f) (the-as vector #f) #t) + (go-idle self) + ) + ((and (time-elapsed? (-> self state-time) (seconds 0.5)) (bot-method-220 self)) + (go-virtual traveling-blocked) + ) + ((and (nav-enemy-method-174 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) + (go-stare2 self) + ) + ) + 0 + ) + :code (behavior () + (until #f + (ashelin-method-260 self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self spot)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 center quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate traveling-blocked (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (let ((v1-7 self)) + (set! (-> v1-7 enemy-flags) (the-as enemy-flag (logclear (-> v1-7 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set-look-at-mode! self 1) + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (bot-method-235 self #f) + (cond + ((bot-method-226 self) + (go-hostile self) + ) + ((and (time-elapsed? (-> self state-time) (seconds 1)) (not (bot-method-220 self))) + (go-virtual traveling) + ) + ) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate stare (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot stare) enter))) + (if t9-0 + (t9-0) + ) + ) + (let ((v1-4 self)) + (set! (-> v1-4 enemy-flags) (the-as enemy-flag (logclear (-> v1-4 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (set! (-> self travel-anim-interp) 0.0) + ) + :trans (behavior () + (bot-method-235 self #f) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (when (bot-method-226 self) + (if (ashelin-method-250 self #t #f) + (go-virtual standing-idle) + ) + ) + (if (not (nav-enemy-method-174 self)) + (go-virtual traveling) + ) + ) + ) + :code (-> (method-of-type ashelin waiting-idle) code) + ) + +;; failed to figure out what this is: +(defstate standing-blast (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (logior! (-> self enemy-flags) (enemy-flag lock-focus)) + (if (not (handle->process (-> self focus handle))) + (go-best-state self) + ) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + ) + :code (behavior () + (bot-method-235 self #t) + (if (or (not (bot-method-226 self)) (not (ashelin-method-247 self #f))) + (go-best-state self) + ) + (let ((v1-12 (ja-group))) + (if (and v1-12 (or (= v1-12 ashelin-standing-idle-ja) (= v1-12 ashelin-standing-fire-ja))) + (ja-channel-push! 1 (seconds 0.03)) + (ja-channel-push! 1 (seconds 0.08)) + ) + ) + (let ((gp-0 #f)) + (ja-no-eval :group! ashelin-standing-fire-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (when (and (not gp-0) (>= (ja-aframe-num 0) 7.0)) + (set! gp-0 #t) + (fire-shot self (-> self focus-info bullseye)) + ) + (suspend) + (ja :num! (seek!)) + ) + ) + (cond + ((logtest? (-> self bot-flags) (bot-flag attacked)) + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (bot-method-199 self) + ) + ((logtest? (-> self enemy-flags) (enemy-flag victory)) + (ashelin-method-256 self) + ) + ) + (go-best-state self) + ) + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate chase (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type nav-enemy hostile) enter)) + (nav-enemy-method-177 self) + ) + :trans (behavior () + (bot-method-235 self #t) + (cond + ((and (nav-enemy-method-174 self) (time-elapsed? (-> self state-time) (-> self reaction-time))) + (go-stare2 self) + ) + ((not (bot-method-226 self)) + (go-virtual traveling) + ) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (or (ashelin-method-250 self #t #f) (ashelin-method-259 self)) + (go-virtual standing-idle) + ) + ) + (let ((gp-0 (-> self nav))) + (set! (-> gp-0 target-speed) (lerp-scale + (-> self enemy-info walk-travel-speed) + (-> self enemy-info run-travel-speed) + (-> self focus-info bullseye-xz-dist) + 81920.0 + 92160.0 + ) + ) + ) + 0 + ) + :code (behavior () + (until #f + (ashelin-method-260 self) + (suspend) + ) + #f + ) + :post (behavior () + (let ((gp-0 (-> self nav state)) + (v1-6 (get-trans (the-as process-focusable (handle->process (-> self focus handle))) 0)) + ) + (logclear! (-> gp-0 flags) (nav-state-flag directional-mode)) + (logior! (-> gp-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> gp-0 target-pos quad) (-> v1-6 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate back-spring (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-178 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self root trans) (-> self move-dest)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (ja-no-eval :group! ashelin-back-spring-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-slerp! (-> self root quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-30 *game-info*) + (a0-11 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-11) + (set! (-> self attack-id) a0-11) + ) + (countdown (s5-1 2) + (vector-! gp-1 (-> self move-dest) (-> self root trans)) + (let ((a0-14 (-> self nav state)) + (v1-33 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-33 quad)) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 acceleration) 1638400.0) + ) + 0 + (let ((v1-38 (-> self nav))) + (set! (-> v1-38 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-40 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-40 enemy-flags))) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-40 enemy-flags)))) + ) + (set! (-> v1-40 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-40 enemy-flags)))) + (set! (-> v1-40 nav callback-info) (-> v1-40 enemy-info callback-info)) + ) + 0 + (let ((f0-13 (* 1.6153771 (vector-length gp-1)))) + (let ((v1-46 (-> self nav))) + (set! (-> v1-46 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! ashelin-back-spring-loop-ja :num! (seek! max 1.4) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-12 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-12 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-negate! gp-1 gp-1) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root quat)) + (suspend) + (ja :num! (seek! max 1.4)) + ) + (bot-method-235 self #f) + (if (or (not (bot-method-226 self)) (!= (ashelin-method-257 self) 1)) + (goto cfg-15) + ) + ) + ) + (label cfg-15) + (let ((v1-92 self)) + (set! (-> v1-92 enemy-flags) (the-as enemy-flag (logclear (-> v1-92 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-92 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! ashelin-back-spring-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate cartwheel-left (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-178 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 -16384.0) + (ja-no-eval :group! ashelin-cartwheel-left-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-slerp! (-> self root quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info callback-info)) + ) + 0 + (let ((f0-13 (* 1.0714335 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! ashelin-cartwheel-left-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 -16384.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-78 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! ashelin-cartwheel-left-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate tumble-right (ashelin) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-2 self)) + (set! (-> v1-2 enemy-flags) (the-as enemy-flag (logclear (-> v1-2 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-2 nav callback-info) *null-nav-callback-info*) + ) + 0 + (let ((v1-5 self)) + (set! (-> v1-5 enemy-flags) (the-as enemy-flag (logclear (-> v1-5 enemy-flags) (enemy-flag ef38)))) + ) + 0 + (stop-look-at! self) + (nav-enemy-method-178 self) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (set! (-> self travel-anim-interp) 0.0) + ) + :exit (behavior () + (if (logtest? (enemy-flag ef44) (-> self enemy-flags)) + (logior! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + (logclear! (-> self nav flags) (nav-control-flag update-heading-from-facing)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self move-dest) (-> self root trans)))) + (let ((s5-0 (new 'stack-no-clear 'quaternion)) + (s4-0 (new 'stack-no-clear 'quaternion)) + ) + (quaternion-copy! s5-0 (-> self root quat)) + (quaternion<-rotate-y-vector s4-0 gp-1) + (quaternion-rotate-y! s4-0 s4-0 16384.0) + (ja-no-eval :group! ashelin-tumble-right-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (quaternion-slerp! (-> self root quat) s5-0 s4-0 (/ (ja-frame-num 0) (the float (ja-num-frames 0)))) + (suspend) + (ja :num! (seek!)) + ) + ) + (logior! (-> self focus-status) (focus-status dangerous)) + (let* ((v1-29 *game-info*) + (a0-13 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-13) + (set! (-> self attack-id) a0-13) + ) + (let ((a0-14 (-> self nav state)) + (v1-31 gp-1) + ) + (set! (-> a0-14 heading quad) (-> v1-31 quad)) + ) + 0 + (let ((v1-34 (-> self nav))) + (set! (-> v1-34 acceleration) 1638400.0) + ) + 0 + (let ((v1-36 (-> self nav))) + (set! (-> v1-36 turning-acceleration) 1638400.0) + ) + 0 + (let ((v1-38 self)) + (if (not (logtest? (enemy-flag ef37) (-> v1-38 enemy-flags))) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef39) (-> v1-38 enemy-flags)))) + ) + (set! (-> v1-38 enemy-flags) (the-as enemy-flag (logior (enemy-flag ef37) (-> v1-38 enemy-flags)))) + (set! (-> v1-38 nav callback-info) (-> v1-38 enemy-info callback-info)) + ) + 0 + (let ((f0-13 (* 1.8749386 (vector-length gp-1)))) + (let ((v1-44 (-> self nav))) + (set! (-> v1-44 target-speed) f0-13) + ) + 0 + (set! (-> self nav state speed) f0-13) + ) + 0 + (ja-no-eval :group! ashelin-tumble-right-loop-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (let ((a1-11 (-> self nav state))) + (set! (-> gp-1 quad) (-> a1-11 heading quad)) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate-around-y! gp-1 gp-1 16384.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + (quaternion-normalize! (-> self root quat)) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-78 self)) + (set! (-> v1-78 enemy-flags) (the-as enemy-flag (logclear (-> v1-78 enemy-flags) (enemy-flag ef37)))) + (set! (-> v1-78 nav callback-info) *null-nav-callback-info*) + ) + 0 + (nav-enemy-method-178 self) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (ja-no-eval :group! ashelin-tumble-right-land-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + :post (behavior () + (let ((a0-0 (-> self nav state)) + (v1-1 (-> self move-dest)) + ) + (logclear! (-> a0-0 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-0 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-0 target-pos quad) (-> v1-1 quad)) + ) + 0 + (nav-enemy-travel-post) + ) + ) + +;; failed to figure out what this is: +(defstate hit (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + 0 + ) + :code (behavior () + (local-vars (v1-7 enemy-flag) (v1-9 enemy-flag) (v1-11 enemy-flag)) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? v1-6 (enemy-flag vulnerable-backup)) + (set! v1-7 (logior v1-6 (enemy-flag vulnerable))) + (set! v1-7 (logclear v1-6 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-7) + (let ((v1-8 (-> self enemy-flags))) + (if (logtest? v1-8 (enemy-flag attackable-backup)) + (set! v1-9 (logior v1-8 (enemy-flag attackable))) + (set! v1-9 (logclear v1-8 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-9) + (let ((v1-10 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-10) + (set! v1-11 (logior (enemy-flag trackable) v1-10)) + (set! v1-11 (logclear v1-10 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-11) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (ashelin) + :virtual #t + :enter (behavior () + (set! (-> self travel-anim-interp) 0.0) + (set! (-> self last-fire-time) 0) + (let ((t9-0 (-> (method-of-type bot knocked) enter))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self bot-flags) (bot-flag bf23)) + (when (and (!= (-> self hit-points) 0.0) (zero? (-> self fated-time))) + (if (logtest? (-> self bot-flags) (bot-flag bf04)) + (logior! (-> self bot-flags) (bot-flag bf12)) + (logior! (-> self bot-flags) (bot-flag bf23)) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type bot knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (bot-flag bf23) (-> self bot-flags)) (!= (-> self state-time) (current-time))) + (logclear! (-> self bot-flags) (bot-flag bf23)) + (ashelin-method-255 self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die-falling (ashelin) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type bot die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self travel-anim-interp) 0.0) + ) + :code (behavior () + (play-speech-by-name self "ash117") + (let ((v1-4 (ja-group))) + (cond + ((and v1-4 (or (= v1-4 ashelin-knocked-back-die0-ja) (= v1-4 ashelin-knocked-right-die0-ja))) + (ja-no-eval :num! (seek!)) + (while (not (ja-done? 0)) + (suspend) + (ja-eval) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (falling? self) + (-> self enemy-info die-falling-anim) + (-> self enemy-info die-anim) + ) + ) + ) + (f30-0 (rnd-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + ) + ) + (until #f + (when (logtest? (-> self bot-flags) (bot-flag failed)) + (let ((a0-19 (res-lump-struct (-> self entity) 'task-name structure))) + (when a0-19 + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'fail) + (let ((s5-0 send-event-function) + (v1-48 (-> *game-info* sub-task-list (task-node-index-by-name (the-as string a0-19)))) + ) + (s5-0 + (handle->process (if (-> v1-48 manager) + (-> v1-48 manager manager) + (the-as handle #f) + ) + ) + gp-1 + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate failed (ashelin) + :virtual #t + :enter (behavior () + (go-virtual die-falling) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-task_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-task_REF.gc new file mode 100644 index 0000000000..cc889f5146 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash-task_REF.gc @@ -0,0 +1,85 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 9 of type asht-wait-spot +;; WARN: Return type mismatch int vs none. +(defmethod reset-task! ((this asht-wait-spot)) + (set! (-> this check-done) #f) + (set! (-> this which-spot) -1) + (set! (-> this num-spots) (the-as uint 0)) + 0 + (none) + ) + +;; definition for method 11 of type asht-wait-spot +;; WARN: Return type mismatch none vs object. +(defmethod ai-task-method-11 ((this asht-wait-spot) (arg0 bot)) + (let ((s4-0 (-> this which-spot))) + (when (>= s4-0 0) + (let ((s3-0 (-> arg0 course spots (-> this spot-indexes s4-0)))) + (if (and (not (outside-spot-radius? arg0 s3-0 (the-as vector #f) #f)) (player-blocking-spot? arg0 s3-0)) + (set! s4-0 -1) + ) + ) + ) + (when (< s4-0 0) + (set! s4-0 (choose-spot arg0 (the-as int (-> this num-spots)) (-> this spot-indexes))) + (set! (-> this which-spot) s4-0) + (mem-copy! + (the-as pointer (-> arg0 spot)) + (the-as pointer (-> arg0 course spots (-> this spot-indexes s4-0))) + 20 + ) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc16)) + (bot-method-198 + arg0 + (the-as int (-> this num-spots)) + (-> this spot-indexes) + (the-as int (-> this spot-indexes s4-0)) + ) + ) + ) + (when (not ((-> this check-done) this (the-as ashelin arg0))) + (let ((a1-10 (handle->process (-> arg0 focus handle)))) + (when (and a1-10 + (attacked-by-player? arg0 (the-as process-focusable a1-10)) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) + ) + (get-task-by-type (-> arg0 ai-ctrl) asht-fight-focus arg0) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + ) + ) + ) + ) + +;; definition for method 11 of type asht-fight-focus +(defmethod ai-task-method-11 ((this asht-fight-focus) (arg0 bot)) + (let ((a1-1 (handle->process (-> arg0 focus handle)))) + (cond + ((and a1-1 + (attacked-by-player? arg0 (the-as process-focusable a1-1)) + (not (logtest? (-> arg0 focus-status) (focus-status grabbed))) + ) + (let ((v0-1 (the-as object (logior (-> arg0 bot-flags) (bot-flag bf00))))) + (set! (-> arg0 bot-flags) (the-as bot-flag v0-1)) + v0-1 + ) + ) + (else + (ai-task-control-method-14 (-> arg0 ai-ctrl) this arg0) + ) + ) + ) + ) + +;; definition for method 10 of type asht-fight-focus +;; WARN: Return type mismatch bot-flag vs none. +(defmethod ai-task-method-10 ((this asht-fight-focus) (arg0 bot)) + (logclear! (-> arg0 bot-flags) (bot-flag bf00)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc new file mode 100644 index 0000000000..e3d3f2cef2 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/ashelin/ash_REF.gc @@ -0,0 +1,1510 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ashelin-anim-info +(deftype ashelin-anim-info (structure) + ((anim-index int32) + ) + :pack-me + ) + +;; definition for method 3 of type ashelin-anim-info +(defmethod inspect ((this ashelin-anim-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'ashelin-anim-info) + (format #t "~1Tanim-index: ~D~%" (-> this anim-index)) + (label cfg-4) + this + ) + +;; definition of type ashelin-global-info +(deftype ashelin-global-info (basic) + ((prev-blue-hit int8) + (blue-hit-anim ashelin-anim-info 6 :inline) + (blue-hit-land-anim ashelin-anim-info 6 :inline) + ) + ) + +;; definition for method 3 of type ashelin-global-info +(defmethod inspect ((this ashelin-global-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tprev-blue-hit: ~D~%" (-> this prev-blue-hit)) + (format #t "~1Tblue-hit-anim[6] @ #x~X~%" (-> this blue-hit-anim)) + (format #t "~1Tblue-hit-land-anim[6] @ #x~X~%" (-> this blue-hit-land-anim)) + (label cfg-4) + this + ) + +;; definition for symbol *ashelin-global-info*, type ashelin-global-info +(define *ashelin-global-info* (new 'static 'ashelin-global-info + :blue-hit-anim (new 'static 'inline-array ashelin-anim-info 6 + (new 'static 'ashelin-anim-info :anim-index 13) + (new 'static 'ashelin-anim-info :anim-index 14) + (new 'static 'ashelin-anim-info :anim-index 15) + (new 'static 'ashelin-anim-info :anim-index 19) + (new 'static 'ashelin-anim-info :anim-index 20) + (new 'static 'ashelin-anim-info :anim-index 21) + ) + :blue-hit-land-anim (new 'static 'inline-array ashelin-anim-info 6 + (new 'static 'ashelin-anim-info :anim-index 16) + (new 'static 'ashelin-anim-info :anim-index 17) + (new 'static 'ashelin-anim-info :anim-index 18) + (new 'static 'ashelin-anim-info :anim-index 22) + (new 'static 'ashelin-anim-info :anim-index 23) + (new 'static 'ashelin-anim-info :anim-index 24) + ) + ) + ) + +;; definition for symbol *ashelin-nav-enemy-info*, type nav-enemy-info +(define *ashelin-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #t + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim -1 + :hit-anim 3 + :knocked-anim 10 + :knocked-land-anim 11 + :die-anim 26 + :die-falling-anim 26 + :victory-anim -1 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint 5 + :look-at-joint 6 + :bullseye-joint 4 + :notice-distance (meters 40) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 20) + :default-hit-points 10.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak civilian enemy vehicle-sphere hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.7 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 57344.0 + :knocked-soft-vxz-hi 57344.0 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 81920.0 + :knocked-medium-vxz-lo 57344.0 + :knocked-medium-vxz-hi 57344.0 + :knocked-medium-vy-lo 81920.0 + :knocked-medium-vy-hi 81920.0 + :knocked-hard-vxz-lo 57344.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 81920.0 + :knocked-hard-vy-hi 81920.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 57344.0 + :knocked-yellow-vxz-hi 57344.0 + :knocked-yellow-vy-lo 81920.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 57344.0 + :knocked-red-vxz-hi 57344.0 + :knocked-red-vy-lo 81920.0 + :knocked-red-vy-hi 81920.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 40960.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #t + :use-frustration #t + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 4 + :turn-anim -1 + :run-anim 6 + :taunt-anim -1 + :run-travel-speed (meters 10) + :run-acceleration (meters 25) + :run-turning-acceleration (meters 12) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 5) + :walk-turning-acceleration (meters 6) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 20) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *ashelin-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 66 of type ashelin +(defmethod get-penetrated-by ((this ashelin)) + (let* ((t9-0 (method-of-type bot get-penetrated-by)) + (v0-0 (t9-0 this)) + ) + (if (logtest? (bot-flag bf22) (-> this bot-flags)) + (set! v0-0 (logior (penetrate jak-yellow-shot) v0-0)) + ) + v0-0 + ) + ) + +;; definition for method 261 of type ashelin +(defmethod ashelin-method-261 ((this ashelin) (arg0 symbol)) + (if arg0 + (logior! (-> this bot-flags) (bot-flag bf22)) + (logclear! (-> this bot-flags) (bot-flag bf22)) + ) + (let ((v0-0 (get-penetrated-by this))) + (set! (-> this root penetrated-by) v0-0) + v0-0 + ) + ) + +;; definition for method 205 of type ashelin +(defmethod bot-method-205 ((this ashelin)) + (let* ((t9-0 (method-of-type bot bot-method-205)) + (v0-0 (t9-0 this)) + ) + (when (and (not v0-0) (logtest? (penetrate jak-yellow-shot) (-> this incoming penetrate-using))) + (if (logtest? (bot-flag bf22) (-> this bot-flags)) + (set! v0-0 #t) + ) + (logior! (-> this bot-flags) (bot-flag bf21)) + ) + v0-0 + ) + ) + +;; definition for method 112 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod get-incoming-attack! ((this ashelin) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + (let ((t9-0 (method-of-type bot get-incoming-attack!))) + (t9-0 this arg0 arg1 arg2 arg3 arg4) + ) + (if (!= (-> this incoming knocked-type) (knocked-type blue-shot)) + (set! (-> this incoming knocked-type) (knocked-type mech-punch)) + ) + (none) + ) + +;; definition for method 110 of type ashelin +(defmethod send-attack ((this ashelin) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (if (and (= (-> arg0 type) target) + (-> this next-state) + (let ((v1-4 (-> this next-state name))) + (or (= v1-4 'back-spring) (= v1-4 'cartwheel-left) (= v1-4 'tumble-right)) + ) + ) + #f + ((method-of-type bot send-attack) this arg0 arg1 arg2) + ) + ) + +;; definition for method 106 of type ashelin +(defmethod find-best-focus ((this ashelin)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> this bot-flags) (bot-flag attacked))) + (time-elapsed? (-> this attacker-time) (seconds 5)) + ) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (bot-method-199 this) + ) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (time-elapsed? (-> this attacker-time) (seconds 2.5)) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> this focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + (else + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + s5-1 + ) + ) + ) + +;; definition for method 195 of type ashelin +;; WARN: Return type mismatch object vs symbol. +(defmethod alive? ((this ashelin)) + (let ((t9-0 (method-of-type bot alive?))) + (the-as + symbol + (and (t9-0 this) (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'waiting-idle) (= v1-3 'hidden) (= v1-3 'traveling)) + ) + ) + ) + ) + ) + +;; definition for method 120 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this ashelin)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-others)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid can-ride deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 8192.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-12 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-12 prim-core action) (collide-action solid can-ride deadly)) + (set-vector! (-> v1-12 local-sphere) 0.0 3276.8 0.0 3276.8) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-14 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-14 local-sphere) 0.0 5324.8 0.0 3276.8) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec bot bot-targetable)) + (set! (-> v1-16 prim-core collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> v1-16 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-16 local-sphere) 0.0 7372.8 0.0 3276.8) + ) + (set! (-> s5-0 nav-radius) 5120.0) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> s5-0 event-priority) (the-as uint 7)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this ashelin)) + (init-fields! this) + (set! (-> this channel) (gui-channel ashelin)) + (set! (-> this travel-anim-interp) 0.0) + (set! (-> this focus-info max-los-dist) 204800.0) + (logior! (-> this bot-flags) (bot-flag bf02)) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 0)) + (set! (-> this hit-invuln-focus-disable-delay) (the-as uint 750)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-ashelin" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *ashelin-nav-enemy-info*) + (let ((v1-12 (-> this neck))) + (set! (-> v1-12 up) (the-as uint 1)) + (set! (-> v1-12 nose) (the-as uint 2)) + (set! (-> v1-12 ear) (the-as uint 0)) + (set-vector! (-> v1-12 twist-max) 11832.889 11832.889 0.0 1.0) + (set! (-> v1-12 ignore-angle) 30947.555) + ) + (let ((t9-4 (method-of-type bot init-enemy!))) + (t9-4 this) + ) + (set! (-> this my-simple-focus) (process-spawn simple-focus :name "simple-focus" :to this)) + 0 + (none) + ) + +;; definition for method 250 of type ashelin +;; WARN: disable def twice: 25. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod ashelin-method-250 ((this ashelin) (arg0 symbol) (arg1 symbol)) + (cond + ((and (logtest? (-> this bot-flags) (bot-flag attacked)) (= (-> this focus-info fproc type) target)) + #t + ) + (else + (let ((f0-0 81920.0)) + (if arg1 + (set! f0-0 (+ 6144.0 f0-0)) + ) + (when (>= f0-0 (-> this focus-info bullseye-xz-dist)) + (let ((v1-9 (-> this focus-info los))) + (if arg0 + (or (= v1-9 1) (= v1-9 4)) + (= v1-9 1) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 247 of type ashelin +(defmethod ashelin-method-247 ((this ashelin) (arg0 symbol)) + (and (time-elapsed? (-> this last-fire-time) (seconds 1)) + (and (>= 8556.089 (fabs (-> this focus-info ry-diff))) (ashelin-method-250 this arg0 #t)) + ) + ) + +;; definition for method 254 of type ashelin +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 254 ashelin) has a return type of none, but the expression builder found a return statement. +(defmethod ashelin-method-254 ((this ashelin) (arg0 float)) + (let ((f30-0 (deg- arg0 (-> this focus-info my-facing-ry)))) + (when (>= 16384.0 (fabs f30-0)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s5-0 (+ 32768.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) + (return 1) + ) + (cond + ((< 0.0 f30-0) + (when (ashelin-method-248 this s5-0 (+ -16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) + (return 2) + ) + ) + (else + (when (ashelin-method-248 this s5-0 (+ 16384.0 arg0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s5-0 (-> this root trans)) + (return 3) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 257 of type ashelin +;; WARN: Return type mismatch object vs int. +(defmethod ashelin-method-257 ((this ashelin)) + (when (>= 32768.0 (-> this focus-info bullseye-xz-dist)) + (let ((f0-1 (-> this focus-info bullseye-ry))) + (return (the-as int (ashelin-method-254 this f0-1))) + ) + ) + (when (logtest? (bot-flag bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (when (>= (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)) 12288.0) + (let ((f0-7 (atan (-> this frontline x) (-> this frontline z)))) + (return (the-as int (ashelin-method-254 this f0-7))) + ) + ) + ) + (the-as int 0) + ) + +;; definition for method 252 of type ashelin +(defmethod ashelin-method-252 ((this ashelin)) + (let* ((v1-0 (target-pos 0)) + (a1-0 (-> this root trans)) + (f30-0 (atan (- (-> a1-0 x) (-> v1-0 x)) (- (-> a1-0 z) (-> v1-0 z)))) + (f0-5 (deg- f30-0 (-> this focus-info my-facing-ry))) + (s5-0 0) + ) + (cond + ((or (>= 8192.0 (fabs f0-5)) (>= (fabs f0-5) 24576.0)) + (let ((s3-1 (zero? (rnd-int this 2))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (countdown (s2-0 2) + (cond + (s3-1 + (when (ashelin-method-248 this s4-0 (+ 16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) + (set! s5-0 3) + (goto cfg-20) + ) + ) + (else + (when (ashelin-method-248 this s4-0 (+ -16384.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) + (set! s5-0 2) + (goto cfg-20) + ) + ) + ) + (set! s3-1 (not s3-1)) + ) + ) + (label cfg-20) + ) + (else + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s4-1 (+ 32768.0 f30-0) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) + (set! s5-0 1) + ) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 253 of type ashelin +(defmethod ashelin-method-253 ((this ashelin)) + (let ((s5-0 0)) + (cond + ((zero? (rnd-int this 2)) + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s4-0 (+ 16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-0 (-> this root trans)) + (set! s5-0 3) + ) + ) + ) + ) + (else + (when (>= 16384.0 (fabs (-> this focus-info ry-diff))) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (when (ashelin-method-248 this s4-1 (+ -16384.0 (-> this focus-info bullseye-ry)) 8192.0 40707.93 34563.93) + (vector+! (-> this move-dest) s4-1 (-> this root trans)) + (set! s5-0 2) + ) + ) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 251 of type ashelin +(defmethod go-dodge-state ((this ashelin) (arg0 int)) + (case arg0 + ((3) + (go (method-of-object this cartwheel-left)) + ) + ((2) + (go (method-of-object this tumble-right)) + ) + (else + (go (method-of-object this back-spring)) + ) + ) + ) + +;; definition for method 258 of type ashelin +;; INFO: Used lq/sq +(defmethod ashelin-method-258 ((this ashelin)) + (cond + ((logtest? (bot-flag bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f30-0 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans)))) + (let ((f0-4 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye)))) + (if (or (>= 0.0 f0-4) (>= -8192.0 f30-0)) + (return #t) + ) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (if (>= -0.342 (vector-dot s5-0 (the-as vector (-> this frontline)))) + (return #t) + ) + (if (>= f30-0 0.0) + (return #f) + ) + (let ((a2-0 (new 'stack-no-clear 'vector)) + (a0-8 (new 'stack-no-clear 'vector)) + ) + (vector-float*! a2-0 (the-as vector (-> this frontline)) (- (-> this frontline w))) + (set! (-> a0-8 quad) (-> this root trans quad)) + (set! (-> a0-8 y) 0.0) + (>= (intersect-ray-plane a0-8 s5-0 a2-0 (-> this frontline)) 8192.0) + ) + ) + ) + ) + (else + #t + ) + ) + ) + +;; definition for method 259 of type ashelin +;; WARN: Return type mismatch symbol vs none. +(defmethod ashelin-method-259 ((this ashelin)) + (when (logtest? (bot-flag bf20) (-> this bot-flags)) + (set! (-> this root trans w) 1.0) + (set! (-> this focus-info bullseye w) 1.0) + (let ((f0-3 (vector4-dot (the-as vector (-> this frontline)) (-> this root trans))) + (f1-1 (vector4-dot (the-as vector (-> this frontline)) (-> this focus-info bullseye))) + ) + (when (and (< 0.0 f1-1) (< 0.0 f0-3)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 (-> this focus-info bullseye) (-> this root trans)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s5-0 (the-as vector (-> this frontline))) 0.0) + ) + ) + ) + ) + (none) + ) + +;; definition for method 78 of type ashelin +(defmethod go-hostile ((this ashelin)) + (bot-method-235 this #t) + (cond + ((not (bot-method-226 this)) + (go-best-state this) + ) + ((ashelin-method-250 this #t #f) + (go (method-of-object this standing-idle)) + ) + ((ashelin-method-258 this) + (go (method-of-object this chase)) + ) + (else + (go (method-of-object this standing-idle)) + ) + ) + ) + +;; definition for method 80 of type ashelin +(defmethod go-best-state ((this ashelin)) + (if (bot-method-226 this) + (go-hostile this) + (go-idle this) + ) + ) + +;; definition for method 73 of type ashelin +(defmethod go-idle ((this ashelin)) + (if (bot-method-226 this) + (go (method-of-object this standing-idle)) + (go (method-of-object this waiting-idle)) + ) + ) + +;; definition for method 122 of type ashelin +(defmethod go-idle2 ((this ashelin)) + (go (method-of-object this hidden)) + ) + +;; definition for method 249 of type ashelin +;; INFO: Used lq/sq +(defmethod fire-shot ((this ashelin) (arg0 vector)) + (set-time! (-> this last-fire-time)) + (+! (-> this fired-gun-count) 1) + (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (set! (-> s4-0 ent) (-> this entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options po13 po17)) + (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) + (set! (-> s4-0 notify-handle) (process->handle this)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 target-handle) (the-as handle #f)) + (set! (-> s4-0 target-pos quad) (the-as uint128 0)) + (set! (-> s4-0 ignore-handle) (process->handle this)) + (let* ((v1-16 *game-info*) + (a0-11 (+ (-> v1-16 attack-id) 1)) + ) + (set! (-> v1-16 attack-id) a0-11) + (set! (-> s4-0 attack-id) a0-11) + ) + (set! (-> s4-0 timeout) (seconds 4)) + (vector<-cspace! (-> s4-0 pos) (-> this node-list data 22)) + (set! (-> s4-0 vel quad) (-> arg0 quad)) + (vector-! (-> s4-0 vel) (-> s4-0 vel) (-> s4-0 pos)) + (vector-normalize! (-> s4-0 vel) 307200.0) + (spawn-projectile ashelin-shot s4-0 this *default-dead-pool*) + ) + ) + +;; definition for method 260 of type ashelin +(defmethod ashelin-method-260 ((this ashelin)) + (local-vars (v0-6 int)) + (with-pp + (let* ((f30-0 (-> this nav state speed)) + (f0-1 (lerp-scale 0.0 2.0 f30-0 12288.0 40960.0)) + (f1-0 (-> this travel-anim-interp)) + (v1-5 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-5 (= v1-5 (-> this draw art-group data 5))) + (let ((f28-0 f1-0) + (f0-4 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame)))) + ) + (cond + ((logtest? (bot-flag bf19) (-> this bot-flags)) + (if (< f0-4 1.0) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-17 (-> this skel root-channel 1))) + (set! (-> v1-17 dist) 13107.2) + (set! (-> v1-17 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) + ) + (logclear! (-> this bot-flags) (bot-flag bf19)) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + (else + (if (< 1.0 f0-4) + (set! f0-4 (cond + ((= f28-0 1.0) + (let ((v1-27 (-> this skel root-channel 1))) + (set! (-> v1-27 dist) 43690.68) + (set! (-> v1-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) + ) + (logior! (-> this bot-flags) (bot-flag bf19)) + f0-4 + ) + (else + 1.0 + ) + ) + ) + ) + ) + ) + (set! (-> this travel-anim-interp) f0-4) + (let ((f0-7 (if (logtest? (bot-flag bf19) (-> this bot-flags)) + (+ -1.0 f0-4) + (- 1.0 f0-4) + ) + ) + (v1-39 (-> this skel root-channel 1)) + ) + (set! (-> v1-39 frame-interp 1) f0-7) + (set! (-> v1-39 frame-interp 0) f0-7) + ) + ) + (let* ((f28-1 (current-cycle-distance (-> this skel))) + (f0-8 (quaternion-y-angle (-> this root quat))) + (f1-10 (deg- f0-8 (-> this travel-prev-ry))) + (f0-11 (fmin 40960.0 (* 0.35342914 (-> pp clock frames-per-second) (fabs f1-10)))) + (f0-14 (/ (* 16.0 (fmax f30-0 f0-11)) (* 15.0 f28-1))) + (a0-22 (-> this skel root-channel 0)) + ) + (set! (-> a0-22 param 0) f0-14) + (joint-control-channel-group-eval! a0-22 (the-as art-joint-anim #f) num-func-loop!) + ) + (let ((a0-23 (-> this skel root-channel 1))) + (set! (-> a0-23 param 0) 0.0) + (joint-control-channel-group-eval! a0-23 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (else + (let ((f30-1 (seek f1-0 f0-1 (* 4.0 (seconds-per-frame))))) + (set! (-> this travel-anim-interp) f30-1) + (ja-channel-push! 2 (seconds 0.15)) + (let ((a0-26 (-> this skel root-channel 0))) + (set! (-> a0-26 dist) 26214.4) + (set! (-> a0-26 frame-group) (the-as art-joint-anim (-> this draw art-group data 5))) + (set! (-> a0-26 param 0) 1.0) + (joint-control-channel-group! a0-26 (the-as art-joint-anim (-> this draw art-group data 5)) num-func-loop!) + ) + (cond + ((< f30-1 1.0) + (let ((f0-22 (- 1.0 f30-1)) + (a0-27 (-> this skel root-channel 1)) + ) + (set! (-> a0-27 frame-interp 1) f0-22) + (set! (-> a0-27 frame-interp 0) f0-22) + (set! (-> a0-27 dist) 13107.2) + (set! (-> a0-27 frame-group) (the-as art-joint-anim (-> this draw art-group data 4))) + (set! (-> a0-27 param 0) 0.0) + (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> this draw art-group data 4)) num-func-chan) + ) + (set! v0-6 (the-as int (logclear (-> this bot-flags) (bot-flag bf19)))) + (set! (-> this bot-flags) (the-as bot-flag v0-6)) + ) + (else + (let ((f0-26 (+ -1.0 f30-1)) + (a0-29 (-> this skel root-channel 1)) + ) + (set! (-> a0-29 frame-interp 1) f0-26) + (set! (-> a0-29 frame-interp 0) f0-26) + (set! (-> a0-29 dist) 43690.68) + (set! (-> a0-29 frame-group) (the-as art-joint-anim (-> this draw art-group data 6))) + (set! (-> a0-29 param 0) 0.0) + (joint-control-channel-group! a0-29 (the-as art-joint-anim (-> this draw art-group data 6)) num-func-chan) + ) + (set! v0-6 (the-as int (logior (bot-flag bf19) (-> this bot-flags)))) + (set! (-> this bot-flags) (the-as bot-flag v0-6)) + ) + ) + ) + v0-6 + ) + ) + ) + ) + ) + +;; definition for method 55 of type ashelin +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs degrees. +(defmethod get-knockback-angle ((this ashelin)) + (local-vars (v1-36 art-element)) + (let ((f28-0 (quaternion-y-angle (-> this root quat)))) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((a0-4 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-4 + (get-trans a0-4 0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root transv quad)) + (if (< (vector-dot (-> this root transv) (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + 0.0 + ) + (vector-negate-in-place! s5-0) + ) + (set! f28-0 (atan (-> s5-0 x) (-> s5-0 z))) + ) + ) + ) + ) + (else + (let ((s5-1 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (vector-z-quaternion! s5-1 (-> this root quat)) + (let ((f28-1 (atan (-> s5-1 x) (-> s5-1 z)))) + (get-knockback-dir! this s5-1) + (let* ((f30-0 (atan (-> s5-1 x) (-> s5-1 z))) + (f0-10 (deg- f30-0 f28-1)) + ) + (set! f28-0 (if (>= 16384.0 (fabs f0-10)) + f30-0 + (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48)) + ) + ) + (cond + ((and (>= 8192.0 f0-10) (>= f0-10 -16384.0)) + (set! v1-36 (-> this draw art-group data 10)) + ) + ((>= f0-10 8192.0) + (set! v1-36 (-> this draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ((zero? (rnd-int this 3)) + (set! v1-36 (-> this draw art-group data 10)) + ) + (else + (set! v1-36 (-> this draw art-group data 7)) + (set! f28-0 (the float (sar (shl (the int (+ 32768.0 f30-0)) 48) 48))) + ) + ) + ) + ) + ) + (set! (-> this knocked-anim) (the-as art-joint-anim v1-36)) + ) + ) + (the-as degrees f28-0) + ) + ) + +;; definition for method 85 of type ashelin +(defmethod knocked-anim ((this ashelin) (arg0 enemy-knocked-info)) + (local-vars (a2-0 int)) + (case (-> this incoming knocked-type) + (((knocked-type blue-shot)) + (let ((s5-1 (ash 1 (-> *ashelin-global-info* prev-blue-hit))) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + (vector-z-quaternion! s4-0 (-> this root quat)) + (let ((f30-0 (atan (-> s4-0 x) (-> s4-0 z)))) + (get-knockback-dir! this s4-0) + (let* ((f0-6 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-8 (fabs (deg- f0-6 f30-0))) + ) + (if (>= 16384.0 f0-8) + (set! a2-0 (logior s5-1 7)) + (set! a2-0 (logior s5-1 56)) + ) + ) + ) + ) + (let* ((v1-9 (enemy-method-131 this 6 a2-0)) + (s5-2 (-> this draw art-group data (-> *ashelin-global-info* blue-hit-anim v1-9 anim-index))) + ) + (set! (-> *ashelin-global-info* prev-blue-hit) v1-9) + (let ((v1-12 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (if (and v1-12 (or (= v1-12 (-> this draw art-group data 16)) + (= v1-12 (-> this draw art-group data 17)) + (= v1-12 (-> this draw art-group data 18)) + (= v1-12 (-> this draw art-group data 22)) + (= v1-12 (-> this draw art-group data 23)) + (= v1-12 (-> this draw art-group data 24)) + ) + ) + (ja-channel-push! 1 (seconds 0.17)) + (ja-channel-push! 1 (seconds 0.02)) + ) + ) + (let ((a0-38 (-> this skel root-channel 0))) + (set! (-> a0-38 frame-group) (the-as art-joint-anim s5-2)) + (set! (-> a0-38 param 0) (the float (+ (-> (the-as art-joint-anim s5-2) frames num-frames) -1))) + (set! (-> a0-38 param 1) 1.0) + (set! (-> a0-38 frame-num) 0.0) + (joint-control-channel-group! a0-38 (the-as art-joint-anim s5-2) num-func-seek!) + ) + ) + #t + ) + (else + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-40 (-> this skel root-channel 0))) + (set! (-> a0-40 frame-group) (-> this knocked-anim)) + (set! (-> a0-40 param 0) (the float (+ (-> this knocked-anim frames num-frames) -1))) + (set! (-> a0-40 param 1) (-> arg0 anim-speed)) + (set! (-> a0-40 frame-num) 0.0) + (joint-control-channel-group! a0-40 (-> this knocked-anim) num-func-seek!) + ) + #t + ) + ) + ) + +;; definition for method 86 of type ashelin +(defmethod knocked-land-anim ((this ashelin) (arg0 enemy-knocked-info)) + (let ((v1-0 (-> this incoming knocked-type))) + (cond + ((= v1-0 (knocked-type blue-shot)) + (let* ((v1-1 *ashelin-global-info*) + (s5-0 (-> this draw art-group data (-> v1-1 blue-hit-land-anim (-> v1-1 prev-blue-hit) anim-index))) + ) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-7 (-> this skel root-channel 0))) + (set! (-> a0-7 frame-group) (the-as art-joint-anim s5-0)) + (set! (-> a0-7 param 0) (the float (+ (-> (the-as art-joint-anim s5-0) frames num-frames) -1))) + (set! (-> a0-7 param 1) 1.0) + (set! (-> a0-7 frame-num) 0.0) + (joint-control-channel-group! a0-7 (the-as art-joint-anim s5-0) num-func-seek!) + ) + ) + #t + ) + ((let ((v1-15 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (and v1-15 (= v1-15 (-> this draw art-group data 7))) + ) + (cond + ((or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 9))) + (set! (-> a0-14 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 9)) frames num-frames) -1)) + ) + (set! (-> a0-14 param 1) 1.0) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 9)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-16 (-> this skel root-channel 0))) + (set! (-> a0-16 frame-group) (the-as art-joint-anim (-> this draw art-group data 8))) + (set! (-> a0-16 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 8)) frames num-frames) -1)) + ) + (set! (-> a0-16 param 1) 1.0) + (set! (-> a0-16 frame-num) 0.0) + (joint-control-channel-group! a0-16 (the-as art-joint-anim (-> this draw art-group data 8)) num-func-seek!) + ) + #t + ) + ) + ) + ((and (or (= (-> this hit-points) 0.0) (nonzero? (-> this fated-time))) (nonzero? (rnd-int this 3))) + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-20 (-> this skel root-channel 0))) + (set! (-> a0-20 frame-group) (the-as art-joint-anim (-> this draw art-group data 12))) + (set! (-> a0-20 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 12)) frames num-frames) -1)) + ) + (set! (-> a0-20 param 1) 1.0) + (set! (-> a0-20 frame-num) 0.0) + (joint-control-channel-group! a0-20 (the-as art-joint-anim (-> this draw art-group data 12)) num-func-seek!) + ) + #f + ) + (else + (ja-channel-push! 1 (seconds 0.17)) + (let ((a0-22 (-> this skel root-channel 0))) + (set! (-> a0-22 frame-group) (the-as art-joint-anim (-> this draw art-group data 11))) + (set! (-> a0-22 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 11)) frames num-frames) -1)) + ) + (set! (-> a0-22 param 1) 1.0) + (set! (-> a0-22 frame-num) 0.0) + (joint-control-channel-group! a0-22 (the-as art-joint-anim (-> this draw art-group data 11)) num-func-seek!) + ) + #t + ) + ) + ) + ) + +;; definition for method 87 of type ashelin +(defmethod knocked-anim-handler ((this ashelin) (arg0 int) (arg1 enemy-knocked-info)) + (cond + ((= arg0 3) + (let ((s5-0 (ja-done? 0))) + (cond + ((and s5-0 (let ((v1-4 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (and v1-4 (or (= v1-4 (-> this draw art-group data 16)) + (= v1-4 (-> this draw art-group data 17)) + (= v1-4 (-> this draw art-group data 18)) + (= v1-4 (-> this draw art-group data 22)) + (= v1-4 (-> this draw art-group data 23)) + (= v1-4 (-> this draw art-group data 24)) + ) + ) + ) + ) + (ja-channel-push! 1 (seconds 0.03)) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 25))) + (set! (-> a0-21 param 0) + (the float (+ (-> (the-as art-joint-anim (-> this draw art-group data 25)) frames num-frames) -1)) + ) + (set! (-> a0-21 param 1) 1.0) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 25)) num-func-seek!) + ) + (set! s5-0 #f) + ) + (else + (let ((v1-25 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (cond + ((and v1-25 (= v1-25 (-> this draw art-group data 8))) + (let ((f0-4 (ja-aframe-num 0))) + (cond + ((>= f0-4 22.0) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-4 16.0) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) + (let* ((v1-42 *game-info*) + (a0-34 (+ (-> v1-42 attack-id) 1)) + ) + (set! (-> v1-42 attack-id) a0-34) + (set! (-> this attack-id) a0-34) + ) + ) + ) + ) + ) + ) + ((let ((v1-45 (if (> (-> this skel active-channels) 0) + (-> this skel root-channel 0 frame-group) + ) + ) + ) + (and v1-45 (= v1-45 (-> this draw art-group data 11))) + ) + (let ((f0-5 (ja-aframe-num 0))) + (cond + ((>= f0-5 32.0) + (when (focus-test? this dangerous) + (if (logtest? (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this focus-status) (focus-status dangerous)) + ) + ) + ) + ((>= f0-5 25.0) + (when (not (focus-test? this dangerous)) + (logior! (-> this focus-status) (focus-status dangerous)) + (let* ((v1-62 *game-info*) + (a0-47 (+ (-> v1-62 attack-id) 1)) + ) + (set! (-> v1-62 attack-id) a0-47) + (set! (-> this attack-id) a0-47) + ) + ) + ) + ) + ) + ) + ) + ) + (let ((a0-48 (-> this skel root-channel 0))) + (set! (-> a0-48 param 0) (the float (+ (-> a0-48 frame-group frames num-frames) -1))) + (set! (-> a0-48 param 1) (-> arg1 anim-speed)) + (joint-control-channel-group-eval! a0-48 (the-as art-joint-anim #f) num-func-seek!) + ) + ) + ) + s5-0 + ) + ) + (else + ((method-of-type bot knocked-anim-handler) this arg0 arg1) + ) + ) + ) + +;; definition for method 248 of type ashelin +;; INFO: Used lq/sq +(defmethod ashelin-method-248 ((this ashelin) (arg0 vector) (arg1 float) (arg2 float) (arg3 float) (arg4 float)) + (local-vars (v1-23 float) (sv-272 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let* ((v1-0 (-> this nav)) + (a0-3 (-> v1-0 state mesh sphere-hash sphere-array)) + (a1-1 (-> v1-0 sphere-id-array)) + (a2-2 (-> v1-0 state mesh bounds)) + (a3-1 (-> v1-0 root-nav-sphere)) + (t0-1 (-> v1-0 sphere-count)) + ) + (dotimes (t1-1 t0-1) + (let ((t3-0 (-> a0-3 (-> a1-1 t1-1))) + (t2-4 (-> v1-0 sphere-array t1-1)) + ) + (vector-! (the-as vector t2-4) (the-as vector t3-0) (the-as vector a2-2)) + (set! (-> t2-4 r) (+ (-> t3-0 r) (-> a3-1 w))) + ) + ) + ) + 0 + (let ((s0-0 (new 'stack-no-clear 'nav-avoid-spheres-params))) + (vector-! (-> s0-0 current-pos) (-> this root trans) (the-as vector (-> this nav state mesh bounds))) + (set! sv-272 (-> s0-0 travel)) + (set! (-> sv-272 x) (sin arg1)) + (set! (-> sv-272 y) 0.0) + (set! (-> sv-272 z) (cos arg1)) + (set! (-> sv-272 w) 1.0) + (vector-float*! (-> s0-0 travel) (-> s0-0 travel) arg3) + (set! (-> s0-0 pref-dir quad) (-> s0-0 travel quad)) + (avoid-spheres-1! (-> this nav) s0-0) + (set! (-> arg0 quad) (-> s0-0 out-travel 0 quad)) + ) + 0 + (when (>= arg2 (fabs (deg- arg1 (atan (-> arg0 x) (-> arg0 z))))) + (let ((t0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this root trans) (-> this nav state current-poly) arg0 t0-2) + ) + (.lvf vf1 (&-> arg0 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-23 vf1) + (let ((f0-11 v1-23) + (f1-1 arg4) + ) + (>= f0-11 (* f1-1 f1-1)) + ) + ) + ) + ) + +;; definition for method 160 of type ashelin +(defmethod normalize-heading! ((this ashelin) (arg0 nav-control)) + (if (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'back-spring) (= v1-3 'cartwheel-left) (= v1-3 'tumble-right)) + ) + ) + ) + ((method-of-type bot normalize-heading!) this arg0) + ) + (none) + ) + +;; definition for method 228 of type ashelin +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-228 ((this ashelin)) + (set! (-> this health-handle) + (ppointer->handle (process-spawn hud-ashelin :init hud-init-by-other :name "hud-ashelin" :to this)) + ) + 0 + (none) + ) + +;; definition for method 215 of type ashelin +(defmethod play-next-speech ((this ashelin)) + (local-vars (v1-3 int) (a3-0 int)) + (when (not (channel-active? this (gui-channel none))) + (let ((v1-2 0)) + (if (logtest? (penetrate jak-yellow-shot jak-red-shot jak-blue-shot jak-dark-shot) + (-> this incoming penetrate-using) + ) + (set! v1-3 (logior v1-2 128)) + (set! v1-3 (logior v1-2 64)) + ) + ) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (set! a3-0 (logior v1-3 256)) + (set! a3-0 (logior v1-3 512)) + ) + (let ((a1-3 (get-next-speech-idx + (-> this course attack-player-speeches) + this + (-> this course speeches) + (the-as bot-speech-info-flag a3-0) + ) + ) + ) + (if (>= a1-3 0) + (play-speech-by-id this a1-3) + ) + ) + ) + ) + +;; definition for method 255 of type ashelin +;; WARN: Return type mismatch gui-connection vs none. +(defmethod ashelin-method-255 ((this ashelin)) + (when (not (channel-active? this (gui-channel none))) + (let ((a1-2 + (get-next-speech-idx (-> this course ouch-speeches) this (-> this course speeches) (bot-speech-info-flag)) + ) + ) + (if (>= a1-2 0) + (play-speech-by-id this a1-2) + ) + ) + ) + (none) + ) + +;; definition for method 256 of type ashelin +;; WARN: Return type mismatch gui-connection vs none. +(defmethod ashelin-method-256 ((this ashelin)) + (when (and (not (channel-active? this (gui-channel none))) (>= (current-time) (-> this victory-speech-time))) + (let ((s5-0 + (get-next-speech-idx (-> this course victory-speeches) this (-> this course speeches) (bot-speech-info-flag)) + ) + ) + (when (>= s5-0 0) + (set! (-> this victory-speech-time) (+ (set-reaction-time! this (seconds 4) (seconds 7)) (current-time))) + (play-speech-by-id this s5-0) + ) + ) + ) + (none) + ) + +;; definition for method 147 of type ashelin +;; WARN: Return type mismatch enemy-flag vs none. +(defmethod check-victory ((this ashelin)) + (if (time-elapsed? (-> this hit-focus-time) (seconds 2)) + (logclear! (-> this enemy-flags) (enemy-flag victory)) + ) + (none) + ) + +;; definition for method 218 of type ashelin +;; WARN: Return type mismatch enemy-flag vs gui-connection. +(defmethod play-speech-by-id ((this ashelin) (arg0 int)) + (let ((t9-0 (method-of-type bot play-speech-by-id))) + (t9-0 this arg0) + ) + (let ((v0-1 (logclear (-> this enemy-flags) (enemy-flag victory)))) + (set! (-> this enemy-flags) v0-1) + (the-as gui-connection v0-1) + ) + ) + +;; definition for method 15 of type hud-ashelin +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-ashelin)) + (set-hud-piece-position! + (-> this sprites 2) + (the int (+ 30.0 (* -130.0 (-> this offset)))) + (the int (+ 30.0 (* -100.0 (-> this offset)))) + ) + (set! (-> this sprites 0 angle) (* 182.04445 (the float (- 270 (/ (* 90 (-> this values 0 current)) 100))))) + (set-as-offset-from! (the-as hud-sprite (-> this sprites)) (the-as vector4w (-> this sprites 2)) 40 16) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites 2)) 1 16) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites 2)) 8 2) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-ashelin +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-ashelin)) + (set! (-> this values 0 target) (the int (* 100.0 (-> *game-info* bot-health 0)))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-ashelin +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-ashelin)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-transparent-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 12.0) + (set! (-> this sprites 0 scale-y) 11.2) + (set! (-> this sprites 0 pos z) #xfffff2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-npcring-bar-01 level-default-minimap))) + (set! (-> this sprites 1 pos z) #xfffff0) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-npcring-01 level-default-minimap))) + (set! (-> this sprites 2 pos z) #xffffff) + (set! (-> this sprites 3 tid) + (the-as + texture-id + (lookup-texture-by-name "hud-ashlyn-head" (the-as string #f) (the-as (pointer texture-page) #f)) + ) + ) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.4) + (set! (-> this sprites 3 pos z) #xffffff) + 0 + (none) + ) diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc new file mode 100644 index 0000000000..1b3ffce678 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/bot-h_REF.gc @@ -0,0 +1,882 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type bot-focus-info +(deftype bot-focus-info (structure) + ((max-los-dist float) + (fproc process-focusable) + (bullseye-xz-dist float) + (ry-diff float) + (my-facing-ry float) + (bullseye-ry float) + (los int8) + (update-time time-frame) + (bullseye vector :inline) + (pos vector :inline) + (my-facing-xz-dir vector :inline) + (bullseye-xz-dir vector :inline) + ) + ) + +;; definition for method 3 of type bot-focus-info +(defmethod inspect ((this bot-focus-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bot-focus-info) + (format #t "~1Tmax-los-dist: ~f~%" (-> this max-los-dist)) + (format #t "~1Tfproc: ~A~%" (-> this fproc)) + (format #t "~1Tbullseye-xz-dist: ~f~%" (-> this bullseye-xz-dist)) + (format #t "~1Try-diff: ~f~%" (-> this ry-diff)) + (format #t "~1Tmy-facing-ry: ~f~%" (-> this my-facing-ry)) + (format #t "~1Tbullseye-ry: ~f~%" (-> this bullseye-ry)) + (format #t "~1Tlos: ~D~%" (-> this los)) + (format #t "~1Tupdate-time: ~D~%" (-> this update-time)) + (format #t "~1Tbullseye: #~%" (-> this bullseye)) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tmy-facing-xz-dir: #~%" (-> this my-facing-xz-dir)) + (format #t "~1Tbullseye-xz-dir: #~%" (-> this bullseye-xz-dir)) + (label cfg-4) + this + ) + +;; definition of type bot-turn-info +(deftype bot-turn-info (structure) + ((facing-ry float) + (targ-ry float) + (ry-diff float) + (predicted-ry-diff float) + (predicted-targ-ry float) + (facing-dir vector :inline) + (targ-pos vector :inline) + (predicted-targ-pos vector :inline) + (src-quat quaternion :inline) + ) + ) + +;; definition for method 3 of type bot-turn-info +(defmethod inspect ((this bot-turn-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bot-turn-info) + (format #t "~1Tfacing-ry: ~f~%" (-> this facing-ry)) + (format #t "~1Ttarg-ry: ~f~%" (-> this targ-ry)) + (format #t "~1Try-diff: ~f~%" (-> this ry-diff)) + (format #t "~1Tpredicted-ry-diff: ~f~%" (-> this predicted-ry-diff)) + (format #t "~1Tpredicted-targ-ry: ~f~%" (-> this predicted-targ-ry)) + (format #t "~1Tfacing-dir: #~%" (-> this facing-dir)) + (format #t "~1Ttarg-pos: #~%" (-> this targ-pos)) + (format #t "~1Tpredicted-targ-pos: #~%" (-> this predicted-targ-pos)) + (format #t "~1Tsrc-quat: #~%" (-> this src-quat)) + (label cfg-4) + this + ) + +;; definition of type bot-speech-tuning +(deftype bot-speech-tuning (structure) + ((fo-min int32) + (fo-max int32) + (fo-curve int8) + (trans? symbol) + ) + ) + +;; definition for method 3 of type bot-speech-tuning +(defmethod inspect ((this bot-speech-tuning)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bot-speech-tuning) + (format #t "~1Tfo-min: ~D~%" (-> this fo-min)) + (format #t "~1Tfo-max: ~D~%" (-> this fo-max)) + (format #t "~1Tfo-curve: ~D~%" (-> this fo-curve)) + (format #t "~1Ttrans?: ~A~%" (-> this trans?)) + (label cfg-4) + this + ) + +;; definition of type bot-speech-info +(deftype bot-speech-info (structure) + ((flags bot-speech-info-flag) + (hold-time uint16) + (slave-id int8) + (tuning-id int8) + (name string) + ) + ) + +;; definition for method 3 of type bot-speech-info +(defmethod inspect ((this bot-speech-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bot-speech-info) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Thold-time: ~D~%" (-> this hold-time)) + (format #t "~1Tslave-id: ~D~%" (-> this slave-id)) + (format #t "~1Ttuning-id: ~D~%" (-> this tuning-id)) + (format #t "~1Tname: ~A~%" (-> this name)) + (label cfg-4) + this + ) + +;; definition of type bot-spot +(deftype bot-spot (structure) + ((center vector :inline) + (center-x float :overlay-at (-> center data 0)) + (center-y float :overlay-at (-> center data 1)) + (center-z float :overlay-at (-> center data 2)) + (inside-xz-dist float :overlay-at (-> center data 3)) + (blocked-xz-dist float) + ) + ) + +;; definition for method 3 of type bot-spot +(defmethod inspect ((this bot-spot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bot-spot) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tcenter-x: ~f~%" (-> this center x)) + (format #t "~1Tcenter-y: ~f~%" (-> this center y)) + (format #t "~1Tcenter-z: ~f~%" (-> this center z)) + (format #t "~1Tinside-xz-dist: ~f~%" (-> this center w)) + (format #t "~1Tblocked-xz-dist: ~f~%" (-> this blocked-xz-dist)) + (label cfg-4) + this + ) + +;; definition of type bot-waypoint +(deftype bot-waypoint (basic) + ((waypoint-id int16) + (nav-mesh-index int8) + (skip-to int8) + (on-set (function bot object)) + (on-update (function bot object)) + (on-skipping-here (function bot object)) + (check-too-far symbol) + (warn-dist float) + (fail-dist-delta float) + ) + ) + +;; definition for method 3 of type bot-waypoint +(defmethod inspect ((this bot-waypoint)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Twaypoint-id: ~D~%" (-> this waypoint-id)) + (format #t "~1Tnav-mesh-index: ~D~%" (-> this nav-mesh-index)) + (format #t "~1Tskip-to: ~D~%" (-> this skip-to)) + (format #t "~1Ton-set: ~A~%" (-> this on-set)) + (format #t "~1Ton-update: ~A~%" (-> this on-update)) + (format #t "~1Ton-skipping-here: ~A~%" (-> this on-skipping-here)) + (format #t "~1Tcheck-too-far: ~A~%" (-> this check-too-far)) + (format #t "~1Twarn-dist: ~f~%" (-> this warn-dist)) + (format #t "~1Tfail-dist-delta: ~f~%" (-> this fail-dist-delta)) + (label cfg-4) + this + ) + +;; definition of type bot-course +(deftype bot-course (basic) + ((course-id uint8) + (speech-count uint16) + (spot-count uint16) + (retry-cookie uint8) + (too-far-warn-speeches bot-speech-list-shuffle) + (too-far-fail-speeches bot-speech-list) + (attack-player-speeches bot-speech-list) + (default-check-too-far symbol) + (waypoints (array bot-waypoint)) + (speeches (inline-array bot-speech-info)) + (speech-tunings (inline-array bot-speech-tuning)) + (dirs (inline-array vector)) + (spots (inline-array bot-spot)) + ) + ) + +;; definition for method 3 of type bot-course +(defmethod inspect ((this bot-course)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse-id: ~D~%" (-> this course-id)) + (format #t "~1Tspeech-count: ~D~%" (-> this speech-count)) + (format #t "~1Tspot-count: ~D~%" (-> this spot-count)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Ttoo-far-warn-speeches: ~A~%" (-> this too-far-warn-speeches)) + (format #t "~1Ttoo-far-fail-speeches: ~A~%" (-> this too-far-fail-speeches)) + (format #t "~1Tattack-player-speeches: ~A~%" (-> this attack-player-speeches)) + (format #t "~1Tdefault-check-too-far: ~A~%" (-> this default-check-too-far)) + (format #t "~1Twaypoints: ~A~%" (-> this waypoints)) + (format #t "~1Tspeeches: #x~X~%" (-> this speeches)) + (format #t "~1Tspeech-tunings: #x~X~%" (-> this speech-tunings)) + (format #t "~1Tdirs: #x~X~%" (-> this dirs)) + (format #t "~1Tspots: #x~X~%" (-> this spots)) + (label cfg-4) + this + ) + +;; definition of type bot +(deftype bot (nav-enemy) + ((bot-flags bot-flag) + (min-speed float) + (max-speed float) + (follow-offset float) + (too-far-warn-dist float) + (too-far-fail-dist-delta float) + (too-far-warn-dist-default float) + (too-far-fail-dist-delta-default float) + (travel-prev-ry float) + (travel-prev-ry1 float) + (player-blocking float) + (ai-ctrl ai-task-control) + (course bot-course) + (waypoint bot-waypoint) + (waypoint-bits waypoint-bits) + (waypoint-int32a waypoint-bits-s32) + (bot-task-bits bot-task-bits) + (hit-invuln-ignore-me-delay uint32) + (hit-invuln-focus-disable-delay uint32) + (warn-to-fail-timeout uint32) + (warn-min-delay uint32) + (warn-max-delay uint32) + (spot-color uint32) + (waypoint-request int16) + (hit-by-enemy-count uint16) + (hit-by-player-count uint16) + (notice-enemy-dist float) + (channel gui-channel) + (focus-mode int8) + (nav-mesh-index int8) + (delay-too-far-check int8) + (slave-id int8) + (vehicle-seat-index int8) + (bot-health-index int8) + (task game-task-control) + (task-node game-task-node-info) + (swivel-joint-mod joint-mod) + (health-handle handle) + (poi-handle handle) + (my-simple-focus (pointer simple-focus)) + (attacker-handle handle) + (scene-player-handle handle) + (master-handle handle) + (vehicle-handle handle) + (hit-invuln-starting-time time-frame) + (danger-time time-frame) + (attacker-time time-frame) + (started-warning-time time-frame) + (waypoint-time0 time-frame) + (next-too-far-warn-time time-frame) + (spot bot-spot :inline) + (follow-dir vector :inline) + (focus-info bot-focus-info :inline) + ) + (:state-methods + failed + hidden + ) + (:methods + (clear-poi (_type_) none) + (bot-method-193 (_type_ vector vector vector vector vector float) none) + (bot-method-194 (_type_ bot-turn-info process-focusable float) float) + (alive? (_type_) symbol) + (bot-method-196 (_type_) none) + (debug-draw-spot (_type_ bot-spot rgba) symbol) + (bot-method-198 (_type_ int (pointer uint8) int) symbol) + (bot-method-199 (_type_) none) + (scene-stop (_type_) symbol) + (bot-method-201 (_type_) process) + (bot-method-202 (_type_) symbol) + (bot-method-203 (_type_) none) + (bot-method-204 (_type_) none) + (bot-method-205 (_type_) symbol) + (outside-spot-radius? (_type_ bot-spot vector symbol) symbol) + (attacked-by-player? (_type_ process-focusable) object) + (set-fail-flag (_type_) none) + (bot-method-209 (_type_) none) + (set-cam-height (_type_ vector) float) + (cam-move-to-bot (_type_) none) + (bot-method-212 (_type_) none) + (set-next-focus! (_type_ enemy enemy-best-focus) enemy) + (choose-spot (_type_ int (pointer uint8)) int) + (play-next-speech (_type_) gui-connection) + (bot-method-216 (_type_) none) + (scene-play (_type_ scene symbol) symbol) + (play-speech-by-id (_type_ int) gui-connection) + (play-speech-by-name (_type_ string) sound-id) + (bot-method-220 (_type_) symbol) + (channel-active? (_type_ gui-channel) symbol) + (init-fields! (_type_) none) + (bot-method-223 (_type_) none) + (reset-warn-time (_type_) none) + (go-to-waypoint! (_type_ int symbol) object) + (bot-method-226 (_type_) object) + (skip-waypoint (_type_) object) + (bot-method-228 (_type_) none) + (course-speech-ended? (_type_ int) symbol) + (course-speech-playing? (_type_ int) symbol) + (player-blocking-spot? (_type_ bot-spot) symbol) + (bot-method-232 (_type_ gui-channel symbol) int) + (bot-method-233 (_type_) quaternion) + (bot-method-234 (_type_ vector) none) + (bot-method-235 (_type_ symbol) none) + (bot-check-too-far (_type_) symbol) + ) + ) + +;; definition for method 3 of type bot +(defmethod inspect ((this bot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tbot-flags: ~D~%" (-> this bot-flags)) + (format #t "~2Tmin-speed: ~f~%" (-> this min-speed)) + (format #t "~2Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~2Tfollow-offset: ~f~%" (-> this follow-offset)) + (format #t "~2Ttoo-far-warn-dist: ~f~%" (-> this too-far-warn-dist)) + (format #t "~2Ttoo-far-fail-dist-delta: ~f~%" (-> this too-far-fail-dist-delta)) + (format #t "~2Ttoo-far-warn-dist-default: ~f~%" (-> this too-far-warn-dist-default)) + (format #t "~2Ttoo-far-fail-dist-delta-default: ~f~%" (-> this too-far-fail-dist-delta-default)) + (format #t "~2Ttravel-prev-ry: ~f~%" (-> this travel-prev-ry)) + (format #t "~2Ttravel-prev-ry1: ~f~%" (-> this travel-prev-ry1)) + (format #t "~2Tplayer-blocking: ~f~%" (-> this player-blocking)) + (format #t "~2Tai-ctrl: ~A~%" (-> this ai-ctrl)) + (format #t "~2Tcourse: ~A~%" (-> this course)) + (format #t "~2Twaypoint: ~A~%" (-> this waypoint)) + (format #t "~2Twaypoint-bits: ~D~%" (-> this waypoint-bits)) + (format #t "~2Twaypoint-int32a: ~D~%" (-> this waypoint-int32a)) + (format #t "~2Tbot-task-bits: ~D~%" (-> this bot-task-bits)) + (format #t "~2Thit-invuln-ignore-me-delay: ~D~%" (-> this hit-invuln-ignore-me-delay)) + (format #t "~2Thit-invuln-focus-disable-delay: ~D~%" (-> this hit-invuln-focus-disable-delay)) + (format #t "~2Twarn-to-fail-timeout: ~D~%" (-> this warn-to-fail-timeout)) + (format #t "~2Twarn-min-delay: ~D~%" (-> this warn-min-delay)) + (format #t "~2Twarn-max-delay: ~D~%" (-> this warn-max-delay)) + (format #t "~2Tspot-color: ~D~%" (-> this spot-color)) + (format #t "~2Twaypoint-request: ~D~%" (-> this waypoint-request)) + (format #t "~2Thit-by-enemy-count: ~D~%" (-> this hit-by-enemy-count)) + (format #t "~2Thit-by-player-count: ~D~%" (-> this hit-by-player-count)) + (format #t "~2Tnotice-enemy-dist: ~f~%" (-> this notice-enemy-dist)) + (format #t "~2Tchannel: ~D~%" (-> this channel)) + (format #t "~2Tfocus-mode: ~D~%" (-> this focus-mode)) + (format #t "~2Tnav-mesh-index: ~D~%" (-> this nav-mesh-index)) + (format #t "~2Tdelay-too-far-check: ~D~%" (-> this delay-too-far-check)) + (format #t "~2Tslave-id: ~D~%" (-> this slave-id)) + (format #t "~2Tvehicle-seat-index: ~D~%" (-> this vehicle-seat-index)) + (format #t "~2Tbot-health-index: ~D~%" (-> this bot-health-index)) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Ttask-node: ~A~%" (-> this task-node)) + (format #t "~2Tswivel-joint-mod: ~A~%" (-> this swivel-joint-mod)) + (format #t "~2Thealth-handle: ~D~%" (-> this health-handle)) + (format #t "~2Tpoi-handle: ~D~%" (-> this poi-handle)) + (format #t "~2Tmy-simple-focus: #x~X~%" (-> this my-simple-focus)) + (format #t "~2Tattacker-handle: ~D~%" (-> this attacker-handle)) + (format #t "~2Tscene-player-handle: ~D~%" (-> this scene-player-handle)) + (format #t "~2Tmaster-handle: ~D~%" (-> this master-handle)) + (format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle)) + (format #t "~2Thit-invuln-starting-time: ~D~%" (-> this hit-invuln-starting-time)) + (format #t "~2Tdanger-time: ~D~%" (-> this danger-time)) + (format #t "~2Tattacker-time: ~D~%" (-> this attacker-time)) + (format #t "~2Tstarted-warning-time: ~D~%" (-> this started-warning-time)) + (format #t "~2Twaypoint-time0: ~D~%" (-> this waypoint-time0)) + (format #t "~2Tnext-too-far-warn-time: ~D~%" (-> this next-too-far-warn-time)) + (format #t "~2Tspot: #~%" (-> this spot)) + (format #t "~2Tfollow-dir: #~%" (-> this follow-dir)) + (format #t "~2Tfocus-info: #~%" (-> this focus-info)) + (label cfg-4) + this + ) + +;; definition for symbol *bot-task-pool*, type ai-task-pool +(define *bot-task-pool* (new 'static 'ai-task-pool + :anchor #f + :tasks (new 'static 'array uint32 240 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + #x0 + ) + :tasks-length #x14 + ) + ) + +;; failed to figure out what this is: +(ai-task-pool-method-11 *bot-task-pool*) + +;; definition of type bot-speech-list +(deftype bot-speech-list (basic) + ((flags bot-speech-list-flag) + (retry-cookie uint8) + (last-local-index int16) + (speech-indexes (array int16)) + ) + (:methods + (get-next-speech-idx (_type_ bot (inline-array bot-speech-info) bot-speech-info-flag) int) + (reset-index (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type bot-speech-list +(defmethod inspect ((this bot-speech-list)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Tlast-local-index: ~D~%" (-> this last-local-index)) + (format #t "~1Tspeech-indexes: ~A~%" (-> this speech-indexes)) + (label cfg-4) + this + ) + +;; definition for method 10 of type bot-speech-list +;; WARN: Return type mismatch int vs none. +(defmethod reset-index ((this bot-speech-list) (arg0 symbol)) + (if arg0 + (logclear! (-> this flags) (bot-speech-list-flag bsl0)) + ) + (set! (-> this last-local-index) -1) + (none) + ) + +;; definition for method 9 of type bot-speech-list +;; WARN: new jak 2 until loop case, check carefully +(defmethod get-next-speech-idx ((this bot-speech-list) (arg0 bot) (arg1 (inline-array bot-speech-info)) (arg2 bot-speech-info-flag)) + (let ((v1-1 (-> arg0 course retry-cookie))) + (when (!= v1-1 (-> this retry-cookie)) + (set! (-> this retry-cookie) (-> arg0 course retry-cookie)) + (reset-index this #t) + ) + ) + (let ((s2-0 (-> this speech-indexes)) + (s1-0 (-> this last-local-index)) + ) + (when (< s1-0 0) + (when (not (logtest? (-> this flags) (bot-speech-list-flag bsl0))) + (logior! (-> this flags) (bot-speech-list-flag bsl0)) + (set! arg2 (logior arg2 (bot-speech-info-flag sf02))) + ) + (reset-index this #f) + (if (logtest? (-> this flags) (bot-speech-list-flag bsl2)) + (set! s1-0 (+ (rnd-int arg0 (-> s2-0 length)) -1)) + (set! s1-0 -1) + ) + ) + (until #f + (when (>= s1-0 (+ (-> s2-0 length) -1)) + (if (not (logtest? (-> this flags) (bot-speech-list-flag bsl1))) + (goto cfg-23) + ) + (reset-index this #f) + (set! s1-0 -1) + ) + (+! s1-0 1) + (let* ((s0-0 (-> s2-0 s1-0)) + (v1-37 (-> arg1 s0-0 flags)) + ) + (when (and (not (logtest? arg2 v1-37)) + (or (not (logtest? v1-37 (bot-speech-info-flag sf11))) (not (course-speech-playing? arg0 s0-0))) + ) + (set! (-> this last-local-index) s1-0) + (return s0-0) + ) + ) + ) + ) + #f + (label cfg-23) + -1 + ) + +;; definition of type bot-speech-list-shuffle +(deftype bot-speech-list-shuffle (bot-speech-list) + ((history-mask uint64) + (history-mask-full uint64) + ) + ) + +;; definition for method 3 of type bot-speech-list-shuffle +(defmethod inspect ((this bot-speech-list-shuffle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tretry-cookie: ~D~%" (-> this retry-cookie)) + (format #t "~1Tlast-local-index: ~D~%" (-> this last-local-index)) + (format #t "~1Tspeech-indexes: ~A~%" (-> this speech-indexes)) + (format #t "~1Thistory-mask: ~D~%" (-> this history-mask)) + (format #t "~1Thistory-mask-full: ~D~%" (-> this history-mask-full)) + (label cfg-4) + this + ) + +;; definition for method 10 of type bot-speech-list-shuffle +;; WARN: Return type mismatch int vs none. +(defmethod reset-index ((this bot-speech-list-shuffle) (arg0 symbol)) + (let ((t9-0 (method-of-type bot-speech-list reset-index))) + (t9-0 this arg0) + ) + (set! (-> this history-mask) (the-as uint 0)) + (when (zero? (-> this history-mask-full)) + (let ((v0-2 0)) + (let ((v1-2 1)) + (countdown (a0-3 (-> this speech-indexes length)) + (set! v0-2 (logior v0-2 v1-2)) + (set! v1-2 (* v1-2 2)) + ) + ) + (set! (-> this history-mask-full) (the-as uint v0-2)) + ) + ) + (none) + ) + +;; definition for method 9 of type bot-speech-list-shuffle +;; 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: new jak 2 until loop case, check carefully +(defmethod get-next-speech-idx ((this bot-speech-list-shuffle) (arg0 bot) (arg1 (inline-array bot-speech-info)) (arg2 bot-speech-info-flag)) + (local-vars (sv-16 int)) + (let ((v1-1 (-> arg0 course retry-cookie))) + (when (!= v1-1 (-> this retry-cookie)) + (set! (-> this retry-cookie) (-> arg0 course retry-cookie)) + (reset-index this #t) + ) + ) + (set! sv-16 (-> this last-local-index)) + (when (< sv-16 0) + (when (not (logtest? (-> this flags) (bot-speech-list-flag bsl0))) + (logior! (-> this flags) (bot-speech-list-flag bsl0)) + (set! arg2 (logior arg2 (bot-speech-info-flag sf02))) + ) + (reset-index this #f) + ) + (let ((s2-0 0)) + (if (>= sv-16 0) + (set! s2-0 (ash 1 sv-16)) + ) + (if (logtest? (-> this flags) (bot-speech-list-flag bsl3)) + (set! s2-0 (logior s2-0 (-> this history-mask))) + ) + (until #f + (when (and (= s2-0 (-> this history-mask-full)) (logtest? (-> this flags) (bot-speech-list-flag bsl3))) + (if (not (logtest? (-> this flags) (bot-speech-list-flag bsl1))) + (return -1) + ) + (reset-index this #f) + (if (>= sv-16 0) + (set! s2-0 (ash 1 sv-16)) + (set! s2-0 0) + ) + ) + (let* ((s1-0 (enemy-method-131 arg0 (-> this speech-indexes length) s2-0)) + (s0-0 (-> this speech-indexes s1-0)) + (v1-47 (-> arg1 s0-0 flags)) + ) + (set! s2-0 (logior s2-0 (ash 1 s1-0))) + (when (and (not (logtest? arg2 v1-47)) + (or (not (logtest? v1-47 (bot-speech-info-flag sf11))) (not (course-speech-playing? arg0 s0-0))) + ) + (set! (-> this last-local-index) s1-0) + (logior! (-> this history-mask) (ash 1 s1-0)) + (return s0-0) + ) + ) + ) + ) + #f + -1 + ) + +;; definition of type bot-course-table +(deftype bot-course-table (basic) + ((course bot-course 1) + ) + ) + +;; definition for method 3 of type bot-course-table +(defmethod inspect ((this bot-course-table)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcourse[1] @ #x~X~%" (-> this course)) + (label cfg-4) + this + ) + +;; definition for symbol *bot-course-table*, type bot-course-table +(define *bot-course-table* (new 'static 'bot-course-table)) diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc new file mode 100644 index 0000000000..3f45cddb33 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/bot-states_REF.gc @@ -0,0 +1,302 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defstate hit (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) enter))) + (if t9-0 + (t9-0) + ) + ) + (bot-method-232 self (gui-channel none) #t) + (bot-method-203 self) + (logclear! (-> self bot-flags) (bot-flag bf11)) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hit) exit))) + (if t9-0 + (t9-0) + ) + ) + (logior! (-> self bot-flags) (bot-flag bf11)) + ) + :code (behavior () + (local-vars (v1-37 enemy-flag) (v1-39 enemy-flag) (v1-41 enemy-flag)) + (ja-channel-push! 1 (seconds 0.2)) + (let ((f30-0 (rnd-float-range self 0.9 1.1))) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info hit-anim)) + :num! (seek! max f30-0) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-36 (-> self enemy-flags))) + (if (logtest? v1-36 (enemy-flag vulnerable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag vulnerable))) + (set! v1-37 (logclear v1-36 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? v1-38 (enemy-flag attackable-backup)) + (set! v1-39 (logior v1-38 (enemy-flag attackable))) + (set! v1-39 (logclear v1-38 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (let ((v1-40 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-40) + (set! v1-41 (logior (enemy-flag trackable) v1-40)) + (set! v1-41 (logclear v1-40 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-41) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (bot) + :virtual #t + :enter (behavior () + (logclear! (-> self enemy-flags) (enemy-flag victory)) + (bot-method-232 self (gui-channel none) #t) + (if (and (logtest? (-> self bot-flags) (bot-flag attacked)) + (and (!= (-> self hit-points) 0.0) (zero? (-> self fated-time))) + ) + (logior! (-> self bot-flags) (bot-flag bf12)) + ) + (bot-method-203 self) + (when (= (-> self hit-points) 0.0) + (set! (-> self hit-points) 1.0) + (set-time! (-> self fated-time)) + ) + (logclear! (-> self bot-flags) (bot-flag bf11)) + (let ((t9-2 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + :exit (behavior () + (let ((gp-0 (-> self incoming attack-id))) + (let ((t9-0 (-> (method-of-type nav-enemy knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self incoming attack-id) gp-0) + ) + (logior! (-> self bot-flags) (bot-flag bf11)) + (logclear! (-> self bot-flags) (bot-flag bf12)) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (and (logtest? (-> self bot-flags) (bot-flag bf12)) (!= (-> self state-time) (current-time))) + (logclear! (-> self bot-flags) (bot-flag bf12)) + (play-next-speech self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die-falling (bot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) enter))) + (if t9-0 + (t9-0) + ) + ) + (kill-nearby-enemies (-> self root trans) 61440.0) + (bot-method-232 self (gui-channel none) #f) + (logclear! (-> self bot-flags) (bot-flag bf06 bf11)) + (set! (-> self delay-too-far-check) -1) + (logior! (-> self root nav-flags) (nav-flags has-root-sphere)) + (bot-method-209 self) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flag bf11)) + (logclear! (-> self bot-flags) (bot-flag bf13 bf14)) + (let ((t9-0 (-> (method-of-type nav-enemy die-falling) exit))) + (if t9-0 + (t9-0) + ) + ) + ) + :trans (behavior () + (bot-method-212 self) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((gp-0 (-> self draw art-group data (if (falling? self) + (-> self enemy-info die-falling-anim) + (-> self enemy-info die-anim) + ) + ) + ) + (f30-0 (rnd-float-range self 0.8 1.2)) + ) + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + (until (not (channel-active? self (gui-channel none))) + (suspend) + ) + (until #f + (when (logtest? (-> self bot-flags) (bot-flag failed)) + (let ((a0-10 (res-lump-struct (-> self entity) 'task-name structure))) + (when a0-10 + (let ((gp-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> gp-1 from) (process->ppointer self)) + (set! (-> gp-1 num-params) 0) + (set! (-> gp-1 message) 'fail) + (let ((s5-0 send-event-function) + (v1-35 (-> *game-info* sub-task-list (task-node-index-by-name (the-as string a0-10)))) + ) + (s5-0 + (handle->process (if (-> v1-35 manager) + (-> v1-35 manager manager) + (the-as handle #f) + ) + ) + gp-1 + ) + ) + ) + ) + ) + ) + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate failed (bot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + ((-> (method-of-type bot die-falling) enter)) + (logclear! (-> self bot-flags) (bot-flag bf11)) + (when (logtest? (-> self bot-flags) (bot-flag failed)) + (let ((a0-1 (-> self course too-far-fail-speeches))) + (when (and (nonzero? a0-1) a0-1) + (let ((a1-1 (get-next-speech-idx a0-1 self (-> self course speeches) (bot-speech-info-flag)))) + (if (>= a1-1 0) + (play-speech-by-id self a1-1) + ) + ) + ) + ) + ) + ) + :exit (behavior () + (logior! (-> self bot-flags) (bot-flag bf11)) + ) + :trans (behavior () + ((-> (method-of-type bot die-falling) trans)) + (if (channel-active? self (gui-channel none)) + (set-time! (-> self state-time)) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (let ((f30-0 (rnd-float-range self 0.9 1.1)) + (gp-0 (-> self draw art-group data (-> self enemy-info idle-anim))) + ) + (until #f + (ja-no-eval :group! gp-0 :num! (seek! max f30-0) :frame-num 0.0) + (until (ja-done? 0) + (when (and (logtest? (-> self bot-flags) (bot-flag failed)) (time-elapsed? (-> self state-time) (seconds 0.5)) #f) + (cleanup-for-death self) + (process-entity-status! self (entity-perm-status no-kill) #f) + (let ((a0-10 (res-lump-struct (-> self entity) 'task-name string))) + (when a0-10 + (let ((s5-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> s5-0 from) (process->ppointer self)) + (set! (-> s5-0 num-params) 0) + (set! (-> s5-0 message) 'fail) + (let ((s4-0 send-event-function) + (v1-27 (-> *game-info* sub-task-list (task-node-index-by-name a0-10))) + ) + (s4-0 + (handle->process (if (-> v1-27 manager) + (-> v1-27 manager manager) + (the-as handle #f) + ) + ) + s5-0 + ) + ) + ) + ) + ) + ) + (suspend) + (ja :num! (seek! max f30-0)) + ) + ) + ) + #f + ) + :post nav-enemy-die-falling-post + ) + +;; failed to figure out what this is: +(defstate hidden (bot) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status disable)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self notice-enemy-dist) 0.0) + (logclear! (-> self enemy-flags) (enemy-flag check-water)) + ) + :exit (behavior () + (local-vars (v0-0 enemy-flag)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + (logclear! (-> self focus-status) (focus-status disable)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-5 prim-core collide-with) (-> self root backup-collide-with)) + ) + (let ((v1-6 (-> self enemy-flags))) + (if (logtest? (enemy-flag check-water-backup) v1-6) + (set! v0-0 (logior (enemy-flag check-water) v1-6)) + (set! v0-0 (logclear v1-6 (enemy-flag check-water))) + ) + ) + (set! (-> self enemy-flags) v0-0) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc b/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc new file mode 100644 index 0000000000..ff676f5b8d --- /dev/null +++ b/test/decompiler/reference/jak3/levels/common/ai/bot_REF.gc @@ -0,0 +1,1999 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 12 of type bot +(defmethod run-logic? ((this bot)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 197 of type bot +(defmethod debug-draw-spot ((this bot) (arg0 bot-spot) (arg1 rgba)) + (add-debug-sphere #t (bucket-id debug) (-> arg0 center) (-> arg0 center w) arg1) + ) + +;; definition for method 198 of type bot +(defmethod bot-method-198 ((this bot) (arg0 int) (arg1 (pointer uint8)) (arg2 int)) + (let* ((s2-0 (-> this spot-color)) + (s1-0 s2-0) + ) + (if (>= arg2 0) + (set! s1-0 (logior (logand (the-as uint #xffffff) s2-0) + (shl (the-as uint (the int (* 0.375 (the float (logand (shr s2-0 24) 255))))) 24) + ) + ) + ) + (dotimes (s0-0 arg0) + (let* ((v1-5 (-> arg1 s0-0)) + (a1-2 (-> this course spots v1-5)) + ) + (debug-draw-spot this a1-2 (if (= v1-5 arg2) + (the-as rgba s2-0) + (the-as rgba s1-0) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 196 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-196 ((this bot)) + (let ((s5-0 (-> this course))) + (countdown (s4-0 (-> s5-0 spot-count)) + (let ((s3-0 (-> s5-0 spots s4-0))) + (debug-draw-spot this s3-0 (the-as rgba (-> this spot-color))) + (format (clear *temp-string*) "~d" s4-0) + (let ((a2-2 *temp-string*)) + (add-debug-text-3d + #t + (bucket-id debug-no-zbuf1) + a2-2 + (-> s3-0 center) + (font-color white) + (the-as vector2h #f) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 206 of type bot +(defmethod outside-spot-radius? ((this bot) (arg0 bot-spot) (arg1 vector) (arg2 symbol)) + (if (not arg0) + (set! arg0 (-> this spot)) + ) + (if (not arg1) + (set! arg1 (-> this root trans)) + ) + (let ((f0-0 (vector-vector-xz-distance (-> arg0 center) arg1))) + (if arg2 + (set! f0-0 (+ 819.2 f0-0)) + ) + (>= (-> arg0 center w) f0-0) + ) + ) + +;; definition for method 231 of type bot +(defmethod player-blocking-spot? ((this bot) (arg0 bot-spot)) + (let ((f0-0 (-> arg0 blocked-xz-dist))) + (and (!= f0-0 0.0) (>= (* f0-0 f0-0) (vector-vector-xz-distance-squared (target-pos 0) (-> arg0 center)))) + ) + ) + +;; definition for method 214 of type bot +(defmethod choose-spot ((this bot) (arg0 int) (arg1 (pointer uint8))) + (let ((gp-0 0)) + (let ((f30-0 -1.0) + (s3-0 (-> this root trans)) + ) + (countdown (s2-0 arg0) + (let ((s1-0 (-> this course spots (-> arg1 s2-0)))) + (when (not (player-blocking-spot? this s1-0)) + (let ((f0-0 (vector-vector-xz-distance s3-0 (-> s1-0 center)))) + (when (or (< f30-0 0.0) (< f0-0 f30-0)) + (set! f30-0 f0-0) + (set! gp-0 s2-0) + ) + ) + ) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 114 of type bot +(defmethod send-attack-to-all-tshapes ((this bot) (arg0 process-focusable) (arg1 event-message-block)) + 0 + ) + +;; definition for method 199 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-199 ((this bot)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) + (v1-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if (and v1-5 (= (-> v1-5 type) target)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + (none) + ) + +;; definition for method 205 of type bot +(defmethod bot-method-205 ((this bot)) + (let ((gp-0 #f)) + (let ((v1-0 (-> this incoming penetrate-using))) + (cond + ((logtest? (penetrate jak-red-shot) v1-0) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s3-0 (-> *target* gun fire-dir-out)) + ) + (vector-! s5-0 (-> this root trans) (target-pos 0)) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (if (or (< 28672.0 (vector-vector-xz-distance (-> this root trans) (target-pos 0))) + (< (vector-dot s3-0 s5-0) (cos 3640.889)) + ) + (set! gp-0 #t) + ) + ) + ) + ) + ((and (logtest? (penetrate dark-skin) v1-0) (not (logtest? (penetrate dark-punch) v1-0))) + (set! gp-0 #t) + ) + ) + ) + gp-0 + ) + ) + +;; definition for method 202 of type bot +;; INFO: Used lq/sq +(defmethod bot-method-202 ((this bot)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (cond + ((< 0.0 (-> this notice-enemy-dist)) + (let ((s5-0 (new 'stack-no-clear 'connection-pers)) + (cspec (collide-spec enemy hit-by-others-list)) + ) + (set! (-> (the-as sphere (-> s5-0 param)) quad) (-> this root trans quad)) + (set! (-> s5-0 param 3) (-> this notice-enemy-dist)) + (set! (-> s5-0 next) #f) + (set! (-> s5-0 key) 409600000.0) + (set! (-> s5-0 update-time) 0) + (set! *actor-list-length* 0) + (if (logtest? (the-as int cspec) (collide-spec hit-by-others-list)) + (set! *actor-list-length* + (fill-actor-list-for-box *actor-hash* (the-as vector (-> s5-0 param)) *actor-list* 256) + ) + ) + (when (logtest? (the-as int cspec) (collide-spec player-list)) + (let ((a0-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-13 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-1 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as int cspec) (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-1) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-3 a2-5) + (f1-2 (+ (-> a1-2 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-3 (* f1-2 f1-2)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-13) + *collide-player-list* + (set! v1-13 (-> v1-13 next0)) + ) + ) + ) + ) + (when (logtest? (the-as int cspec) (collide-spec hit-by-player-list)) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-21 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as int cspec) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (the-as object (-> s5-0 param))) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> (the-as sphere a3-2) quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-4 a2-12) + (f1-6 (+ (-> a1-14 world-sphere w) (the-as float (-> s5-0 param 3)))) + ) + (when (< f0-4 (* f1-6 f1-6)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-21) + *collide-hit-by-player-list* + (set! v1-21 (-> v1-21 next0)) + ) + ) + ) + ) + (dotimes (s3-0 *actor-list-length*) + (let ((v1-26 (-> *actor-list* s3-0))) + (when (logtest? (the-as int cspec) (-> v1-26 root-prim prim-core collide-as)) + (let* ((s2-0 (-> v1-26 process)) + (a1-26 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (when a1-26 + (set-next-focus! this (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next))) + (if (-> s5-0 next) + (return #t) + ) + ) + ) + ) + ) + ) + ) + #f + ) + (else + #f + ) + ) + ) + ) + +;; definition for method 112 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod get-incoming-attack! ((this bot) + (arg0 process-drawable) + (arg1 event-message-block) + (arg2 penetrate) + (arg3 attack-info) + (arg4 touching-shapes-entry) + ) + (let ((t9-0 (method-of-type nav-enemy get-incoming-attack!))) + (t9-0 this arg0 arg1 arg2 arg3 arg4) + ) + (logclear! (-> this bot-flags) (bot-flag bf03 bf04)) + (let* ((s3-0 (handle->process (-> this incoming attacker-handle))) + (s5-0 (if (type? s3-0 process-focusable) + s3-0 + ) + ) + ) + (when s5-0 + (cond + ((= (-> s5-0 type) target) + (logior! (-> this bot-flags) (bot-flag bf04)) + (cond + ((bot-method-205 this) + (logior! (-> this bot-flags) (bot-flag bf03)) + ) + (else + (+! (-> this hit-by-player-count) 1) + (when (not (bot-method-202 this)) + (logior! (-> this bot-flags) (bot-flag attacked)) + (cond + ((attacked-by-player? this (the-as process-focusable s5-0)) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) + ) + (else + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + ) + ) + ) + ) + ((type? s5-0 enemy) + (+! (-> this hit-by-enemy-count) 1) + (when (attacked-by-player? this (the-as process-focusable s5-0)) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (bot-method-199 this) + ) + (set! (-> this attacker-handle) (process->handle s5-0)) + (set-time! (-> this attacker-time)) + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 62 of type bot +(defmethod get-damage-from-attack ((this bot) (arg0 object) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type nav-enemy get-damage-from-attack)) + (v0-0 (t9-0 this arg0 arg1)) + (v1-1 (-> this bot-flags)) + ) + (cond + ((logtest? v1-1 (bot-flag bf03 too-far-fail bf09)) + 0.0 + ) + ((logtest? v1-1 (bot-flag bf10)) + (-> this hit-points) + ) + (else + (if (and (logtest? (-> this bot-flags) (bot-flag bf04)) (not (logtest? (-> this bot-flags) (bot-flag attacked)))) + (set! v0-0 0.0) + ) + v0-0 + ) + ) + ) + ) + +;; definition for method 65 of type bot +(defmethod penetrate->next-state ((this bot)) + (let* ((t9-0 (method-of-type nav-enemy penetrate->next-state)) + (v0-0 (t9-0 this)) + ) + (if (logtest? (-> this bot-flags) (bot-flag bf03)) + (set! v0-0 #f) + ) + v0-0 + ) + ) + +;; definition for method 192 of type bot +(defmethod clear-poi ((this bot)) + (let* ((s4-0 (handle->process (-> this poi-handle))) + (s5-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when s5-0 + (set! (-> this poi-handle) (the-as handle #f)) + (let ((s4-1 (handle->process (-> this focus handle)))) + (if (= (if (type? s4-1 process-focusable) + s4-1 + ) + s5-0 + ) + (clear-focused (-> this focus)) + ) + ) + ) + ) + (none) + ) + +;; definition for method 207 of type bot +(defmethod attacked-by-player? ((this bot) (arg0 process-focusable)) + (and (and arg0 (not (logtest? (-> arg0 focus-status) (focus-status disable dead ignore grabbed)))) + (or (logtest? (process-mask enemy) (-> arg0 mask)) + (and (logtest? (-> arg0 mask) (process-mask target)) (logtest? (-> this bot-flags) (bot-flag attacked))) + ) + ) + ) + +;; definition for method 64 of type bot +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod update-awareness! ((this bot) (arg0 process-focusable) (arg1 enemy-best-focus)) + (the-as enemy-aware 3) + ) + +;; definition for method 68 of type bot +;; WARN: Return type mismatch int vs enemy-aware. +(defmethod get-enemy-aware ((this bot) (arg0 enemy-aware)) + (the-as enemy-aware 3) + ) + +;; definition for method 140 of type bot +;; WARN: Return type mismatch object vs process. +(defmethod update-focus ((this bot)) + (local-vars (s5-1 process)) + (let ((s5-0 (-> this focus))) + (cond + ((logtest? (enemy-flag lock-focus) (-> this enemy-flags)) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + (else + (find-best-focus this) + (set! s5-1 (handle->process (-> s5-0 handle))) + ) + ) + ) + (let ((s4-0 #f)) + (when (or (logtest? (bot-flag bf18) (-> this bot-flags)) + (and (the-as process-focusable s5-1) (attacked-by-player? this (the-as process-focusable s5-1))) + ) + (set-time! (-> this danger-time)) + (set! s4-0 #t) + ) + (the-as + process + (when (nonzero? (-> this swivel-joint-mod)) + (if (and s4-0 (the-as process-focusable s5-1) (logtest? (-> this bot-flags) (bot-flag bf11))) + (bot-method-234 this (get-trans (the-as process-focusable s5-1) 3)) + (bot-method-233 this) + ) + ) + ) + ) + ) + +;; definition for method 106 of type bot +(defmethod find-best-focus ((this bot)) + (let* ((s5-0 (handle->process (-> this attacker-handle))) + (v1-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-3 + (cond + ((= (-> v1-3 type) target) + (when (or (not (logtest? (-> this bot-flags) (bot-flag attacked))) + (time-elapsed? (-> this attacker-time) (seconds 1.5)) + ) + (if (logtest? (-> this bot-flags) (bot-flag attacked)) + (bot-method-199 this) + ) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + (else + (when (time-elapsed? (-> this attacker-time) (seconds 6)) + (set! v1-3 (the-as process #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + ) + ) + ) + ) + (let ((a0-21 (-> this focus-mode)) + (s5-1 (the-as process #f)) + ) + (cond + ((zero? a0-21) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (let ((s4-0 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if s5-1 + (empty) + (set! s5-1 *target*) + ) + ) + ) + ) + ((= a0-21 1) + (cond + (v1-3 + (set! s5-1 v1-3) + ) + (else + (let ((s4-1 (handle->process (-> this poi-handle)))) + (set! s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (cond + (s5-1 + (empty) + ) + ((begin (set! s5-1 (bot-method-201 this)) s5-1) + (empty) + ) + (else + (set! s5-1 *target*) + ) + ) + ) + ) + ) + ) + (cond + (s5-1 + (try-update-focus (-> this focus) (the-as process-focusable s5-1) this) + (if (and (logtest? (-> this bot-flags) (bot-flag attacked)) (!= (-> s5-1 type) target)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + (else + (clear-focused (-> this focus)) + (logclear! (-> this bot-flags) (bot-flag attacked)) + ) + ) + s5-1 + ) + ) + ) + +;; definition for method 201 of type bot +;; INFO: Used lq/sq +(defmethod bot-method-201 ((this bot)) + (local-vars (a2-5 float) (a2-12 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + ) + (let ((s4-0 544) + (gp-0 (new 'stack-no-clear 'enemy-best-focus)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (f0-0 (-> this notice-enemy-dist)) + ) + (set! (-> gp-0 proc) #f) + (set! (-> gp-0 rating) 409600000.0) + (set! (-> gp-0 aware) (enemy-aware ea0)) + (when (< 0.0 f0-0) + (set! (-> s3-0 quad) (-> this root trans quad)) + (set! (-> s3-0 w) (-> this notice-enemy-dist)) + (set! *actor-list-length* 0) + (if (logtest? s4-0 512) + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* s3-0 *actor-list* 256)) + ) + (when (logtest? s4-0 1024) + (let ((a0-5 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-14 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-1 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-1 prim-core collide-as)) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 s3-0) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-2 a2-5) + (f1-3 (+ (-> a1-2 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-2 (* f1-3 f1-3)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-14) + *collide-player-list* + (set! v1-14 (-> v1-14 next0)) + ) + ) + ) + ) + (when (logtest? s4-0 256) + (let ((a0-8 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-22 (-> a0-8 next0))) + (while (!= a0-8 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-9 (-> (the-as connection a0-8) param1)) + (a1-13 (-> (the-as collide-shape a0-9) root-prim)) + ) + (when (logtest? (the-as collide-spec s4-0) (-> a1-13 prim-core collide-as)) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 s3-0) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-3 a2-12) + (f1-7 (+ (-> a1-14 world-sphere w) (-> s3-0 w))) + ) + (when (< f0-3 (* f1-7 f1-7)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-9)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-8 v1-22) + *collide-hit-by-player-list* + (set! v1-22 (-> v1-22 next0)) + ) + ) + ) + ) + (dotimes (s3-1 *actor-list-length*) + (let ((v1-27 (-> *actor-list* s3-1))) + (when (logtest? (the-as collide-spec s4-0) (-> v1-27 root-prim prim-core collide-as)) + (let* ((s2-0 (-> v1-27 process)) + (a1-26 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (if (and a1-26 + a1-26 + (not (logtest? (-> (the-as process-focusable a1-26) focus-status) (focus-status disable dead))) + ) + (set-next-focus! this (the-as enemy a1-26) gp-0) + ) + ) + ) + ) + ) + ) + ) + (-> gp-0 proc) + ) + ) + ) + +;; definition for method 213 of type bot +(defmethod set-next-focus! ((this bot) (arg0 enemy) (arg1 enemy-best-focus)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector-! v1-0 (-> arg0 root trans) (-> this root trans)) + (let ((f0-0 (vector-length v1-0))) + (when (and (>= (-> this notice-enemy-dist) f0-0) (< f0-0 (-> arg1 rating)) (>= 24576.0 (fabs (-> v1-0 y)))) + (set! (-> arg1 rating) f0-0) + (set! (-> arg1 proc) arg0) + arg0 + ) + ) + ) + ) + +;; definition for method 195 of type bot +(defmethod alive? ((this bot)) + (and (not (focus-test? this dead grabbed)) (and (!= (-> this hit-points) 0.0) (zero? (-> this fated-time)))) + ) + +;; definition for method 20 of type bot +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this bot)) + (the-as search-info-flag 0) + ) + +;; definition for method 82 of type bot +;; INFO: Used lq/sq +;; WARN: disable def twice: 272. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod event-handler ((this bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('combo) + #f + ) + (('query) + (case (-> arg3 param 0) + (('waypoint) + (-> this waypoint waypoint-id) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('request) + (case (-> arg3 param 0) + (('waypoint) + (set! (-> this waypoint-request) (the-as int (-> arg3 param 1))) + #t + ) + (('health-meter) + (cond + ((-> arg3 param 1) + (set! v0-0 (logior (-> this bot-flags) (bot-flag bf06))) + (set! (-> this bot-flags) (the-as bot-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> this bot-flags) (bot-flag bf06))) + (set! (-> this bot-flags) (the-as bot-flag v0-0)) + ) + ) + v0-0 + ) + (('too-far-fail) + (when (not (logtest? (-> this bot-flags) (bot-flag too-far-fail bf09))) + (logior! (-> this bot-flags) (bot-flag bf09)) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag dangerous-backup)) + (logclear! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (go (method-of-object this failed)) + ) + ) + (('move-to-vehicle) + (let ((a0-17 (the-as object (-> arg3 param 2)))) + (cond + ((>= (the-as int a0-17) 0) + (let ((v1-27 (the-as object (-> arg3 param 1)))) + (cond + ((focus-test? this pilot) + (if (= (-> this vehicle-seat-index) (the-as uint a0-17)) + (= (the-as uint v1-27) (handle->process (-> this vehicle-handle))) + ) + ) + (else + (set! (-> this vehicle-seat-index) (the-as int a0-17)) + (set! (-> this vehicle-handle) (process->handle (the-as uint v1-27))) + (logior! (-> this bot-flags) (bot-flag bf15)) + #t + ) + ) + ) + ) + (else + (when (not (focus-test? this pilot)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this vehicle-handle) (the-as handle #f)) + (logclear! (-> this bot-flags) (bot-flag bf15)) + #t + ) + ) + ) + ) + ) + (('exit-vehicle) + (when (focus-test? this pilot) + (let ((v1-41 (-> arg3 param 1)) + (s5-1 (-> arg3 param 2)) + ) + (cond + (v1-41 + (logior! (-> this bot-flags) (bot-flag bf16)) + (when (and (>= (the-as int s5-1) 0) (!= s5-1 (-> this nav-mesh-index))) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor (the-as int s5-1)) this) + (set! (-> this nav-mesh-index) (the-as int s5-1)) + ) + ) + (else + (logclear! (-> this bot-flags) (bot-flag bf16)) + ) + ) + ) + #t + ) + ) + (('slave-id) + (set! (-> this slave-id) (the-as int (-> arg3 param 1))) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('notify) + (case (-> arg3 param 0) + (('attack) + (let ((s5-2 (-> arg3 param 1))) + (when (if (type? s5-2 process-focusable) + s5-2 + ) + (logior! (-> this enemy-flags) (enemy-flag victory)) + (set-time! (-> this hit-focus-time)) + ) + ) + #t + ) + (('mission-failed) + (logior! (-> this bot-flags) (bot-flag bf09)) + (logclear! (-> this bot-flags) (bot-flag bf06)) + #t + ) + (('follow-dir) + (set! (-> this follow-dir quad) (-> (the-as vector (-> arg3 param 1)) quad)) + #t + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (('set-task) + (let ((a1-11 (/ (the-as int (-> arg3 param 0)) 8))) + (logior! (-> this bot-task-bits) (ash 1 a1-11)) + ) + #t + ) + (('clear-task) + (let ((a1-13 (/ (the-as int (-> arg3 param 0)) 8))) + (logclear! (-> this bot-task-bits) (ash 1 a1-13)) + ) + #t + ) + (('skip) + (skip-waypoint this) + ) + (('change-mode) + (when (= (-> arg3 param 0) 'grab) + (set! v0-0 (alive? this)) + (if (and (the-as symbol v0-0) (-> arg3 param 1)) + (logior! (-> this focus-status) (focus-status grabbed)) + ) + v0-0 + ) + ) + (('end-mode) + (case (-> arg3 param 0) + (('grab) + (when (focus-test? this grabbed) + (logclear! (-> this focus-status) (focus-status grabbed)) + #t + ) + ) + ) + ) + (('hide) + (cond + ((-> arg3 param 0) + (go (method-of-object this hidden)) + ) + (else + (if (and (-> this next-state) (= (-> this next-state name) 'hidden)) + (go-best-state this) + ) + ) + ) + ) + (('draw) + (cond + ((-> arg3 param 0) + (set! v0-0 (logclear (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + ) + (else + (set! v0-0 (logior (-> this draw status) (draw-control-status no-draw))) + (set! (-> this draw status) (the-as draw-control-status v0-0)) + ) + ) + v0-0 + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 110 of type bot +(defmethod send-attack ((this bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint)) + (cond + ((and (= (-> arg0 type) target) (not (logtest? (-> this bot-flags) (bot-flag attacked)))) + (when (send-event arg0 'shove #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 0.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (meters 2)) + (shove-up (meters 1.5)) + ) + ) + ) + (set! (-> this root penetrated-by) (the-as penetrate -1)) + (reset-penetrate! this) + #t + ) + ) + (else + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info :mask (vehicle-impulse-factor) ((id arg2) + (damage 2.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (shove-back (-> this enemy-info attack-shove-back)) + (shove-up (-> this enemy-info attack-shove-up)) + (mode (-> this enemy-info attack-mode)) + ) + ) + ) + (on-attack this (the-as process-focusable arg0)) + #t + ) + ) + ) + ) + +;; definition for method 84 of type bot +(defmethod send-attack-on-jump-or-knocked ((this bot) (arg0 process) (arg1 event-message-block)) + (cond + ((and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'knocked) (= v1-3 'jump)) + ) + ) + ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ) + (else + (when (!= (-> arg0 type) target) + (let* ((s3-0 (-> arg1 param 0)) + (s2-0 arg0) + (v1-6 (if (type? s2-0 process-focusable) + s2-0 + ) + ) + ) + (cond + ((and (focus-test? this dangerous) + (logtest? (process-mask enemy) (-> arg0 mask)) + (and v1-6 + (not (logtest? (-> (the-as process-focusable v1-6) focus-status) (focus-status disable dead ignore grabbed))) + ) + ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action deadly) + (collide-action) + ) + ) + (let ((a3-2 (if ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry s3-0) + (-> this root) + (collide-action persistent-attack) + (collide-action) + ) + (-> this persistent-attack-id) + (-> this attack-id) + ) + ) + ) + (send-attack this arg0 (the-as touching-shapes-entry s3-0) a3-2) + ) + ) + (else + (send-event arg0 'touch (-> arg1 param 0)) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function bot-simple-check-too-far +(defun bot-simple-check-too-far ((arg0 bot)) + (let ((s5-0 0)) + (let ((f0-0 (vector-vector-xz-distance (-> *target* control trans) (-> arg0 root trans))) + (f1-0 (-> arg0 too-far-warn-dist)) + ) + (when (>= f0-0 f1-0) + (if (>= (- f0-0 f1-0) (-> arg0 too-far-fail-dist-delta)) + (set! s5-0 2) + (set! s5-0 1) + ) + ) + ) + s5-0 + ) + ) + +;; definition for method 216 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-216 ((this bot)) + (when (not (channel-active? this (gui-channel none))) + (let ((a1-2 (get-next-speech-idx + (-> this course too-far-warn-speeches) + this + (-> this course speeches) + (bot-speech-info-flag) + ) + ) + ) + (when (>= a1-2 0) + (play-speech-by-id this a1-2) + #t + ) + ) + ) + (none) + ) + +;; definition for function bot-check-too-far-always-okay +(defun bot-check-too-far-always-okay () + 0 + ) + +;; definition for method 236 of type bot +(defmethod bot-check-too-far ((this bot)) + (let ((gp-0 0)) + (let ((v1-0 (-> this delay-too-far-check))) + (cond + ((> v1-0 0) + (set! (-> this delay-too-far-check) (+ v1-0 -1)) + ) + ((and (zero? v1-0) *target* (not (logtest? (-> this focus-status) (focus-status grabbed)))) + (let ((t9-0 (the-as object (-> this waypoint check-too-far)))) + (if (not (the-as symbol t9-0)) + (set! t9-0 (-> this course default-check-too-far)) + ) + (when (the-as symbol t9-0) + (cond + ((logtest? (the-as int t9-0) 1) + (set! gp-0 ((the-as (function bot int) (-> (the-as symbol t9-0) value)) this)) + ) + ((= (rtype-of (the-as symbol t9-0)) function) + (set! gp-0 ((the-as (function bot int) t9-0) this)) + ) + ) + ) + ) + (if (and (= gp-0 1) + (nonzero? (-> this started-warning-time)) + (time-elapsed? (-> this started-warning-time) (the-as time-frame (-> this warn-to-fail-timeout))) + ) + (set! gp-0 2) + ) + (case gp-0 + ((1) + (if (zero? (-> this started-warning-time)) + (set-time! (-> this started-warning-time)) + ) + (if (and (>= (current-time) (-> this next-too-far-warn-time)) (bot-method-216 this)) + (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + this + (the-as time-frame (-> this warn-min-delay)) + (the-as time-frame (-> this warn-max-delay)) + ) + ) + ) + ) + ) + ) + ) + ) + ) + (when (zero? gp-0) + (set! (-> this started-warning-time) 0) + 0 + ) + (= gp-0 2) + ) + ) + +;; definition for method 224 of type bot +;; WARN: Return type mismatch time-frame vs none. +(defmethod reset-warn-time ((this bot)) + (set! (-> this started-warning-time) 0) + (set! (-> this next-too-far-warn-time) (+ (current-time) (set-reaction-time! + this + (the-as time-frame (-> this warn-min-delay)) + (the-as time-frame (-> this warn-max-delay)) + ) + ) + ) + (none) + ) + +;; definition for method 59 of type bot +(defmethod enemy-common-post ((this bot)) + (set! (-> this travel-prev-ry) (-> this travel-prev-ry1)) + (set! (-> this travel-prev-ry1) (quaternion-y-angle (-> this root quat))) + (let ((f0-3 (/ (-> this hit-points) (-> this enemy-info default-hit-points)))) + (if (nonzero? (-> this fated-time)) + (set! f0-3 0.0) + ) + (set! (-> *game-info* bot-health (-> this bot-health-index)) f0-3) + ) + (cond + ((logtest? (-> this bot-flags) (bot-flag bf06)) + (if (and (not (handle->process (-> this health-handle))) *target*) + (bot-method-228 this) + ) + ) + (else + (send-event (handle->process (-> this health-handle)) 'hide-and-die) + ) + ) + (when (not (nav-enemy-method-185 this)) + (let ((a1-2 (new 'stack-no-clear 'overlaps-others-params))) + (set! (-> a1-2 options) (overlaps-others-options)) + (set! (-> a1-2 collide-with-filter) (the-as collide-spec -1)) + (set! (-> a1-2 tlist) *touching-list*) + (find-overlapping-shapes (-> this root) a1-2) + ) + ) + (let ((t9-5 (method-of-type nav-enemy enemy-common-post))) + (t9-5 this) + ) + (when (not (logtest? (-> this bot-flags) (bot-flag bf09))) + (let ((t9-6 (-> this waypoint on-update))) + (if t9-6 + (t9-6 this) + ) + ) + ) + (if (and (bot-check-too-far this) (not (logtest? (-> this bot-flags) (bot-flag bf09)))) + (go (method-of-object this failed)) + ) + (if (not (logtest? (-> this bot-flags) (bot-flag bf09))) + (ai-task-control-method-10 (-> this ai-ctrl) this) + ) + (if (logtest? (-> this bot-flags) (bot-flag bf02)) + (bot-method-204 this) + ) + (if (logtest? *display-bot-marks* (bot-marks-controls bmc08)) + (bot-method-196 this) + ) + (none) + ) + +;; definition for method 217 of type bot +(defmethod scene-play ((this bot) (arg0 scene) (arg1 symbol)) + (when (and (process-grab? this #t) (or arg1 (process-grab? *target* #t))) + (process-grab? this #f) + (if (not arg1) + (process-grab? *target* #f) + ) + (set! (-> this scene-player-handle) + (ppointer->handle (process-spawn scene-player :init scene-player-init arg0 #t #f :name "scene-player")) + ) + #t + ) + ) + +;; definition for method 200 of type bot +(defmethod scene-stop ((this bot)) + (when (not (handle->process (-> this scene-player-handle))) + (process-release? this) + #t + ) + ) + +;; definition for method 223 of type bot +;; WARN: Return type mismatch symbol vs none. +(defmethod bot-method-223 ((this bot)) + (let ((v1-1 (-> this course speeches))) + (countdown (a0-2 (-> this course speech-count)) + (let ((a1-1 (-> v1-1 a0-2))) + (logclear! (-> a1-1 flags) (bot-speech-info-flag playing)) + ) + ) + ) + (none) + ) + +;; definition for method 218 of type bot +(defmethod play-speech-by-id ((this bot) (arg0 int)) + (let* ((gp-0 (-> this course)) + (s5-0 (-> gp-0 speeches arg0)) + ) + (logior! (-> s5-0 flags) (bot-speech-info-flag playing)) + (let* ((t2-0 (-> s5-0 hold-time)) + (a1-4 + (add-process + *gui-control* + this + (-> this channel) + (gui-action play) + (-> s5-0 name) + -99.0 + (the-as time-frame t2-0) + ) + ) + (v1-5 (-> gp-0 speech-tunings (-> s5-0 tuning-id))) + ) + (sound-params-set! + *gui-control* + a1-4 + (-> v1-5 trans?) + (-> v1-5 fo-min) + (-> v1-5 fo-max) + (-> v1-5 fo-curve) + -1.0 + ) + ) + ) + ) + +;; definition for method 219 of type bot +(defmethod play-speech-by-name ((this bot) (arg0 string)) + (add-process *gui-control* this (-> this channel) (gui-action play) arg0 -99.0 (seconds 0.3)) + ) + +;; definition for method 229 of type bot +(defmethod course-speech-ended? ((this bot) (arg0 int)) + (let ((v1-2 (-> this course speeches arg0))) + (= (get-status + *gui-control* + (lookup-gui-connection-id *gui-control* (-> v1-2 name) (gui-channel none) (gui-action none)) + ) + (gui-status unknown) + ) + ) + ) + +;; definition for method 230 of type bot +(defmethod course-speech-playing? ((this bot) (arg0 int)) + (let ((v1-2 (-> this course speeches arg0))) + (logtest? (-> v1-2 flags) (bot-speech-info-flag playing)) + ) + ) + +;; definition for method 221 of type bot +(defmethod channel-active? ((this bot) (arg0 gui-channel)) + (if (= arg0 (gui-channel none)) + (set! arg0 (-> this channel)) + ) + (nonzero? (get-status *gui-control* (lookup-gui-connection-id *gui-control* (the-as string #f) arg0 (gui-action none))) + ) + ) + +;; definition for method 232 of type bot +(defmethod bot-method-232 ((this bot) (arg0 gui-channel) (arg1 symbol)) + (if (= arg0 (gui-channel none)) + (set! arg0 (-> this channel)) + ) + (if arg1 + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + arg0 + (gui-action none) + (the-as string #f) + (lambda :behavior bot + ((arg0 gui-connection)) + (let* ((v1-0 self) + (s5-0 (-> v1-0 course speeches)) + ) + (countdown (s4-0 (-> v1-0 course speech-count)) + (let ((s3-0 (-> s5-0 s4-0))) + (if (string= (-> s3-0 name) (-> arg0 name)) + (return (not (logtest? (-> s3-0 flags) (bot-speech-info-flag sf01)))) + ) + ) + ) + ) + #t + ) + (the-as process #f) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id 1) + arg0 + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + ) + +;; definition for method 225 of type bot +(defmethod go-to-waypoint! ((this bot) (arg0 int) (arg1 symbol)) + (let* ((v1-0 (-> this course)) + (a0-2 (-> v1-0 waypoints length)) + ) + (dotimes (a2-1 a0-2) + (let ((s4-0 (-> v1-0 waypoints a2-1))) + (when (= (-> s4-0 waypoint-id) arg0) + (set! (-> this waypoint) s4-0) + (set! (-> this waypoint-bits) (waypoint-bits)) + (set-time! (-> this waypoint-time0)) + (set! (-> this too-far-warn-dist) (-> this too-far-warn-dist-default)) + (set! (-> this too-far-fail-dist-delta) (-> this too-far-fail-dist-delta-default)) + (let ((s3-0 (-> s4-0 nav-mesh-index))) + (when (and (>= s3-0 0) (!= (-> this nav-mesh-index) s3-0)) + (change-to (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor s3-0) this) + (set! (-> this nav-mesh-index) s3-0) + ) + ) + (when arg1 + (let ((s5-1 (-> s4-0 on-skipping-here))) + (when s5-1 + (process-entity-status! this (entity-perm-status no-kill) #t) + (s5-1 this) + ) + ) + ) + (let ((t9-4 (-> s4-0 on-set))) + (if t9-4 + (t9-4 this) + ) + ) + (return #f) + ) + ) + ) + ) + (go process-drawable-art-error "bad waypoint id") + ) + +;; definition for method 227 of type bot +(defmethod skip-waypoint ((this bot)) + (let ((s5-0 (-> this waypoint skip-to))) + (when (>= s5-0 0) + (bot-method-232 this (gui-channel none) #f) + (set! (-> this delay-too-far-check) 10) + (go-to-waypoint! this s5-0 #t) + ) + ) + ) + +;; definition for method 7 of type bot +;; WARN: Return type mismatch nav-enemy vs bot. +(defmethod relocate ((this bot) (offset int)) + (if (nonzero? (-> this ai-ctrl)) + (&+! (-> this ai-ctrl) offset) + ) + (if (nonzero? (-> this task)) + (&+! (-> this task) offset) + ) + (if (nonzero? (-> this swivel-joint-mod)) + (&+! (-> this swivel-joint-mod) offset) + ) + (the-as bot ((method-of-type nav-enemy relocate) this offset)) + ) + +;; definition for method 10 of type bot +(defmethod deactivate ((this bot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (send-event (handle->process (-> this health-handle)) 'hide-and-die) + (if (nonzero? (-> this ai-ctrl)) + (ai-task-control-method-9 (-> this ai-ctrl)) + ) + ((method-of-type nav-enemy deactivate) this) + (none) + ) + +;; definition for method 222 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod init-fields! ((this bot)) + (set! (-> this master-handle) (the-as handle #f)) + (set! (-> this health-handle) (the-as handle #f)) + (set! (-> this scene-player-handle) (the-as handle #f)) + (set! (-> this poi-handle) (the-as handle #f)) + (set! (-> this attacker-handle) (the-as handle #f)) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this focus-mode) 0) + (set! (-> this hit-invuln-ignore-me-delay) (the-as uint 180)) + (set! (-> this warn-to-fail-timeout) (the-as uint #x34bc)) + (set! (-> this warn-min-delay) (the-as uint 2400)) + (set! (-> this warn-max-delay) (the-as uint 4200)) + (set! (-> this vehicle-seat-index) -1) + (set! (-> this nav-mesh-index) -1) + (set! (-> this too-far-warn-dist-default) 184320.0) + (set! (-> this too-far-fail-dist-delta-default) 122880.0) + (logior! (-> this bot-flags) (bot-flag bf11)) + (set! (-> this delay-too-far-check) 10) + (set! (-> this focus collide-with) (collide-spec jak enemy hit-by-others-list player-list)) + (set! (-> this spot-color) (the-as uint #x500000ff)) + (set-vector! (-> this follow-dir) 0.0 0.0 1.0 1.0) + 0 + (none) + ) + +;; definition for method 121 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this bot)) + (process-entity-status! this (entity-perm-status bit-4) #t) + (set! (-> this ai-ctrl) (new 'process 'ai-task-control *bot-task-pool*)) + (logclear! (-> this mask) (process-mask enemy)) + (logior! (-> this mask) (process-mask bot)) + (logior! (-> this enemy-flags) (enemy-flag cam-attack-mode dislike-combo)) + (logclear! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (logior! (-> this focus-status) (focus-status disable)) + (let ((v1-11 (-> this nav))) + (set! (-> v1-11 sphere-mask) (the-as uint 78)) + ) + 0 + (logclear! (-> this root nav-flags) (nav-flags has-extra-sphere)) + (let ((v1-15 (-> this nav))) + (set! (-> v1-15 speed-scale) 1.0) + ) + 0 + (set-gravity-length (-> this root dynam) 573440.0) + (let ((a2-3 (res-lump-value (-> this entity) 'task-actor uint128 :time -1000000000.0))) + (if (nonzero? a2-3) + (set! (-> this task) (new 'process 'game-task-control (the-as game-task-actor a2-3))) + ) + ) + (set! (-> this task-node) (task-node-by-name (the-as string ((method-of-type res-lump get-property-struct) + (-> this entity) + 'task-name + 'interp + -1000000000.0 + "" + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (let ((s5-1 (res-lump-value (-> this entity) 'bot-course uint128 :default (the-as uint128 -1) :time -1000000000.0)) + ) + (if (< (the-as int s5-1) 0) + (go process-drawable-art-error "no course") + ) + (let ((s5-2 (-> *bot-course-table* course s5-1))) + (set! (-> this course) s5-2) + (+! (-> s5-2 retry-cookie) 1) + (mem-copy! (the-as pointer (-> this spot)) (the-as pointer (-> s5-2 spots 0)) 20) + (let ((v1-35 (-> s5-2 waypoints 0))) + (set! (-> this nav-mesh-index) (-> v1-35 nav-mesh-index)) + (go-to-waypoint! this (-> v1-35 waypoint-id) #f) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 226 of type bot +(defmethod bot-method-226 ((this bot)) + (when (logtest? (-> this bot-flags) (bot-flag bf00)) + (let ((a1-0 (handle->process (-> this focus handle)))) + (and a1-0 + (= (-> this focus aware) (enemy-aware ea3)) + (attacked-by-player? this (the-as process-focusable a1-0)) + (not (logtest? (-> this focus-status) (focus-status grabbed))) + ) + ) + ) + ) + +;; definition for method 235 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-235 ((this bot) (arg0 symbol)) + (let ((gp-0 (-> this focus-info)) + (v1-1 (current-time)) + (s3-0 (handle->process (-> this focus handle))) + ) + (when (or (!= v1-1 (-> gp-0 update-time)) (!= (the-as process-focusable s3-0) (-> gp-0 fproc))) + (set! (-> gp-0 update-time) v1-1) + (set! (-> gp-0 fproc) (the-as process-focusable s3-0)) + (set! (-> gp-0 los) 0) + (when (the-as process-focusable s3-0) + (set! (-> gp-0 pos quad) (-> (get-trans (the-as process-focusable s3-0) 0) quad)) + (set! (-> gp-0 bullseye quad) (-> (get-trans (the-as process-focusable s3-0) 3) quad)) + (vector-z-quaternion! (-> gp-0 my-facing-xz-dir) (-> this root quat)) + (set! (-> gp-0 my-facing-xz-dir y) 0.0) + (vector-normalize! (-> gp-0 my-facing-xz-dir) 1.0) + (set! (-> gp-0 my-facing-ry) (atan (-> gp-0 my-facing-xz-dir x) (-> gp-0 my-facing-xz-dir z))) + (vector-! (-> gp-0 bullseye-xz-dir) (-> gp-0 bullseye) (-> this root trans)) + (let ((v1-11 (-> gp-0 bullseye-xz-dir))) + (set! (-> gp-0 bullseye-xz-dist) (sqrtf (+ (* (-> v1-11 x) (-> v1-11 x)) (* (-> v1-11 z) (-> v1-11 z))))) + ) + (set! (-> gp-0 bullseye-xz-dir y) 0.0) + (vector-normalize! (-> gp-0 bullseye-xz-dir) 1.0) + (set! (-> gp-0 bullseye-ry) (atan (-> gp-0 bullseye-xz-dir x) (-> gp-0 bullseye-xz-dir z))) + (set! (-> gp-0 ry-diff) (deg- (-> gp-0 bullseye-ry) (-> gp-0 my-facing-ry))) + ) + ) + (when (and arg0 s3-0 (zero? (-> gp-0 los))) + (let ((s4-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s4-1 start-pos quad) (-> this root trans quad)) + (+! (-> s4-1 start-pos y) 8192.0) + (vector-! (-> s4-1 move-dist) (-> gp-0 bullseye) (-> s4-1 start-pos)) + (let ((f0-19 (fmax 1.0 (+ -1638.4 (vector-length (-> s4-1 move-dist)))))) + (cond + ((< f0-19 (-> gp-0 max-los-dist)) + (vector-normalize! (-> s4-1 move-dist) f0-19) + (let ((v1-23 s4-1)) + (set! (-> v1-23 radius) 2048.0) + (set! (-> v1-23 collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-23 ignore-process0) this) + (set! (-> v1-23 ignore-process1) #f) + (set! (-> v1-23 ignore-pat) (-> this root pat-ignore-mask)) + (set! (-> v1-23 action-mask) (collide-action solid)) + ) + (cond + ((>= (fill-and-probe-using-line-sphere *collide-cache* s4-1) 0.0) + (set! (-> gp-0 los) 3) + 0 + ) + (else + (let ((s3-3 1)) + (when (not (logtest? (-> this bot-flags) (bot-flag attacked))) + (let ((a0-31 *target*)) + (when a0-31 + (vector+! (-> s4-1 move-dist) (-> s4-1 move-dist) (-> s4-1 start-pos)) + (if (>= 16384.0 (vector-segment-distance-point! + (get-trans a0-31 3) + (-> s4-1 start-pos) + (-> s4-1 move-dist) + (the-as vector #f) + ) + ) + (set! s3-3 4) + ) + ) + ) + ) + (set! (-> gp-0 los) s3-3) + ) + ) + ) + ) + (else + (set! (-> gp-0 los) 2) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 194 of type bot +;; INFO: Used lq/sq +(defmethod bot-method-194 ((this bot) (arg0 bot-turn-info) (arg1 process-focusable) (arg2 float)) + (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 (-> this root))) + (quaternion-copy! (-> arg0 src-quat) (-> s5-0 quat)) + (vector-z-quaternion! (-> arg0 facing-dir) (-> s5-0 quat)) + (set! (-> arg0 facing-ry) (atan (-> arg0 facing-dir x) (-> arg0 facing-dir z))) + (set! (-> arg0 targ-pos quad) (-> (get-trans arg1 3) quad)) + (set! (-> arg0 targ-ry) + (atan (- (-> arg0 targ-pos x) (-> s5-0 trans x)) (- (-> arg0 targ-pos z) (-> s5-0 trans z))) + ) + (let ((a0-7 (get-transv arg1)) + (a1-6 (-> arg0 predicted-targ-pos)) + ) + (let ((v1-4 (-> arg0 targ-pos))) + (let ((a2-1 arg2)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-7 quad)) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-6 quad) vf6) + ) + (set! (-> arg0 predicted-targ-ry) (atan + (- (-> arg0 predicted-targ-pos x) (-> s5-0 trans x)) + (- (-> arg0 predicted-targ-pos z) (-> s5-0 trans z)) + ) + ) + ) + (set! (-> arg0 ry-diff) (deg- (-> arg0 targ-ry) (-> arg0 facing-ry))) + (set! (-> arg0 predicted-ry-diff) (deg- (-> arg0 predicted-targ-ry) (-> arg0 facing-ry))) + ) + ) + +;; definition for method 220 of type bot +(defmethod bot-method-220 ((this bot)) + (let ((s5-0 #f)) + (when *target* + (let ((a1-0 (-> *target* control trans)) + (v1-4 (-> this root)) + (f0-0 14336.0) + ) + (when (>= (* f0-0 f0-0) (vector-vector-distance-squared (-> v1-4 trans) a1-0)) + (let ((v1-8 (-> *target* control transv))) + (when (>= (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))) 2048.0) + (if (logtest? (-> this nav state flags) (nav-state-flag avoiding-sphere)) + (set! s5-0 #t) + ) + ) + ) + ) + ) + ) + (let* ((f0-8 (-> this player-blocking)) + (f0-10 (if s5-0 + (seek f0-8 1.0 (seconds-per-frame)) + (seek f0-8 0.0 (seconds-per-frame)) + ) + ) + ) + (set! (-> this player-blocking) f0-10) + (= f0-10 1.0) + ) + ) + ) + +;; definition for method 91 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defmethod enemy-method-91 ((this bot) (arg0 enemy-jump-info)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 dest-pos quad)) + (set! (-> v1-0 w) (-> this nav-radius-backup)) + (add-root-sphere-to-hash! (-> this nav) v1-0 #x10006a) + ) + ) + +;; definition for method 234 of type bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-234 ((this bot) (arg0 vector)) + (let ((s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (v1-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> this root trans quad)) + (+! (-> v1-0 y) 9216.0) + (vector-! s1-0 arg0 v1-0) + (vector-normalize! s1-0 1.0) + (vector-z-quaternion! s2-0 (-> this root quat)) + (rot-zxy-from-vector! s4-0 s2-0) + (rot-zxy-from-vector! s3-0 s1-0) + (set! (-> s5-0 x) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 x) (-> s4-0 x))))) + (set! (-> s5-0 y) (fmax -3640.889 (fmin 3640.889 (deg- (-> s3-0 y) (-> s4-0 y))))) + (set! (-> s5-0 z) 0.0) + (let ((s4-1 (new 'stack-no-clear 'quaternion))) + (quaternion-zxy! s4-1 s5-0) + (quaternion-pseudo-seek + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + s4-1 + (seconds-per-frame) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 233 of type bot +(defmethod bot-method-233 ((this bot)) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (quaternion-identity! gp-0) + (quaternion-pseudo-seek + (-> this swivel-joint-mod quat) + (-> this swivel-joint-mod quat) + gp-0 + (seconds-per-frame) + ) + ) + ) + +;; definition for method 215 of type bot +(defmethod play-next-speech ((this bot)) + (when (not (channel-active? this (gui-channel none))) + (let ((a1-2 (get-next-speech-idx + (-> this course attack-player-speeches) + this + (-> this course speeches) + (bot-speech-info-flag) + ) + ) + ) + (if (>= a1-2 0) + (play-speech-by-id this a1-2) + ) + ) + ) + ) + +;; definition for method 208 of type bot +;; WARN: Return type mismatch bot-flag vs none. +(defmethod set-fail-flag ((this bot)) + (logior! (-> this bot-flags) (bot-flag too-far-fail)) + (none) + ) + +;; definition for method 209 of type bot +;; WARN: Return type mismatch bot-flag vs none. +(defmethod bot-method-209 ((this bot)) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable vulnerable-backup)) + (logclear! (-> this enemy-flags) (enemy-flag attackable attackable-backup)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> this bot-flags) (bot-flag bf09)) + (let ((s5-0 #t)) + (let ((a0-6 (handle->process (-> this master-handle)))) + (cond + (a0-6 + (if (not (send-event a0-6 'notify 'mission-failed)) + (set! s5-0 #f) + ) + ) + (else + (when (-> this task-node) + (let* ((v1-23 (-> *game-info* sub-task-list (-> this task-node task))) + (v1-25 (if (-> v1-23 manager) + (-> v1-23 manager manager) + (the-as handle #f) + ) + ) + ) + (if v1-25 + (send-event (handle->process v1-25) 'fail) + ) + ) + ) + ) + ) + ) + (if s5-0 + (logior! (-> this bot-flags) (bot-flag failed bf13)) + ) + ) + (none) + ) + +;; definition for method 212 of type bot +(defmethod bot-method-212 ((this bot)) + (if (logtest? (-> this bot-flags) (bot-flag failed)) + (cam-move-to-bot this) + ) + (none) + ) + +;; definition for method 211 of type bot +;; WARN: Return type mismatch object vs none. +(defmethod cam-move-to-bot ((this bot)) + (cond + ((logtest? (-> this bot-flags) (bot-flag bf13)) + (logclear! (-> this bot-flags) (bot-flag bf13)) + (logior! (-> this bot-flags) (bot-flag bf14)) + (let ((s4-0 (-> this move-dest))) + (set-cam-height this s4-0) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-! s5-0 s4-0 (-> this root trans)) + (set-setting! 'string-max-height 'abs (-> s5-0 y) 0) + (set-setting! 'string-min-height 'abs (-> s5-0 y) 0) + (let ((f30-0 (sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z)))))) + (set-setting! 'string-max-length 'abs f30-0 0) + (set-setting! 'string-min-length 'abs f30-0 0) + ) + ) + ) + (set-setting! 'immediate-string-min-max #f 0.0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + ) + ((logtest? (-> this bot-flags) (bot-flag bf14)) + (logclear! (-> this bot-flags) (bot-flag bf14)) + (send-event *camera* 'change-target this) + (send-event *camera* 'teleport-to-vector-start-string (-> this move-dest)) + ) + ) + (none) + ) + +;; definition for method 210 of type bot +(defmethod set-cam-height ((this bot) (arg0 vector)) + (set-vector! arg0 0.0 12288.0 28672.0 1.0) + (vector<-cspace+vector! arg0 (-> this node-list data 2) arg0) + (if (focus-test? this under-water) + (set! (-> arg0 y) (+ (get-water-height this) (-> *setting-control* cam-current target-height))) + ) + ) + +;; definition for method 203 of type bot +;; WARN: Return type mismatch focus-status vs none. +(defmethod bot-method-203 ((this bot)) + (logior! (-> this bot-flags) (bot-flag bf02)) + (set-time! (-> this hit-invuln-starting-time)) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable)) + (if (nonzero? (-> this hit-invuln-ignore-me-delay)) + (logior! (-> this focus-status) (focus-status ignore)) + ) + (if (nonzero? (-> this hit-invuln-focus-disable-delay)) + (logior! (-> this focus-status) (focus-status disable)) + ) + (none) + ) + +;; definition for method 204 of type bot +;; WARN: Return type mismatch bot-flag vs none. +(defmethod bot-method-204 ((this bot)) + (local-vars (a2-7 enemy-flag)) + (let ((a1-0 (-> this hit-invuln-starting-time)) + (v1-0 #t) + ) + (if (not (logtest? (-> this enemy-flags) (enemy-flag vulnerable))) + (set! v1-0 (cond + ((time-elapsed? a1-0 (seconds 0.6)) + (let ((a2-6 (-> this enemy-flags))) + (if (logtest? a2-6 (enemy-flag vulnerable-backup)) + (set! a2-7 (logior a2-6 (enemy-flag vulnerable))) + (set! a2-7 (logclear a2-6 (enemy-flag vulnerable))) + ) + ) + (set! (-> this enemy-flags) a2-7) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (focus-test? this ignore) + (set! v1-0 (cond + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-ignore-me-delay))) + (logclear! (-> this focus-status) (focus-status ignore)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if (focus-test? this disable) + (set! v1-0 (cond + ((time-elapsed? a1-0 (the-as time-frame (-> this hit-invuln-focus-disable-delay))) + (logclear! (-> this focus-status) (focus-status disable)) + v1-0 + ) + (else + #f + ) + ) + ) + ) + (if v1-0 + (logclear! (-> this bot-flags) (bot-flag bf02)) + ) + ) + (none) + ) + +;; definition for method 228 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-228 ((this bot)) + 0 + (none) + ) + +;; definition for method 67 of type bot +(defmethod coin-flip? ((this bot)) + #f + ) + +;; definition for method 193 of type bot +;; WARN: Return type mismatch int vs none. +(defmethod bot-method-193 ((this bot) (arg0 vector) (arg1 vector) (arg2 vector) (arg3 vector) (arg4 vector) (arg5 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((f1-1 (* arg5 arg5)) + (f0-2 (* arg5 f1-1)) + ) + (let ((f2-3 (- (+ 1.0 (* -3.0 arg5) (* 3.0 f1-1)) f0-2)) + (f3-7 (+ (* 3.0 f0-2) (* -6.0 f1-1) (* 3.0 arg5))) + (f1-3 (+ (* -3.0 f0-2) (* 3.0 f1-1))) + ) + (vector-float*! arg0 arg1 f2-3) + (let ((t2-1 arg0)) + (let ((v1-10 arg0)) + (let ((a0-3 (vector+! (new 'stack-no-clear 'vector) arg1 arg2))) + (let ((a2-1 f3-7)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-3 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> t2-1 quad) vf6) + ) + (let ((a2-2 arg0)) + (let ((v1-11 arg0)) + (let ((a0-5 (vector+! (new 'stack-no-clear 'vector) arg3 arg4))) + (let ((a3-2 f1-3)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-2 quad) vf6) + ) + ) + (let ((v1-12 arg0)) + (let ((a0-6 arg0)) + (let ((a1-1 arg3)) + (let ((a2-3 f0-2)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-1 quad)) + ) + (.lvf vf4 (&-> a0-6 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-12 quad) vf6) + ) + ) + 0 + (none) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control-h_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control-h_REF.gc index ef7711be67..241538c0b8 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control-h_REF.gc @@ -332,7 +332,7 @@ ) (:methods (new (symbol type) _type_) - (nav-network-method-9 (_type_ int int) none) + (alloc-nav-network-for-level! (_type_ int int) none) (init-by-other! (_type_ level nav-network-data) none) (nav-network-method-11 (_type_) none) (reset! (_type_) none) diff --git a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc index eabcf7bcad..ee0f964c3c 100644 --- a/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/common/enemy/hover/hover-nav-control_REF.gc @@ -100,7 +100,7 @@ ;; definition for method 9 of type nav-network ;; WARN: Return type mismatch int vs none. -(defmethod nav-network-method-9 ((this nav-network) (arg0 int) (arg1 int)) +(defmethod alloc-nav-network-for-level! ((this nav-network) (arg0 int) (arg1 int)) (set! (-> this segment-pool) (the-as (pointer hover-nav-path-segment) (malloc 'loading-level (* 96 arg0)))) (set! (-> this free-segment-list) #f) (dotimes (v1-1 64) diff --git a/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc new file mode 100644 index 0000000000..e79788c14a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/des-bbush-tasks_REF.gc @@ -0,0 +1,997 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type hud-wasbbv-goal +(deftype hud-wasbbv-goal (hud) + () + ) + +;; definition for method 3 of type hud-wasbbv-goal +(defmethod inspect ((this hud-wasbbv-goal)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type hud-wasbbv-score +(deftype hud-wasbbv-score (hud) + () + ) + +;; definition for method 3 of type hud-wasbbv-score +(defmethod inspect ((this hud-wasbbv-score)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type hud-wasbbv-counter +(deftype hud-wasbbv-counter (hud) + () + ) + +;; definition for method 3 of type hud-wasbbv-counter +(defmethod inspect ((this hud-wasbbv-counter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type wasbbv-hud-info +(deftype wasbbv-hud-info (structure) + ((goal float) + (score float) + (current float) + (goal-cup uint8) + (goal-text text-id) + (score-text text-id) + (decimal-place-count int8) + ) + ) + +;; definition for method 3 of type wasbbv-hud-info +(defmethod inspect ((this wasbbv-hud-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'wasbbv-hud-info) + (format #t "~1Tgoal: ~f~%" (-> this goal)) + (format #t "~1Tscore: ~f~%" (-> this score)) + (format #t "~1Tcurrent: ~f~%" (-> this current)) + (format #t "~1Tgoal-cup: ~D~%" (-> this goal-cup)) + (format #t "~1Tgoal-text: ~D~%" (-> this goal-text)) + (format #t "~1Tscore-text: ~D~%" (-> this score-text)) + (format #t "~1Tdecimal-place-count: ~D~%" (-> this decimal-place-count)) + (label cfg-4) + this + ) + +;; definition for symbol *wasbbv-hud-info*, type wasbbv-hud-info +(define *wasbbv-hud-info* (new 'static 'wasbbv-hud-info)) + +;; definition for method 15 of type hud-wasbbv-goal +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-wasbbv-goal)) + (local-vars (v1-7 int) (s5-0 int)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ (* -130.0 (-> this offset)) (* 65.0 (-> *video-params* relative-x-scale)))) + 70 + ) + 0 + 1 + (case (-> *wasbbv-hud-info* goal-cup) + ((1) + (set! s5-0 313) + (set! v1-7 3) + ) + ((2) + (set! s5-0 312) + (set! v1-7 8) + ) + ((3) + (set! s5-0 311) + (set! v1-7 5) + ) + (else + (set! s5-0 310) + (set! v1-7 1) + ) + ) + (set! (-> this strings 0 color) (the-as font-color v1-7)) + (set! (-> this strings 1 color) (the-as font-color v1-7)) + (let ((s4-0 format) + (s3-0 (clear (-> this strings 1 text))) + (s2-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (the-as text-id s5-0) #f)) + (s4-0 s3-0 s2-0 *temp-string*) + ) + (let ((s4-1 (-> this strings)) + (s5-1 *wasbbv-hud-info*) + ) + (clear (-> s4-1 0 text)) + (let ((t9-7 format) + (a0-15 (-> s4-1 0 text)) + (v1-10 (-> s5-1 decimal-place-count)) + ) + (t9-7 + a0-15 + (cond + ((zero? v1-10) + "~,,0f" + ) + ((= v1-10 1) + "~,,1f" + ) + (else + "~,,2f" + ) + ) + (+ 0.001 (-> s5-1 goal)) + ) + ) + ) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) -40 -40) + (set! (-> this strings 1 scale) 0.65) + (case (-> *setting-control* user-default language) + (((language-enum korean)) + (set! (-> this strings 1 scale) 0.9) + (+! (-> this strings 1 pos y) -5) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-wasbbv-goal +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-wasbbv-goal)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-left) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 flags) (font-flags shadow kerning large)) + (set! (-> this strings 1 color) (font-color red)) + 0 + (none) + ) + +;; definition for method 15 of type hud-wasbbv-score +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-wasbbv-score)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ (- 512.0 (* 72.0 (-> *video-params* relative-x-scale))) (* 130.0 (-> this offset)))) + 70 + ) + (let ((s4-0 (-> this strings)) + (s5-0 *wasbbv-hud-info*) + ) + (clear (-> s4-0 0 text)) + (let ((t9-2 format) + (a0-3 (-> s4-0 0 text)) + (v1-4 (-> s5-0 decimal-place-count)) + ) + (t9-2 + a0-3 + (cond + ((zero? v1-4) + "~,,0f" + ) + ((= v1-4 1) + "~,,1f" + ) + (else + "~,,2f" + ) + ) + (-> s5-0 score) + ) + ) + ) + (let ((s5-1 format) + (s4-1 (clear (-> this strings 1 text))) + (s3-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (-> *wasbbv-hud-info* score-text) #f)) + (s5-1 s4-1 s3-0 *temp-string*) + ) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 32 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 40 -40) + (let ((v1-9 (-> *setting-control* user-default language))) + (set! (-> this strings 1 scale) + (cond + ((or (= v1-9 (language-enum french)) (or (= v1-9 (language-enum german)) + (= v1-9 (language-enum spanish)) + (= v1-9 (language-enum italian)) + (= v1-9 (language-enum portuguese)) + ) + ) + 0.5 + ) + ((= v1-9 (language-enum korean)) + (+! (-> this strings 1 pos x) -25) + (+! (-> this strings 1 pos y) -5) + 0.9 + ) + (else + 0.5 + ) + ) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-wasbbv-score +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-wasbbv-score)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning right large)) + (set! (-> this strings 0 color) (font-color default)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.55) + (set! (-> this strings 1 flags) (font-flags shadow kerning right large)) + (set! (-> this strings 1 color) (font-color default)) + 0 + (none) + ) + +;; definition for method 15 of type hud-wasbbv-counter +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-wasbbv-counter)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ (- 512.0 (* 72.0 (-> *video-params* relative-x-scale))) (* 130.0 (-> this offset)))) + 95 + ) + (let ((s5-0 (-> this strings))) + (let ((s4-0 *wasbbv-hud-info*)) + (clear (-> s5-0 0 text)) + (let ((t9-2 format) + (a0-3 (-> s5-0 0 text)) + (v1-4 (-> s4-0 decimal-place-count)) + ) + (t9-2 + a0-3 + (cond + ((zero? v1-4) + "~,,0f" + ) + ((= v1-4 1) + "~,,1f" + ) + (else + "~,,2f" + ) + ) + (-> s4-0 current) + ) + ) + ) + (set-as-offset-from! (the-as hud-sprite (-> s5-0 0 pos)) (the-as vector4w (-> this sprites)) 32 -8) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-wasbbv-counter +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-wasbbv-counter)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.5) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 flags) (font-flags kerning right large)) + (set! (-> this strings 0 color) (font-color red)) + 0 + (none) + ) + +;; definition of type task-manager-vehicle-bbush +(deftype task-manager-vehicle-bbush (task-manager) + ((ground-pos vector :inline) + (ground-time time-frame) + (pre-start-time time-frame) + (display-units float) + (max-distance float) + (distance float) + (total-distance float) + (max-air-time float) + (air-time float) + (total-air-time float) + (goal float) + (score float) + (current float) + (hud-score handle) + (hud-goal handle) + (squad-manager handle :offset 336) + (game-score uint8) + (last-cup uint8) + (goal-cup uint8) + (new-high-score symbol) + (want-current-hud? symbol) + ) + (:state-methods + report + ) + (:methods + (award-skill (_type_ float) none) + (task-manager-vehicle-bbush-method-34 (_type_) none) + (task-manager-vehicle-bbush-method-35 (_type_) none) + (task-manager-vehicle-bbush-method-36 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-vehicle-bbush +(defmethod inspect ((this task-manager-vehicle-bbush)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tground-pos: #~%" (-> this ground-pos)) + (format #t "~2Tground-time: ~D~%" (-> this ground-time)) + (format #t "~2Tpre-start-time: ~D~%" (-> this pre-start-time)) + (format #t "~2Tdisplay-units: ~f~%" (-> this display-units)) + (format #t "~2Tmax-distance: ~f~%" (-> this max-distance)) + (format #t "~2Tdistance: ~f~%" (-> this distance)) + (format #t "~2Ttotal-distance: ~f~%" (-> this total-distance)) + (format #t "~2Tmax-air-time: ~f~%" (-> this max-air-time)) + (format #t "~2Tair-time: ~f~%" (-> this air-time)) + (format #t "~2Ttotal-air-time: ~f~%" (-> this total-air-time)) + (format #t "~2Tgoal: ~f~%" (-> this goal)) + (format #t "~2Tscore: ~f~%" (-> this score)) + (format #t "~2Tcurrent: ~f~%" (-> this current)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (format #t "~2Thud-counter: ~D~%" (-> this hud-counter)) + (format #t "~2Tsquad-manager: ~D~%" (-> this squad-manager)) + (format #t "~2Tgame-score: ~D~%" (-> this game-score)) + (format #t "~2Tlast-cup: ~D~%" (-> this last-cup)) + (format #t "~2Tgoal-cup: ~D~%" (-> this goal-cup)) + (format #t "~2Tnew-high-score: ~A~%" (-> this new-high-score)) + (format #t "~2Twant-current-hud?: ~A~%" (-> this want-current-hud?)) + (label cfg-4) + this + ) + +;; definition for method 34 of type task-manager-vehicle-bbush +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-vehicle-bbush-method-34 ((this task-manager-vehicle-bbush)) + (let ((gp-0 *wasbbv-hud-info*)) + (let ((v1-0 (-> this goal-cup))) + (set! (-> gp-0 goal-text) (cond + ((= v1-0 1) + (text-id text-0139) + ) + ((= v1-0 2) + (text-id text-0138) + ) + ((= v1-0 3) + (text-id text-0137) + ) + (else + (text-id text-0136) + ) + ) + ) + ) + (set! (-> this goal) + (game-info-method-31 *game-info* (the-as int (-> this game-score)) (the-as int (-> this goal-cup))) + ) + (set! (-> gp-0 goal) (* (-> this display-units) (-> this goal))) + (set! (-> gp-0 goal-cup) (-> this goal-cup)) + ) + 0 + (none) + ) + +;; definition for method 26 of type task-manager-vehicle-bbush +;; INFO: Used lq/sq +(defmethod task-manager-method-26 ((this task-manager-vehicle-bbush)) + (when (= (-> this player-vehicle) #f) + (when (and *target* (focus-test? *target* pilot-riding)) + (let* ((s5-0 (handle->process (-> *target* pilot vehicle))) + (v1-10 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when v1-10 + (set! (-> this player-vehicle) (-> *target* pilot vehicle)) + (set! (-> this ground-pos quad) (-> (the-as process-focusable v1-10) root trans quad)) + (set-time! (-> this ground-time)) + (dotimes (s5-1 3) + (send-event (handle->process (-> this player-vehicle)) 'turbo-pickup) + ) + ) + ) + ) + ) + (when (!= (-> this player-vehicle) #f) + (let ((v1-26 (the-as vehicle (handle->process (-> this player-vehicle))))) + (when v1-26 + (cond + ((and (logtest? (-> v1-26 v-flags) (vehicle-flag in-air)) + (not (logtest? (-> v1-26 v-flags) (vehicle-flag impact))) + ) + (set! (-> this air-time) (the float (- (current-time) (-> this ground-time)))) + (set! (-> this distance) + (vector-vector-xz-distance (-> this ground-pos) (the-as vector (&-> (the-as vehicle (-> v1-26 root)) parent))) + ) + ) + (else + (when (< 360.0 (-> this air-time)) + (+! (-> this total-distance) (-> this distance)) + (+! (-> this total-air-time) (-> this air-time)) + ) + (set! (-> this max-distance) (fmax (-> this max-distance) (-> this distance))) + (set! (-> this max-air-time) (fmax (-> this max-air-time) (-> this air-time))) + (set! (-> this ground-pos quad) (-> v1-26 root trans quad)) + (set-time! (-> this ground-time)) + (set! (-> this distance) 0.0) + (set! (-> this air-time) 0.0) + ) + ) + (task-manager-vehicle-bbush-method-34 this) + (when (>= (-> this score) (-> this goal)) + (set! (-> this new-high-score) #t) + (when (>= (the-as uint 3) (-> this goal-cup)) + (sound-play "special-pickup") + (+! (-> this goal-cup) 1) + ) + ) + ) + ) + ) + (let ((v1-42 *wasbbv-hud-info*)) + (set! (-> v1-42 score) (* (-> this display-units) (-> this score))) + (set! (-> v1-42 current) (* (-> this display-units) (-> this current))) + ) + (hud-timer-handler this) + ((method-of-type task-manager task-manager-method-26) this) + (none) + ) + +;; definition for method 25 of type task-manager-vehicle-bbush +(defmethod task-manager-method-25 ((this task-manager-vehicle-bbush)) + (set! (-> *was-squad-control* target-count) 0) + 0 + (call-parent-method this) + (none) + ) + +;; definition for method 29 of type task-manager-vehicle-bbush +;; WARN: Return type mismatch int vs object. +(defmethod go-fail ((this task-manager-vehicle-bbush)) + (go (method-of-object this report)) + 0 + ) + +;; definition for method 35 of type task-manager-vehicle-bbush +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-vehicle-bbush-method-35 ((this task-manager-vehicle-bbush)) + (let ((v1-0 *was-squad-control*)) + (set! (-> v1-0 target-count) 2) + (set! (-> v1-0 reserve-count) 4000) + ) + (set-setting! 'music 'descarbb 0.0 0) + 0 + (none) + ) + +;; definition for method 36 of type task-manager-vehicle-bbush +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-vehicle-bbush-method-36 ((this task-manager-vehicle-bbush)) + (let ((a0-1 (-> this node-info parent-node 0))) + (task-node-open! a0-1 'event) + ) + 0 + (none) + ) + +;; definition for method 21 of type task-manager-vehicle-bbush +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-vehicle-bbush)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this squad-manager) (ppointer->handle (was-squad-manager-start this))) + (set! (-> this time-limit) (seconds 120)) + (set! (-> this air-time) 0.0) + (set! (-> this max-air-time) 0.0) + (set! (-> this total-air-time) 0.0) + (set! (-> this distance) 0.0) + (set! (-> this max-distance) 0.0) + (set! (-> this total-distance) 0.0) + (set! (-> this display-units) 1.0) + (set! (-> this new-high-score) #f) + (set! (-> this want-current-hud?) #t) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0573)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 2) + (set-setting! 'airlock #f 0.0 0) + (none) + ) + +;; definition for method 33 of type task-manager-vehicle-bbush +;; WARN: Return type mismatch int vs none. +(defmethod award-skill ((this task-manager-vehicle-bbush) (arg0 float)) + (let* ((s5-0 (-> this game-score)) + (s3-0 (game-info-method-29 *game-info* (the-as int s5-0))) + (v1-2 (get-highscore-rank *game-info* (the-as int s5-0) arg0)) + (gp-1 (max 0 (- v1-2 s3-0))) + ) + (game-info-method-27 *game-info* (the-as game-score s5-0) arg0) + (give *game-info* 'skill (* (the float gp-1) (-> *FACT-bank* super-skill-inc)) (the-as handle #f)) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-vehicle-bbush) + :virtual #t + :code (behavior () + (until #f + (if (and *target* (not (logtest? (-> *target* focus-status) (focus-status grabbed)))) + (goto cfg-7) + ) + (suspend) + ) + #f + (label cfg-7) + (set-setting! 'exclusive-task #f 0.0 (-> self node-info task)) + (set! (-> self last-cup) (the-as uint (game-info-method-29 *game-info* (the-as int (-> self game-score))))) + (set! (-> self goal-cup) (+ (-> self last-cup) 1)) + (task-manager-vehicle-bbush-method-34 self) + (set! (-> self new-high-score) #f) + (set! (-> self hud-goal) + (ppointer->handle (process-spawn hud-wasbbv-goal :init hud-init-by-other :name "hud-wasbbv-goal" :to self)) + ) + (set! (-> self hud-score) + (ppointer->handle (process-spawn hud-wasbbv-score :init hud-init-by-other :name "hud-wasbbv-score" :to self)) + ) + (if (-> self want-current-hud?) + (set! (-> self hud-counter) + (ppointer->handle + (process-spawn hud-wasbbv-counter :init hud-init-by-other :name "hud-wasbbv-counter" :to self) + ) + ) + ) + (set-time! (-> self pre-start-time)) + (while (and (not (time-elapsed? (-> self pre-start-time) (seconds 10))) + (not (handle->process (-> self player-vehicle))) + ) + (when (and *target* (focus-test? *target* pilot-riding)) + (let ((gp-3 (handle->process (-> *target* pilot vehicle)))) + (if (if (type? gp-3 process-focusable) + gp-3 + ) + (set! (-> self player-vehicle) (-> *target* pilot vehicle)) + ) + ) + ) + (suspend) + ) + (task-manager-vehicle-bbush-method-35 self) + (set-time! (-> self start-time)) + (sleep-code) + ) + ) + +;; definition for symbol *bbv-fail-time-expired*, type resetter-params +(define *bbv-fail-time-expired* + (new 'static 'resetter-params + :message (resetter-message mission-fail-or-retry) + :flags (resetter-flag auto-reset text-message no-audio-first) + :fail (new 'static 'resetter-spec :continue #f :reset-mode 'life :execute #f) + :retry (new 'static 'resetter-spec :continue "desert-bbush-desc-4" :reset-mode 'try :execute #f) + :reset-delay (seconds 6.5) + :text-message (text-id text-07cc) + ) + ) + +;; failed to figure out what this is: +(defstate report (task-manager-vehicle-bbush) + :virtual #t + :code (behavior () + (award-skill self (-> self score)) + (cond + ((-> self new-high-score) + (format #t "task-manager-vehicle-bbush::report: got new high score~%") + (let ((gp-0 (-> self info on-complete))) + (if gp-0 + (script-eval gp-0) + ) + ) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 2)) + (suspend) + ) + ) + (while (not (-> *setting-control* user-current speech-control)) + (suspend) + ) + (task-manager-vehicle-bbush-method-36 self) + (until #f + (suspend) + ) + #f + ) + (else + (format #t "task-manager-vehicle-bbush::report: no new high score~%") + (let ((gp-2 (-> self info on-fail))) + (if gp-2 + (script-eval gp-2) + ) + ) + (while (not (-> *setting-control* user-current speech-control)) + (suspend) + ) + (task-manager-method-28 self) + (let ((gp-3 (on-fail self 'fail))) + (when gp-3 + (mem-copy! (the-as pointer *bbv-fail-time-expired*) (the-as pointer gp-3) 48) + (set! (-> gp-3 text-message) (text-id text-07cc)) + ) + ) + (go-virtual fail *bbv-fail-time-expired*) + ) + ) + ) + ) + +;; definition of type task-manager-bbush-air-time +(deftype task-manager-bbush-air-time (task-manager-vehicle-bbush) + () + ) + +;; definition for method 3 of type task-manager-bbush-air-time +(defmethod inspect ((this task-manager-bbush-air-time)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-bbush-air-time +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-bbush-air-time)) + (call-parent-method this) + (set! (-> this display-units) 0.0033333334) + (set! (-> this time-limit) (seconds 30)) + (set! (-> this game-score) (the-as uint 4)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0573)) + (none) + ) + +;; definition for method 26 of type task-manager-bbush-air-time +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-bbush-air-time)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this max-air-time)) + (set! (-> this current) (-> this air-time)) + 0 + (none) + ) + +;; definition of type task-manager-bbush-total-air-time +(deftype task-manager-bbush-total-air-time (task-manager-vehicle-bbush) + () + ) + +;; definition for method 3 of type task-manager-bbush-total-air-time +(defmethod inspect ((this task-manager-bbush-total-air-time)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-bbush-total-air-time +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-bbush-total-air-time)) + (call-parent-method this) + (set! (-> this display-units) 0.0033333334) + (set! (-> this time-limit) (seconds 60)) + (set! (-> this game-score) (the-as uint 5)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0078)) + (none) + ) + +;; definition for method 26 of type task-manager-bbush-total-air-time +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-bbush-total-air-time)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this total-air-time)) + (set! (-> this current) (-> this air-time)) + 0 + (none) + ) + +;; definition of type task-manager-bbush-jump-distance +(deftype task-manager-bbush-jump-distance (task-manager-vehicle-bbush) + ((pad uint8 36) + ) + ) + +;; definition for method 3 of type task-manager-bbush-jump-distance +(defmethod inspect ((this task-manager-bbush-jump-distance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush inspect))) + (t9-0 this) + ) + (format #t "~2Tground-pos: #~%" (-> this ground-pos)) + (format #t "~2Tmax-distance: ~f~%" (-> this max-distance)) + (format #t "~2Tdistance: ~f~%" (-> this distance)) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-bbush-jump-distance +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-bbush-jump-distance)) + (call-parent-method this) + (set! (-> this display-units) 0.00024414062) + (set! (-> this time-limit) (seconds 30)) + (set! (-> this game-score) (the-as uint 6)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-0833)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 1) + (none) + ) + +;; definition for method 26 of type task-manager-bbush-jump-distance +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-bbush-jump-distance)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this max-distance)) + (set! (-> this current) (-> this distance)) + 0 + (none) + ) + +;; definition of type task-manager-bbush-total-jump-distance +(deftype task-manager-bbush-total-jump-distance (task-manager-vehicle-bbush) + () + ) + +;; definition for method 3 of type task-manager-bbush-total-jump-distance +(defmethod inspect ((this task-manager-bbush-total-jump-distance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-bbush-total-jump-distance +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-bbush-total-jump-distance)) + (call-parent-method this) + (set! (-> this display-units) 0.00024414062) + (set! (-> this time-limit) (seconds 60)) + (set! (-> this game-score) (the-as uint 7)) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-07ce)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 1) + (none) + ) + +;; definition for method 26 of type task-manager-bbush-total-jump-distance +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-bbush-total-jump-distance)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (set! (-> this score) (-> this total-distance)) + (set! (-> this current) (-> this distance)) + 0 + (none) + ) + +;; definition of type task-manager-bbush-roll-count +(deftype task-manager-bbush-roll-count (task-manager-vehicle-bbush) + ((roll-count float) + (y-proj float) + ) + ) + +;; definition for method 3 of type task-manager-bbush-roll-count +(defmethod inspect ((this task-manager-bbush-roll-count)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush inspect))) + (t9-0 this) + ) + (format #t "~2Troll-count: ~f~%" (-> this roll-count)) + (format #t "~2Ty-proj: ~f~%" (-> this y-proj)) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-bbush-roll-count +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-bbush-roll-count)) + (call-parent-method this) + (set! (-> this display-units) 1.0) + (set! (-> this time-limit) (seconds 60)) + (set! (-> this game-score) (the-as uint 8)) + (set! (-> this want-current-hud?) #f) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-07cd)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 0) + 0 + (none) + ) + +;; definition for method 26 of type task-manager-bbush-roll-count +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-bbush-roll-count)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (let ((v1-2 (handle->process (-> this player-vehicle)))) + (when v1-2 + (let ((f0-0 (-> (the-as vehicle v1-2) node-list data 0 bone transform uvec y))) + (when (< 0.1 (fabs f0-0)) + (if (< (* f0-0 (-> this y-proj)) 0.0) + (+! (-> this roll-count) 0.5) + ) + (set! (-> this y-proj) f0-0) + ) + ) + ) + ) + (set! (-> this score) (-> this roll-count)) + 0 + (none) + ) + +;; definition of type task-manager-bbush-destroy-interceptors +(deftype task-manager-bbush-destroy-interceptors (task-manager-vehicle-bbush) + ((max-reserve-count int32) + ) + ) + +;; definition for method 3 of type task-manager-bbush-destroy-interceptors +(defmethod inspect ((this task-manager-bbush-destroy-interceptors)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush inspect))) + (t9-0 this) + ) + (format #t "~2Tmax-reserve-count: ~D~%" (-> this max-reserve-count)) + (label cfg-4) + this + ) + +;; definition for method 21 of type task-manager-bbush-destroy-interceptors +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-bbush-destroy-interceptors)) + (call-parent-method this) + (set! (-> this display-units) 1.0) + (set! (-> this time-limit) (seconds 120)) + (set! (-> this game-score) (the-as uint 16)) + (set! (-> this want-current-hud?) #f) + (set! (-> this max-reserve-count) 1000) + (set! (-> *wasbbv-hud-info* score-text) (text-id text-07f6)) + (set! (-> *wasbbv-hud-info* decimal-place-count) 0) + (set! (-> *was-squad-control* target-count) 0) + 0 + (none) + ) + +;; definition for method 26 of type task-manager-bbush-destroy-interceptors +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-bbush-destroy-interceptors)) + (let ((t9-0 (method-of-type task-manager-vehicle-bbush task-manager-method-26))) + (t9-0 this) + ) + (when (nonzero? (-> this start-time)) + (let ((v1-3 *was-squad-control*)) + (set! (-> this score) + (the float (- (- (-> this max-reserve-count) (-> v1-3 reserve-count)) (-> v1-3 active-count))) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 35 of type task-manager-bbush-destroy-interceptors +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-vehicle-bbush-method-35 ((this task-manager-bbush-destroy-interceptors)) + (set-setting! 'music 'desdstry 0.0 0) + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + (let ((v1-4 *was-squad-control*)) + (set! (-> v1-4 target-count) 4) + (set! (-> v1-4 reserve-count) (- (-> this max-reserve-count) (-> v1-4 active-count))) + ) + 0 + (none) + ) + +;; definition for method 28 of type task-manager-bbush-destroy-interceptors +;; WARN: Return type mismatch sound-id vs none. +(defmethod task-manager-method-28 ((this task-manager-bbush-destroy-interceptors)) + (talker-spawn-func (-> *talker-speech* 317) *entity-pool* (target-pos 0) (the-as region #f)) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc new file mode 100644 index 0000000000..f7f6ff8198 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/des-burning-bush_REF.gc @@ -0,0 +1,1756 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-desert-totem-eye-glow + :id 379 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 1584 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 1584 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.8)) + (:rot-x (degrees 1.125)) + (:scale-y (meters 1.2)) + (:r 80.0 20.0) + (:g 255.0) + (:b 255.0) + (:a 40.0 4.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-totem-eye-glow-pre + :id 380 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 5) + :parts ((sp-item 1585 :flags (sp6 sp7)) (sp-item 1586 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 1585 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.8)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 1.5)) + (:r 80.0 20.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 1586 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 0.8)) + (:rot-x (degrees 2.25)) + (:scale-y (meters 1.2)) + (:r 80.0 20.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + (:rotate-y (degrees 0)) + ) + ) + +;; definition of type bbush-menu-item +(deftype bbush-menu-item (structure) + ((text text-id) + (node game-task-node) + ) + ) + +;; definition for method 3 of type bbush-menu-item +(defmethod inspect ((this bbush-menu-item)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bbush-menu-item) + (format #t "~1Ttext: ~D~%" (-> this text)) + (format #t "~1Tnode: ~D~%" (-> this node)) + (label cfg-4) + this + ) + +;; definition of type bbush-menu +(deftype bbush-menu (structure) + ((title-text text-id) + (req-text text-id) + (req-check (function symbol)) + (item-count int8) + (items bbush-menu-item 10 :inline) + ) + ) + +;; definition for method 3 of type bbush-menu +(defmethod inspect ((this bbush-menu)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'bbush-menu) + (format #t "~1Ttitle-text: ~D~%" (-> this title-text)) + (format #t "~1Treq-text: ~D~%" (-> this req-text)) + (format #t "~1Treq-check: ~A~%" (-> this req-check)) + (format #t "~1Titem-count: ~D~%" (-> this item-count)) + (format #t "~1Titems[10] @ #x~X~%" (-> this items)) + (label cfg-4) + this + ) + +;; definition for symbol *bbush-menu*, type bbush-menu +(define *bbush-menu* (new 'static 'bbush-menu + :title-text (text-id text-0624) + :req-text (text-id text-0860) + :req-check (lambda () (case (-> *game-info* current-vehicle) + ((13 16 18 19) + #t + ) + (else + #f + ) + ) + ) + :item-count 5 + :items (new 'static 'inline-array bbush-menu-item 10 + (new 'static 'bbush-menu-item + :text (text-id text-0629) + :node (game-task-node desert-bbush-air-time-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-0628) + :node (game-task-node desert-bbush-total-air-time-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-062b) + :node (game-task-node desert-bbush-jump-distance-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-062a) + :node (game-task-node desert-bbush-total-jump-distance-introduction) + ) + (new 'static 'bbush-menu-item + :text (text-id text-062c) + :node (game-task-node desert-bbush-roll-count-introduction) + ) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + (new 'static 'bbush-menu-item) + ) + ) + ) + +;; definition of type des-burning-bush +(deftype des-burning-bush (process-focusable) + ((task game-task-control) + (part-off sparticle-launch-control) + (angle float) + (time float) + (rotmin float) + (rotmax float) + (bb-perm entity-perm) + (menu bbush-menu) + (menu-node game-task-node-info) + (menu-exit? symbol) + (menu-have-req? symbol) + (message-id text-id) + (required-vehicles game-vehicles) + ) + (:state-methods + idle + talking + menu + collect-gems + ) + (:methods + (des-burning-bush-method-32 (_type_) none) + (des-burning-bush-method-33 (_type_) none) + (des-burning-bush-method-34 (_type_) object) + (des-burning-bush-method-35 (_type_) none) + (des-burning-bush-method-36 (_type_) none) + (des-burning-bush-method-37 (_type_) none) + (des-burning-bush-method-38 (_type_) none) + ) + ) + +;; definition for method 3 of type des-burning-bush +(defmethod inspect ((this des-burning-bush)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Ttask: ~A~%" (-> this task)) + (format #t "~2Tpart-off: ~A~%" (-> this part-off)) + (format #t "~2Tangle: ~f~%" (-> this angle)) + (format #t "~2Ttime: ~f~%" (-> this time)) + (format #t "~2Trotmin: ~f~%" (-> this rotmin)) + (format #t "~2Trotmax: ~f~%" (-> this rotmax)) + (format #t "~2Tbb-perm: #~%" (-> this bb-perm)) + (format #t "~2Tmenu: #~%" (-> this menu)) + (format #t "~2Tmenu-node: ~A~%" (-> this menu-node)) + (format #t "~2Tmenu-exit?: ~A~%" (-> this menu-exit?)) + (format #t "~2Tmenu-have-req?: ~A~%" (-> this menu-have-req?)) + (format #t "~2Tmessage-id: ~D~%" (-> this message-id)) + (format #t "~2Trequired-vehicles: ~D~%" (-> this required-vehicles)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-des-burning-bush des-burning-bush des-burning-bush-lod0-jg des-burning-bush-idle-ja + ((des-burning-bush-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3.5) + ) + +;; definition for method 36 of type des-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-36 ((this des-burning-bush)) + (let ((a0-2 (get-current-task-event (-> this task)))) + (if (= (-> a0-2 action) (game-task-action menu)) + (go (method-of-object this menu)) + (go (method-of-object this talking)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (des-burning-bush) + :virtual #t + :exit (behavior () + '() + ) + :trans (behavior () + (local-vars (v1-43 process)) + (setup-masks (-> self draw) 2 4) + (let ((gp-0 (get-current-task-event (-> self task))) + (s5-0 #f) + ) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-1 (-> self node-list data 3 bone transform)) + (v1-5 (-> a2-1 rvec quad)) + (a0-2 (-> a2-1 uvec quad)) + (a1-1 (-> a2-1 fvec quad)) + (a2-2 (-> a2-1 trans quad)) + ) + (set! (-> s4-0 rvec quad) v1-5) + (set! (-> s4-0 uvec quad) a0-2) + (set! (-> s4-0 fvec quad) a1-1) + (set! (-> s4-0 trans quad) a2-2) + ) + (when (< (vector-dot + (-> s4-0 fvec) + (vector-! (new 'stack-no-clear 'vector) (camera-pos) (matrix->trans s4-0 (new 'stack-no-clear 'vector))) + ) + 0.0 + ) + ) + ) + (cond + (#f + (set! s5-0 #t) + ) + ((= (-> gp-0 action) (game-task-action show)) + (setup-masks (-> self draw) 4 2) + ) + ((= (-> gp-0 action) (game-task-action play)) + ) + ((= (-> gp-0 action) (game-task-action menu)) + ) + (else + ) + ) + (cond + ((and (not s5-0) + (or (= (-> gp-0 action) (game-task-action show)) (= (-> gp-0 action) (game-task-action menu))) + (and (des-burning-bush-method-34 self) (can-display-query? self (the-as string #f) -99.0)) + ) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 300 0.0 (font-color default) (font-flags shadow kerning)) + ) + (gp-1 (-> gp-0 tex)) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning large)) + (let ((v1-28 s5-1)) + (set! (-> v1-28 width) (the float 340)) + ) + (let ((v1-29 s5-1)) + (set! (-> v1-29 height) (the float 80)) + ) + (let ((v1-30 s5-1) + (a0-16 (-> *setting-control* user-default language)) + ) + (set! (-> v1-30 scale) (if (or (= a0-16 (language-enum korean)) (= a0-16 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (let ((v1-33 (-> self entity extra perm))) + (logior! (-> v1-33 status) (entity-perm-status bit-5)) + (set! (-> self bb-perm) v1-33) + (logior! (-> v1-33 status) (entity-perm-status bit-14)) + ) + (cond + ((and (nonzero? (-> self required-vehicles)) + (or (not (logtest? (-> self required-vehicles) (ash 1 (the-as int (-> *game-info* current-vehicle))))) + (begin + (set! v1-43 (handle->process (-> *vehicle-info* handle-by-vehicle-type (-> *game-info* current-vehicle)))) + (not v1-43) + ) + (< 245760.0 (vector-vector-distance (-> (the-as vehicle v1-43) root trans) (target-pos 0))) + ) + ) + (print-game-text + (lookup-text! *common-text* (text-id text-085f) #f) + s5-1 + #f + 44 + (bucket-id hud-draw-hud-alpha) + ) + ) + (else + (cond + ((zero? (-> self bb-perm user-object 0)) + (let ((s4-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-061d) #f) gp-1) + (s4-2 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (logior! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + (else + (let ((s4-3 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id press-triangle-to-talk) #f)) + (s4-3 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (cond + ((and (zero? (-> self bb-perm user-object 0)) + (or (= gp-1 (the int (-> *target* game gem))) + (< (the-as uint gp-1) (the-as uint (the int (-> *target* game gem)))) + ) + ) + (set! (-> self bb-perm user-object 0) 1) + (go-virtual collect-gems) + ) + ((= (-> self bb-perm user-object 0) 1) + (des-burning-bush-method-36 self) + ) + (else + (sound-play "skull-negative") + ) + ) + ) + ) + ) + ) + ) + (else + (if *hud-skullgem* + (logclear! (-> *hud-skullgem* 0 flags) (hud-flags show)) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 12288.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + (des-burning-bush-method-35 self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate collect-gems (des-burning-bush) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + (process-release? *target*) + ) + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (let ((gp-0 (-> (get-current-task-event (-> self task)) tex))) + (format 0 "skull-cost: ~d~%" gp-0) + (set! (-> *target* game gem) (- (-> *target* game gem) (the float gp-0))) + (until (time-elapsed? (-> self state-time) (* 45 (the-as int gp-0))) + (suspend) + ) + ) + (des-burning-bush-method-36 self) + ) + :post (behavior () + (des-burning-bush-method-35 self) + ) + ) + +;; failed to figure out what this is: +(defstate talking (des-burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set! (-> self time) -1.0) + (process-entity-status! self (entity-perm-status no-kill) #t) + ) + :exit (behavior () + (remove-setting! 'music-volume) + (remove-setting! 'sfx-volume) + (remove-setting! 'dialog-volume) + (remove-setting! 'minimap) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((gp-0 (new 'stack-no-clear 'des-burning-bush-stack-var0))) + (when (!= (-> self time) -1.0) + (quaternion-rotate-local-y! + (-> gp-0 quat) + (-> self root quat) + (lerp-scale (-> self rotmin) (-> self rotmax) (sin (* 7281.778 (-> self time))) -1.0 1.0) + ) + (vector-orient-by-quat! (-> gp-0 vec2) (new 'static 'vector :y 16384.0 :z 40960.0 :w 1.0) (-> gp-0 quat)) + (vector+! (-> gp-0 vec1) (-> self root trans) (-> gp-0 vec2)) + (set! (-> *camera* slave 0 trans quad) (-> gp-0 vec1 quad)) + (let ((v1-10 (-> gp-0 vec2))) + (let ((a0-9 (-> self root trans))) + (let ((a1-4 *up-vector*)) + (let ((a2-4 12288.0)) + (.mov vf7 a2-4) + ) + (.lvf vf5 (&-> a1-4 quad)) + ) + (.lvf vf4 (&-> a0-9 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-10 quad) vf6) + ) + (vector-! (-> gp-0 vec3) (-> gp-0 vec2) (-> gp-0 vec1)) + (forward-down->inv-matrix + (the-as matrix (-> *camera* slave 0 tracking)) + (-> gp-0 vec3) + (-> *camera* local-down) + ) + ) + (let* ((v1-17 (-> gp-0 mat)) + (a3-1 (-> self node-list data 3 bone transform)) + (a0-14 (-> a3-1 rvec quad)) + (a1-8 (-> a3-1 uvec quad)) + (a2-6 (-> a3-1 fvec quad)) + (a3-2 (-> a3-1 trans quad)) + ) + (set! (-> v1-17 rvec quad) a0-14) + (set! (-> v1-17 uvec quad) a1-8) + (set! (-> v1-17 fvec quad) a2-6) + (set! (-> v1-17 trans quad) a3-2) + ) + (matrix->trans (-> gp-0 mat) (-> gp-0 vec2)) + (vector-! (-> gp-0 vec2) (camera-pos) (-> gp-0 vec2)) + (when (< (vector-dot (-> gp-0 mat fvec) (-> gp-0 vec2)) 0.0) + (matrix-rotate-y! (the-as matrix (-> gp-0 vec0)) 32768.0) + (matrix*! (-> gp-0 mat) (the-as matrix (-> gp-0 vec0)) (-> gp-0 mat)) + ) + ) + (+! (-> self angle) (* 100.0 (rand-vu))) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (suspend) + (if *target* + (set! (-> *target* neck flex-blend) 1.0) + ) + (add-setting! 'music-volume 'rel (-> *setting-control* user-current music-volume-movie) 0) + (add-setting! 'sfx-volume 'rel (-> *setting-control* user-current sfx-volume-movie) 0) + (add-setting! 'dialog-volume 'rel (-> *setting-control* user-current dialog-volume-talker) 0) + (set-time! (-> self state-time)) + (let* ((v1-21 (get-current-task-event (-> self task))) + (gp-0 (add-process *gui-control* self (gui-channel bbush) (gui-action play) (-> v1-21 scene) -99.0 0)) + ) + (let ((s5-0 (current-time))) + (while (and (nonzero? (get-status *gui-control* gp-0)) (not (time-elapsed? s5-0 (seconds 60)))) + (set! (-> self time) (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (suspend) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "inter-burn-bush") + (goto cfg-13) + ) + ) + ) + (label cfg-13) + (set-action! + *gui-control* + (gui-action stop) + gp-0 + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (task-node-close! (-> self task current-node) 'event) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 12288.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + (des-burning-bush-method-35 self) + ) + ) + ) + +;; definition for method 37 of type des-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-37 ((this des-burning-bush)) + (let ((s5-0 (new 'stack-no-clear 'bbush-menu-state))) + (set! (-> s5-0 cur) 0) + (set! (-> s5-0 idx) 0) + (dotimes (s4-0 (-> this menu item-count)) + (let* ((s2-0 (-> this menu items s4-0)) + (s3-0 (task-node-open? (-> s2-0 node))) + (v1-2 (task-node-closed? (-> s2-0 node))) + ) + (when (or s3-0 v1-2) + (if v1-2 + (set! (-> s5-0 idx) s4-0) + ) + (+! (-> s5-0 cur) 1) + ) + ) + ) + (when (cpad-pressed? 0 down l-analog-down) + (+! (-> s5-0 idx) 1) + (if (< (+ (-> s5-0 cur) -1) (-> s5-0 idx)) + (set! (-> s5-0 idx) (+ (-> s5-0 cur) -1)) + (sound-play "menu-up-down") + ) + ) + (when (cpad-pressed? 0 up l-analog-up) + (+! (-> s5-0 idx) -1) + (cond + ((< (-> s5-0 idx) 0) + (set! (-> s5-0 idx) 0) + 0 + ) + (else + (sound-play "menu-up-down") + ) + ) + ) + (task-node-close! (-> this menu items (-> s5-0 idx) node) 'event) + (when (cpad-pressed? 0 confirm) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (set! (-> this menu-node) (-> *game-info* sub-task-list (-> this menu items (-> s5-0 idx) node))) + (set! (-> this menu-exit?) #t) + ) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (dotimes (s4-3 (-> this menu item-count)) + (let ((v1-57 (-> this menu items s4-3))) + (task-node-open! (-> v1-57 node) 'event) + ) + ) + (set! (-> this menu-node) #f) + (set! (-> this menu-exit?) #t) + ) + (let ((s4-4 + (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + 1.0 + (let* ((v1-67 (-> *setting-control* user-default language)) + (f30-0 (cond + ((= v1-67 (language-enum korean)) + 1.8 + ) + ((= v1-67 (language-enum russian)) + 1.5 + ) + ((= v1-67 (language-enum english)) + 1.3 + ) + ((= v1-67 (language-enum german)) + 1.3 + ) + ((= v1-67 (language-enum spanish)) + 1.1 + ) + ((= v1-67 (language-enum portuguese)) + 1.0 + ) + (else + 1.2 + ) + ) + ) + ) + (set! (-> s5-0 fnt-height) 40) + (set! (-> s5-0 fnt-origin-x) 36) + (set! (-> s5-0 fnt-origin-y) (- 228 (* (-> s5-0 cur) (/ (-> s5-0 fnt-height) 2)))) + (set! (-> s4-4 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-74 s4-4)) + (set! (-> v1-74 width) (the float 440)) + ) + (let ((v1-75 s4-4)) + (set! (-> v1-75 height) (the float 50)) + ) + (let ((v1-76 s4-4)) + (set! (-> v1-76 scale) (* 0.8 f30-0)) + ) + (let ((v1-77 s4-4) + (a1-7 (-> s5-0 fnt-origin-x)) + (a0-61 40) + ) + (set! (-> v1-77 origin x) (the float a1-7)) + (set! (-> v1-77 origin y) (the float a0-61)) + ) + (let ((a0-62 s4-4)) + (set! (-> a0-62 color) (font-color progress-old-yellow)) + ) + (let ((s3-3 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu title-text) #f)) + (s3-3 *temp-string* s4-4 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-81 s4-4)) + (set! (-> v1-81 height) (the float (-> s5-0 fnt-height))) + ) + (dotimes (s3-4 (-> s5-0 cur)) + (let ((v1-82 s4-4) + (a1-11 (-> s5-0 fnt-origin-x)) + (a0-68 (-> s5-0 fnt-origin-y)) + ) + (set! (-> v1-82 origin x) (the float a1-11)) + (set! (-> v1-82 origin y) (the float a0-68)) + ) + (let ((v1-83 s4-4)) + (set! (-> v1-83 scale) (* f30-0 (if (= s3-4 (-> s5-0 idx)) + 0.45 + 0.4 + ) + ) + ) + ) + (let ((v1-84 s4-4)) + (set! (-> v1-84 color) (if (= s3-4 (-> s5-0 idx)) + (font-color progress-old-selected) + (font-color default) + ) + ) + ) + (let ((s2-2 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu items s3-4 text) #f)) + (s2-2 *temp-string* s4-4 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (+! (-> s5-0 fnt-origin-y) (-> s5-0 fnt-height)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type des-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-38 ((this des-burning-bush)) + (when (or (cpad-pressed? 0 confirm) (cpad-pressed? 0 triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle circle x confirm)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle circle x confirm)) + (set! (-> this menu-node) #f) + (set! (-> this menu-exit?) #t) + ) + (let ((s5-0 + (new 'stack 'font-context *font-default-matrix* 0 0 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'des-burning-bush-stack-var1))) + (set! (-> s4-0 word0) 120) + (set! (-> s4-0 fnt-origin-x) 36) + (let ((v1-14 (-> *setting-control* user-default language))) + (set! (-> s4-0 scale) (if (or (= v1-14 (language-enum korean)) (= v1-14 (language-enum russian))) + 0.9 + 0.7 + ) + ) + ) + (set! (-> s5-0 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-18 s5-0) + (a1-2 (-> s4-0 fnt-origin-x)) + (a0-21 40) + ) + (set! (-> v1-18 origin x) (the float a1-2)) + (set! (-> v1-18 origin y) (the float a0-21)) + ) + (let ((v1-19 s5-0)) + (set! (-> v1-19 width) (the float 440)) + ) + (let ((v1-20 s5-0)) + (set! (-> v1-20 height) (the float 50)) + ) + (let ((v1-21 s5-0)) + (set! (-> v1-21 scale) 1.0) + ) + (let ((a0-25 s5-0)) + (set! (-> a0-25 color) (font-color progress-old-yellow)) + ) + (let ((s3-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu title-text) #f)) + (s3-0 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-25 s5-0)) + (set! (-> v1-25 height) (the float 230)) + ) + (let ((v1-26 s5-0) + (a1-6 (-> s4-0 fnt-origin-x)) + (a0-31 98) + ) + (set! (-> v1-26 origin x) (the float a1-6)) + (set! (-> v1-26 origin y) (the float a0-31)) + ) + (let ((v1-27 s5-0)) + (set! (-> v1-27 scale) (-> s4-0 scale)) + ) + (let ((a0-32 s5-0)) + (set! (-> a0-32 color) (font-color default)) + ) + (let ((s3-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (-> this menu req-text) #f)) + (s3-1 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + (let ((v1-31 s5-0) + (a1-10 (-> s4-0 fnt-origin-x)) + (a0-37 328) + ) + (set! (-> v1-31 origin x) (the float a1-10)) + (set! (-> v1-31 origin y) (the float a0-37)) + ) + (let ((v1-32 s5-0)) + (set! (-> v1-32 height) (the float 50)) + ) + (let ((v1-33 s5-0)) + (set! (-> v1-33 scale) (-> s4-0 scale)) + ) + ) + (let ((a0-39 s5-0)) + (set! (-> a0-39 color) (font-color default)) + ) + (let ((gp-1 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-007c) #f)) + (gp-1 *temp-string* s5-0 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate menu (des-burning-bush) + :virtual #t + :enter (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (set-setting! 'allow-progress #f 0.0 0) + (set! (-> self time) -1.0) + (set! (-> self menu-exit?) #f) + (set! (-> self menu-have-req?) #t) + (set! (-> self menu) *bbush-menu*) + (let ((t9-2 (-> self menu req-check))) + (if t9-2 + (set! (-> self menu-have-req?) (t9-2)) + ) + ) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (remove-setting! 'minimap) + (remove-setting! 'allow-progress) + (send-event *camera* 'change-target *target*) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + ) + :trans (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (and (time-elapsed? (-> self state-time) (seconds 1.5)) (not (-> self menu-exit?))) + (if (-> self menu-have-req?) + (des-burning-bush-method-37 self) + (des-burning-bush-method-38 self) + ) + ) + (when (!= (-> self time) -1.0) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (vector+! gp-0 (-> self root trans) (vector-orient-by-quat! + (new 'stack-no-clear 'vector) + (new 'static 'vector :y 24166.4 :z 32768.0 :w 1.0) + (-> self root quat) + ) + ) + (set! (-> *camera* slave 0 trans quad) (-> gp-0 quad)) + (let ((t9-3 forward-down->inv-matrix) + (a0-7 (-> *camera* slave 0 tracking)) + (a1-1 (new 'stack-no-clear 'vector)) + (v1-23 (new 'stack-no-clear 'vector)) + ) + (let ((a2-2 (-> self root trans))) + (let ((a3-0 *up-vector*)) + (let ((t0-1 24166.4)) + (.mov vf7 t0-1) + ) + (.lvf vf5 (&-> a3-0 quad)) + ) + (.lvf vf4 (&-> a2-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-23 quad) vf6) + (t9-3 (the-as matrix a0-7) (vector-! a1-1 v1-23 gp-0) (-> *camera* local-down)) + ) + ) + ) + ) + ) + :code (behavior () + (set-setting! 'mode-name 'cam-really-fixed 0.0 0) + (suspend) + (until (process-grab? *target* #f) + (suspend) + ) + (set! (-> self time) 0.0) + (while (not (-> self menu-exit?)) + (suspend) + ) + (when (-> self menu-node) + (set! (-> self message-id) (text-id null)) + (let ((a0-2 (-> self menu-node)) + (v1-7 (the-as game-task-event #f)) + ) + (countdown (a1-3 (-> a0-2 when-open length)) + (let ((a2-3 (-> a0-2 when-open a1-3))) + (if (= (-> self task actor) (-> a2-3 actor)) + (set! v1-7 a2-3) + ) + ) + ) + (if v1-7 + (set! (-> self message-id) + (the-as + text-id + (add-process *gui-control* self (gui-channel bbush) (gui-action play) (-> v1-7 scene) -99.0 0) + ) + ) + ) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.25)) + (suspend) + ) + ) + (set-time! (-> self state-time)) + (while (and (nonzero? (get-status *gui-control* (the-as sound-id (-> self message-id)))) + (not (time-elapsed? (-> self state-time) (seconds 60))) + ) + (set! (-> self time) (* 0.0033333334 (the float (- (current-time) (-> self state-time))))) + (suspend) + (when (cpad-pressed? 0 triangle) + (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) + (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) + (sound-play "inter-burn-bush") + ) + ) + (set-action! + *gui-control* + (gui-action stop) + (the-as sound-id (-> self message-id)) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + ) + (until (process-release? *target*) + (suspend) + ) + (go-virtual idle) + ) + :post (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let* ((a0-0 (-> *target* neck)) + (t9-0 (method-of-object a0-0 look-at!)) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-5 (-> self root trans))) + (let ((a2-0 *up-vector*)) + (let ((a3-1 20480.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-0 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-0 quad) vf6) + (t9-0 a0-0 a1-0 #f self) + ) + ) + (des-burning-bush-method-35 self) + ) + ) + ) + +;; definition for method 35 of type des-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-35 ((this des-burning-bush)) + (when (nonzero? (-> this part)) + (let ((s5-0 (get-current-task-event (-> this task)))) + (let ((v1-5 (-> this entity extra perm))) + (logior! (-> v1-5 status) (entity-perm-status bit-5)) + (set! (-> this bb-perm) v1-5) + (logior! (-> v1-5 status) (entity-perm-status bit-14)) + ) + (let* ((f30-0 (lerp-scale 15.0 128.0 (vector-vector-distance (camera-pos) (-> this root trans)) 163840.0 245760.0)) + (f28-0 15.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + (f0-4 (+ f28-0 (* (+ -1.0 (the-as float v1-10)) f30-0))) + ) + (cond + ((or (= (-> s5-0 action) (game-task-action play)) + (= (-> s5-0 action) (game-task-action show)) + (= (-> s5-0 action) (game-task-action menu)) + ) + (cond + ((= (-> this bb-perm user-object 0) 1) + (spawn-from-cspace (-> this part-off) (-> this node-list data 4)) + (spawn-from-cspace (-> this part-off) (-> this node-list data 5)) + ) + (else + (set! (-> *part-id-table* 1585 init-specs 11 initial-valuef) f0-4) + (set! (-> *part-id-table* 1586 init-specs 11 initial-valuef) (* 0.5 f0-4)) + (spawn-from-cspace (-> this part) (-> this node-list data 4)) + (spawn-from-cspace (-> this part) (-> this node-list data 5)) + ) + ) + ) + (else + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 34 of type des-burning-bush +(defmethod des-burning-bush-method-34 ((this des-burning-bush)) + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> this root trans))) + (f30-0 (vector-dot (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + (f0-2 (vector-dot (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat)) gp-1)) + ) + (and *target* + (not (focus-test? *target* pilot)) + (< (fabs f30-0) 10240.0) + (< 0.0 f0-2) + (< (fabs f0-2) 20480.0) + ) + ) + ) + +;; definition for method 32 of type des-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-32 ((this des-burning-bush)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-6 prim-core action) (collide-action solid rideable)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 33 of type des-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-33 ((this des-burning-bush)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-des-burning-bush" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +;; definition for method 7 of type des-burning-bush +;; WARN: Return type mismatch process-focusable vs des-burning-bush. +(defmethod relocate ((this des-burning-bush) (offset int)) + (if (nonzero? (-> this task)) + (&+! (-> this task) offset) + ) + (if (nonzero? (-> this part-off)) + (&+! (-> this part-off) offset) + ) + (the-as des-burning-bush ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 10 of type des-burning-bush +(defmethod deactivate ((this des-burning-bush)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part-off)) + (kill-particles (-> this part-off)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 12 of type des-burning-bush +(defmethod run-logic? ((this des-burning-bush)) + "Should this process be run? Checked by execute-process-tree." + (or (not (logtest? (-> this mask) (process-mask actor-pause))) + (or (and (nonzero? (-> this draw)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> this root pause-adjust-distance)) + (vector-vector-distance (-> this root trans) (math-camera-pos)) + ) + ) + (and (nonzero? (-> this skel)) (!= (-> this skel root-channel 0) (-> this skel channel))) + (and (nonzero? (-> this draw)) (logtest? (-> this draw status) (draw-control-status uninited))) + ) + ) + ) + +;; definition for method 11 of type des-burning-bush +(defmethod init-from-entity! ((this des-burning-bush) (arg0 entity-actor)) + (des-burning-bush-method-32 this) + (process-drawable-from-entity! this arg0) + (des-burning-bush-method-33 this) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-0 0.0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-0) + ) + ) + (set! (-> this required-vehicles) (res-lump-value arg0 'vehicle-type-mask game-vehicles :time -1000000000.0)) + (set! (-> this rotmin) (res-lump-float arg0 'rotmin :default -5461.3335)) + (set! (-> this rotmax) (res-lump-float arg0 'rotmax :default 5461.3335)) + (set! (-> this task) + (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) + ) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 380) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 379) this)) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition of type burning-bush-get-on-info +(deftype burning-bush-get-on-info (structure) + ((trans vector :inline) + (quat quaternion :inline) + (camera-trans vector :inline) + (camera-rot float 9) + (time float) + (fov float) + ) + ) + +;; definition for method 3 of type burning-bush-get-on-info +(defmethod inspect ((this burning-bush-get-on-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'burning-bush-get-on-info) + (format #t "~1Ttrans: #~%" (-> this trans)) + (format #t "~1Tquat: #~%" (-> this quat)) + (format #t "~1Tcamera-trans: #~%" (-> this camera-trans)) + (format #t "~1Tcamera-rot[9] @ #x~X~%" (-> this camera-rot)) + (format #t "~1Ttime: ~f~%" (-> this time)) + (format #t "~1Tfov: ~f~%" (-> this fov)) + (label cfg-4) + this + ) + +;; definition for symbol *burning-bush-get-on-info*, type (array burning-bush-get-on-info) +(define *burning-bush-get-on-info* + (new 'static 'boxed-array :type burning-bush-get-on-info + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 15826067.0 :y 294066.6 :z 2348413.8 :w 1.0) + :quat (new 'static 'quaternion :x 0.0009 :y 0.4808 :z 0.0009 :w -0.8768) + :camera-trans (new 'static 'vector :x 15828972.0 :y 307578.47 :z 2379081.2 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9999 0.0 0.0074 -0.0009 0.9911 -0.1331 -0.0074 -0.1331 -0.991) + :time 6000.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 3697802.5 :y 412520.44 :z 6895680.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.9992 :w 0.0389) + :camera-trans (new 'static 'vector :x 3630403.2 :y 428921.66 :z 6831057.5 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8029 0.0 -0.596 0.0794 0.991 0.1069 0.5907 -0.1332 0.7957) + :time 6900.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 5819480.5 :y 388060.38 :z 1678595.2 :w 1.0) + :quat (new 'static 'quaternion :x 0.0013 :y -0.1948 :z -0.0003 :w 0.9808) + :camera-trans (new 'static 'vector :x 5774928.5 :y 468702.4 :z 1851368.2 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.8883 0.0 -0.4591 0.0899 0.9806 -0.174 0.4502 -0.1959 -0.8711) + :time 9000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 12843417.0 :y 89547.57 :z 11022830.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0015 :y 0.8039 :z 0.0002 :w 0.5946) + :camera-trans (new 'static 'vector :x 12865863.0 :y 96517.734 :z 11012419.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4931 0.0 0.8699 0.2364 0.9623 -0.134 -0.8372 0.2718 0.4745) + :time 5100.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 11575935.0 :y 108180.27 :z 14247904.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.1133 :w 0.9935) + :camera-trans (new 'static 'vector :x 11535285.0 :y 121128.55 :z 14248524.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0416 0.0 -0.9991 0.1031 0.9946 0.0042 0.9937 -0.1031 0.0413) + :time 9000.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 5470401.5 :y 51780.402 :z 7791442.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.8257 :z 0.0015 :w 0.5639) + :camera-trans (new 'static 'vector :x 5550344.5 :y 55626.137 :z 7814714.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2121 0.0 0.9772 -0.0007 0.9999 -0.0001 -0.9772 -0.0007 -0.2121) + :time 3900.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 2951720.2 :y 185922.36 :z 12151224.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0014 :y 0.4042 :z 0.0005 :w 0.9146) + :camera-trans (new 'static 'vector :x 2932693.0 :y 185689.3 :z 12123397.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9698 0.0 -0.2435 -0.1039 0.9044 -0.4138 0.2202 0.4266 0.8771) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 12339974.0 :y 181197.2 :z 1548690.2 :w 1.0) + :quat (new 'static 'quaternion :y 0.4266 :w 0.9044) + :camera-trans (new 'static 'vector :x 12309206.0 :y 227872.36 :z 1644105.8 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9842 0.0 0.1767 -0.0231 0.9913 -0.1291 -0.1751 -0.1311 -0.9757) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 7752197.0 :y 216207.36 :z 923399.8 :w 1.0) + :quat (new 'static 'quaternion :y -0.951 :w 0.3089) + :camera-trans (new 'static 'vector :x 7668311.0 :y 260772.25 :z 917091.56 :w 1.0) + :camera-rot (new 'static 'array float 9 0.2895 0.0 -0.9571 0.4737 0.8689 0.1433 0.8317 -0.4949 0.2515) + :time 5100.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 1969225.4 :y 140065.6 :z 5292424.5 :w 1.0) + :quat (new 'static 'quaternion :y 0.788 :w -0.6156) + :camera-trans (new 'static 'vector :x 2006893.0 :y 160366.19 :z 5227043.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.752 0.0 0.659 0.0335 0.9987 -0.0383 -0.6582 0.0509 0.751) + :time 8400.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 12238691.0 :y 98111.9 :z 11890045.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0014 :y 0.5531 :z -0.0006 :w 0.833) + :camera-trans (new 'static 'vector :x 12326140.0 :y 148922.38 :z 11845758.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.7859 0.0 0.6183 -0.166 0.9632 0.211 -0.5956 -0.2684 0.757) + :time 6000.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9236149.0 :y 43447.5 :z 6553425.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7227 :w 0.6911) + :camera-trans (new 'static 'vector :x 9367670.0 :y 67202.664 :z 6607653.5 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.3072 0.0 0.9516 0.1112 0.9931 0.0359 -0.9451 0.1169 -0.3051) + :time 4800.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 10618439.0 :y 113487.875 :z 10291461.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0008 :y 0.9917 :z -0.0011 :w 0.1277) + :camera-trans (new 'static 'vector :x 10764415.0 :y 127953.305 :z 10306016.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0476 0.0 0.9988 -0.1626 0.9866 0.0077 -0.9855 -0.1628 0.047) + :time 7500.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 529121.7 :y 98823.375 :z 13884964.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9481 :w -0.3177) + :camera-trans (new 'static 'vector :x 722918.2 :y 101507.07 :z 13901837.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2403 0.0 0.9706 0.264 0.9623 0.0653 -0.934 0.2719 -0.2313) + :time 7200.0 + :fov 16384.0 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 2273161.2 :y 250537.17 :z 15519410.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0007 :y -0.0731 :z -0.0014 :w 0.9973) + :camera-trans (new 'static 'vector :x 2312609.5 :y 318328.84 :z 15637414.0 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.9419 0.0 0.3356 -0.0852 0.9671 -0.2393 -0.3246 -0.254 -0.911) + :time 9300.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 16549387.0 :y 106001.2 :z 6772071.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8949 :w 0.4461) + :camera-trans (new 'static 'vector :x 16576971.0 :y 121950.21 :z 6763736.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.4199 0.0 0.9075 -0.1935 0.9769 0.0895 -0.8866 -0.2132 0.4102) + :time 5400.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 15726801.0 :y 114936.22 :z 295390.4 :w 1.0) + :quat (new 'static 'quaternion :x -0.0014 :y -0.7325 :z 0.0007 :w -0.6807) + :camera-trans (new 'static 'vector :x 15773588.0 :y 124979.2 :z 296459.88 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.0256 0.0 0.9996 -0.0761 0.997 -0.0019 -0.9967 -0.0762 -0.0255) + :time 6300.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9514424.0 :y 84128.56 :z -182453.05 :w 1.0) + :quat (new 'static 'quaternion :x -0.0015 :y 0.8943 :w 0.4472) + :camera-trans (new 'static 'vector :x 9527463.0 :y 95552.305 :z -169796.81 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.7222 0.0 0.6916 -0.0674 0.9952 -0.0704 -0.6883 -0.0975 -0.7188) + :time 6300.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9272824.0 :y 78754.2 :z -690128.9 :w 1.0) + :quat (new 'static 'quaternion :x 0.0002 :y 0.0607 :z 0.0013 :w 0.9981) + :camera-trans (new 'static 'vector :x 9232619.0 :y 192907.27 :z -843155.44 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9996 0.0 -0.0251 0.0133 0.8478 0.53 0.0213 -0.5302 0.8475) + :time 7800.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9916865.0 :y 155500.14 :z -484290.56 :w 1.0) + :quat (new 'static 'quaternion :x -0.0013 :y 0.8336 :z 0.0005 :w -0.5522) + :camera-trans (new 'static 'vector :x 10009599.0 :y 164922.58 :z -486762.9 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.2507 0.0 0.968 -0.0206 0.9997 -0.0053 -0.9678 -0.0213 -0.2506) + :time 7500.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 9770632.0 :y 73132.85 :z -612405.7 :w 1.0) + :quat (new 'static 'quaternion :y 0.0576 :z -0.0015 :w -0.9983) + :camera-trans (new 'static 'vector :x 9774927.0 :y 94098.64 :z -681817.3 :w 1.0) + :camera-rot (new 'static 'array float 9 0.9577 0.0 0.2876 -0.0753 0.965 0.251 -0.2776 -0.262 0.9242) + :time 8100.0 + :fov 7281.778 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 6649945.5 :y 156115.36 :z -1471328.6 :w 1.0) + :quat (new 'static 'quaternion :x -0.0008 :y -0.731 :z 0.0013 :w -0.6823) + :camera-trans (new 'static 'vector :x 6694340.5 :y 174896.75 :z -1490136.6 :w 1.0) + :camera-rot (new 'static 'array float 9 0.0245 0.0 0.9996 -0.1697 0.9854 0.0041 -0.9851 -0.1698 0.0241) + :time 6900.0 + :fov 14563.556 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 7562680.5 :y 78961.05 :z -2169692.2 :w 1.0) + :quat (new 'static 'quaternion :x 0.0007 :y 0.734 :z 0.0012 :w 0.679) + :camera-trans (new 'static 'vector :x 7570156.5 :y 92349.65 :z -2207594.0 :w 1.0) + :camera-rot (new 'static 'array float 9 0.8539 0.0 0.5203 -0.0666 0.9917 0.1093 -0.516 -0.128 0.8469) + :time 7800.0 + :fov 10922.667 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 6538078.0 :y 288967.88 :z -777354.9 :w 1.0) + :quat (new 'static 'quaternion :x 0.0011 :y -0.8817 :z 0.0005 :w -0.4716) + :camera-trans (new 'static 'vector :x 6568851.5 :y 306831.78 :z -770489.94 :w 1.0) + :camera-rot (new 'static 'array float 9 -0.4012 0.0 0.9159 -0.151 0.9863 -0.0661 -0.9034 -0.1648 -0.3957) + :time 6600.0 + :fov 12743.111 + ) + (new 'static 'burning-bush-get-on-info + :trans (new 'static 'vector :x 6656705.5 :y 123696.74 :z -1911393.5 :w 1.0) + :quat (new 'static 'quaternion :x 0.0011 :y 0.3455 :z 0.0007 :w 0.9383) + :camera-trans (new 'static 'vector :x 6681104.0 :y 137490.02 :z -1923000.8 :w 1.0) + :camera-rot (new 'static 'array float 9 0.3877 0.0 0.9217 -0.2533 0.9614 0.1065 -0.8862 -0.2748 0.3727) + :time 5100.0 + :fov 14563.556 + ) + ) + ) + +;; definition of type task-manager-desert-bbush-get-to +(deftype task-manager-desert-bbush-get-to (task-manager) + ((skill handle) + (update-fov? symbol) + ) + (:methods + (task-manager-desert-bbush-get-to-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-desert-bbush-get-to +(defmethod inspect ((this task-manager-desert-bbush-get-to)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tskill: ~D~%" (-> this skill)) + (format #t "~2Tupdate-fov?: ~A~%" (-> this update-fov?)) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-desert-bbush-get-to +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-bbush-get-to-method-32 ((this task-manager-desert-bbush-get-to)) + (if (= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + ) + 0 + (none) + ) + +;; definition for method 21 of type task-manager-desert-bbush-get-to +(defmethod set-time-limit ((this task-manager-desert-bbush-get-to)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (task-manager-desert-bbush-get-to-method-32 this) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this update-fov?) #f) + (when (nonzero? (-> this skill)) + (let ((a0-5 (handle->process (-> this skill)))) + (if a0-5 + (deactivate a0-5) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-desert-bbush-get-to) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('notify) + (case (-> block param 0) + (('pickup) + (send-event self 'complete) + ) + (('die) + (send-event self 'fail) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (let ((t1-1 (new 'stack 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc))) + (a0-3 (new 'stack-no-clear 'vector)) + ) + (logior! (-> t1-1 options) (actor-option fade-out)) + (set! (-> t1-1 fade-time) + (the-as time-frame (the int (-> *burning-bush-get-on-info* (-> self info index) time))) + ) + (set! (-> a0-3 quad) (-> *burning-bush-get-on-info* (-> self info index) trans quad)) + (+! (-> a0-3 y) 4096.0) + (set! (-> self skill) + (ppointer->handle + (birth-pickup-at-point a0-3 (pickup-type skill) (-> *FACT-bank* super-skill-inc) #t self t1-1) + ) + ) + ) + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (+ 300.0 (-> *burning-bush-get-on-info* (-> self info index) time)))) + ) + (suspend) + (send-event (handle->process (-> self skill)) 'get-notify self) + (set-setting! 'interp-time 'abs 0.0 0) + (set-setting! 'mode-name 'cam-fixed 0.0 0) + (set! (-> *ACTOR-bank* birth-max) 1000) + (suspend) + (let ((f30-0 (-> *camera* settings fov))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *camera-combiner* trans quad)) + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-7 (-> *camera-combiner* inv-camera-rot)) + (v1-46 (-> a2-7 rvec quad)) + (a0-15 (-> a2-7 uvec quad)) + (a1-15 (-> a2-7 fvec quad)) + (a2-8 (-> a2-7 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-46) + (set! (-> gp-0 uvec quad) a0-15) + (set! (-> gp-0 fvec quad) a1-15) + (set! (-> gp-0 trans quad) a2-8) + ) + (let ((s4-0 (new 'stack 'transformq))) + (let ((v1-52 (-> *burning-bush-get-on-info* (-> self info index))) + (a1-17 (new 'stack-no-clear 'matrix)) + ) + (set! (-> s4-0 trans quad) (-> v1-52 camera-trans quad)) + (set-vector! (-> s4-0 scale) 1.0 1.0 1.0 1.0) + (set! (-> a1-17 rvec x) (-> v1-52 camera-rot 0)) + (set! (-> a1-17 rvec y) (-> v1-52 camera-rot 1)) + (set! (-> a1-17 rvec z) (-> v1-52 camera-rot 2)) + (set! (-> a1-17 rvec w) 0.0) + (set! (-> a1-17 uvec x) (-> v1-52 camera-rot 3)) + (set! (-> a1-17 uvec y) (-> v1-52 camera-rot 4)) + (set! (-> a1-17 uvec z) (-> v1-52 camera-rot 5)) + (set! (-> a1-17 uvec w) 0.0) + (set! (-> a1-17 fvec x) (-> v1-52 camera-rot 6)) + (set! (-> a1-17 fvec y) (-> v1-52 camera-rot 7)) + (set! (-> a1-17 fvec z) (-> v1-52 camera-rot 8)) + (set! (-> a1-17 fvec w) 0.0) + (set! (-> a1-17 trans x) 0.0) + (set! (-> a1-17 trans y) 0.0) + (set! (-> a1-17 trans z) 0.0) + (set! (-> a1-17 trans w) 1.0) + (matrix->quaternion (-> s4-0 quat) a1-17) + ) + (send-event *camera* 'teleport-to-transformq s4-0) + ) + (set! (-> self update-fov?) #t) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 3)) + (set! (-> *camera* slave 0 fov) (-> *burning-bush-get-on-info* (-> self info index) fov)) + (suspend) + ) + ) + (set! (-> self update-fov?) #f) + (set! (-> *camera-combiner* trans quad) (-> s5-0 quad)) + (let ((a2-15 (-> *camera-combiner* inv-camera-rot)) + (v1-75 (-> gp-0 rvec quad)) + (a0-24 (-> gp-0 uvec quad)) + (a1-19 (-> gp-0 fvec quad)) + (a3-5 (-> gp-0 trans quad)) + ) + (set! (-> a2-15 rvec quad) v1-75) + (set! (-> a2-15 uvec quad) a0-24) + (set! (-> a2-15 fvec quad) a1-19) + (set! (-> a2-15 trans quad) a3-5) + ) + ) + ) + (set! (-> *camera* settings fov) f30-0) + ) + (remove-setting! 'minimap) + (set! (-> *ACTOR-bank* birth-max) 1000) + (let ((a0-28 (get-continue-by-name *game-info* (-> self node-info reset fail-info retry continue))) + (gp-1 (new 'static 'vector :z 1.0)) + ) + (when a0-28 + (move-camera! a0-28) + (set-vector! + gp-1 + (-> *camera-combiner* inv-camera-rot uvec x) + (-> *camera-combiner* inv-camera-rot uvec y) + (-> *camera-combiner* inv-camera-rot uvec z) + 1.0 + ) + (vector-negate-in-place! gp-1) + (set-setting! 'string-startup-vector 'abs gp-1 0) + ) + ) + (persist-with-delay *setting-control* 'interp-time (seconds 0.5) 'interp-time 'abs 0.0 0) + (remove-setting! 'fov) + (remove-setting! 'interp-time) + (remove-setting! 'mode-name) + (while (not (process-release? *target*)) + (suspend) + ) + (until #f + (hud-timer-handler self) + (suspend) + ) + #f + ) + ) + +;; definition of type wascity-burning-bush +(deftype wascity-burning-bush (des-burning-bush) + () + ) + +;; definition for method 3 of type wascity-burning-bush +(defmethod inspect ((this wascity-burning-bush)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type des-burning-bush inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-wascity-burning-bush wascity-burning-bush wascity-burning-bush-lod0-jg wascity-burning-bush-idle-ja + ((wascity-burning-bush-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1.5 0 3.5) + ) + +;; definition for method 11 of type wascity-burning-bush +(defmethod init-from-entity! ((this wascity-burning-bush) (arg0 entity-actor)) + (des-burning-bush-method-32 this) + (process-drawable-from-entity! this arg0) + (des-burning-bush-method-33 this) + (let ((f0-0 (res-lump-float (-> this entity) 'rotoffset))) + (if (!= f0-0 0.0) + (quaternion-rotate-local-y! (-> this root quat) (-> this root quat) f0-0) + ) + ) + (set! (-> this rotmin) (res-lump-float arg0 'rotmin :default -5461.3335)) + (set! (-> this rotmax) (res-lump-float arg0 'rotmax :default 5461.3335)) + (set! (-> this task) + (new 'process 'game-task-control (res-lump-value arg0 'task-actor game-task-actor :time -1000000000.0)) + ) + (set! (-> this angle) 0.0) + (set! (-> this root pause-adjust-distance) 819200.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 381) this)) + (set! (-> this part-off) (create-launch-control (-> *part-group-id-table* 382) this)) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition for method 33 of type wascity-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-33 ((this wascity-burning-bush)) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-wascity-burning-bush" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + 0 + (none) + ) + +;; definition for method 35 of type wascity-burning-bush +;; WARN: Return type mismatch int vs none. +(defmethod des-burning-bush-method-35 ((this wascity-burning-bush)) + (let ((v1-1 (get-current-task-event (-> this task)))) + (let ((a0-4 (-> this entity extra perm))) + (logior! (-> a0-4 status) (entity-perm-status bit-5)) + (set! (-> this bb-perm) a0-4) + (logior! (-> a0-4 status) (entity-perm-status bit-14)) + ) + (cond + ((= (-> this bb-perm user-object 0) 1) + (if (nonzero? (-> v1-1 action)) + (spawn-from-cspace (-> this part) (-> this node-list data 3)) + ) + ) + ((= (-> v1-1 action) (game-task-action show)) + (spawn-from-cspace (-> this part) (-> this node-list data 3)) + ) + ((= (-> v1-1 action) (game-task-action play)) + (spawn-from-cspace (-> this part-off) (-> this node-list data 3)) + ) + ((= (-> v1-1 action) (game-task-action menu)) + (spawn-from-cspace (-> this part-off) (-> this node-list data 3)) + ) + (else + ) + ) + ) + 0 + (none) + ) + +;; definition of type city-des-burning-bush +(deftype city-des-burning-bush (des-burning-bush) + () + ) + +;; definition for method 3 of type city-des-burning-bush +(defmethod inspect ((this city-des-burning-bush)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type des-burning-bush inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/des-bush-part_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bush-part_REF.gc new file mode 100644 index 0000000000..0d255005d4 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/des-bush-part_REF.gc @@ -0,0 +1,598 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-spirit-goal + :id 1540 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5114 :flags (sp7)) (sp-item 5115 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5114 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 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: +(defpart 5116 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.6) (meters 1)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 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-bb-ring-finder + :id 1541 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5116 :flags (sp7)) (sp-item 5115 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5117 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:fade-a -0.055555556) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; definition for symbol *bb-ring-alpha*, type int +(define *bb-ring-alpha* 50) + +;; failed to figure out what this is: +(defpartgroup group-bb-ring-finder-nofade + :id 1542 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5118 :flags (sp7)) (sp-item 5115 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5118 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-bb-ring-fader) + ) + ) + +;; definition for function spt-func-bb-ring-fader +;; WARN: Return type mismatch float vs none. +(defun spt-func-bb-ring-fader ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg2 coneradius) (the float *bb-ring-alpha*)) + (none) + ) + +;; failed to figure out what this is: +(defpart 5115 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.5) + (:x (meters 0) (meters 1)) + (:y (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 120.0) + (:a 64.0) + (:vel-x (meters -0.006666667) (meters 0.013333334)) + (:vel-y (meters 0.006666667) (meters 0.0016666667)) + (:vel-z (meters -0.006666667) (meters 0.013333334)) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-score-drop-c + :id 1543 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5123 :flags (sp7)) + (sp-item 5124 :flags (sp6 sp7)) + (sp-item 5125 :flags (sp3) :binding 5119) + (sp-item 5119 :flags (sp2 sp3) :binding 5120) + (sp-item 5125 :flags (sp3) :binding 5121) + (sp-item 5121 :flags (sp2 sp3) :binding 5120) + (sp-item 5125 :flags (sp3) :binding 5122) + (sp-item 5122 :flags (sp2 sp3) :binding 5120) + (sp-item 5120 :flags (sp2)) + (sp-item 5120 :flags (sp2)) + (sp-item 5120 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 5123 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0 16.0) + (:b :copy g) + (:a 0.0) + (:scalevel-x (meters 0.05) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5126) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5126 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 5124 + :init-specs ((:texture (time-bubble lbbsdrp1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5125 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5119 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:y (meters 2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5121 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:y (meters -2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5122 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5120 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-score-drop-b + :id 1544 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5130 :flags (sp7)) + (sp-item 5131 :flags (sp6 sp7)) + (sp-item 5132 :flags (sp3) :binding 5127) + (sp-item 5127 :flags (sp2 sp3) :binding 5128) + (sp-item 5132 :flags (sp3) :binding 5129) + (sp-item 5129 :flags (sp2 sp3) :binding 5128) + (sp-item 5128 :flags (sp2)) + (sp-item 5128 :flags (sp2)) + ) + ) + +;; failed to figure out what this is: +(defpart 5130 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 250.0) + (:g 230.0 20.0) + (:b 16.0 16.0) + (:a 0.0) + (:scalevel-x (meters 0.05) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5133) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5133 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 5131 + :init-specs ((:texture (time-bubble lbbsdrp1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5132 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5127 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5129 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 180)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5128 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-score-drop-a + :id 1545 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5137 :flags (sp7)) + (sp-item 5138 :flags (sp6 sp7)) + (sp-item 5139 :flags (sp3) :binding 5134) + (sp-item 5134 :flags (sp2 sp3) :binding 5135) + (sp-item 5139 :flags (sp3) :binding 5136) + ) + ) + +;; failed to figure out what this is: +(defpart 5137 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 0.3) + (:scale-x (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 16.0 16.0) + (:g :copy r) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.05) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.85333335) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5140) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5140 + :init-specs ((:fade-a -0.85333335)) + ) + +;; failed to figure out what this is: +(defpart 5138 + :init-specs ((:texture (time-bubble lbbsdrp1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5139 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-track-root) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5134 + :init-specs ((:texture (time-bubble-orbiter lbbsdrp1-sprite)) + (:num 1.0) + (:y (meters 4)) + (:z (meters 0.2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-spirit-explode + :id 1546 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5141 :period (seconds 20) :length (seconds 0.035)) + (sp-item 5142 :period (seconds 20) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 5141 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 10.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.2) + (:fade-g -0.53333336) + (:fade-a -1.7 -1.7) + (:friction 0.93) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5142 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.1) + (:fade-g -0.26666668) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc new file mode 100644 index 0000000000..e2dac8d09a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/des-bush_REF.gc @@ -0,0 +1,3231 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *tex-level-list*, type (array symbol) +(define *tex-level-list* + (new 'static 'boxed-array :type symbol 'lbbring1 'lbbring2 'lbbring3 'lbbring4 'lbbring5 'lbbring6) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-ring + :id 1547 + :duration (seconds 218.45) + :linger-duration (seconds 0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5143 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5144 :flags (is-3d sp7)) + (sp-item 5144 :flags (is-3d sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 5143 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 80.0) + (:b 255.0) + (:a 64.0) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90) 1 (degrees 180)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 5144 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 12) (meters 1)) + (:scale-y :copy scale-x) + (:r 10.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.093333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 6.4) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.067)) + (:next-launcher 5145) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 5145 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-ring-final + :id 1548 + :duration (seconds 218.45) + :linger-duration (seconds 0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5146 :flags (is-3d sp3 sp6 sp7)) + (sp-item 5147 :flags (is-3d sp7)) + (sp-item 5147 :flags (is-3d sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 5146 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:scale-x (meters 12)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 64.0) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90) 1 (degrees 180)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 5147 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 0.0 0.5) + (:scale-x (meters 12) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 10.0) + (:a 0.0) + (:scalevel-x (meters -0.093333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 6.4) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:next-time (seconds 0.067)) + (:next-launcher 5148) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpart 5148 + :init-specs ((:fade-a -1.28)) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-ring-explode + :id 1549 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5149 :flags (sp3 sp7)) (sp-item 5150 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 5149 + :init-specs ((:texture (middot level-default-sprite)) + (:num 200.0) + (:x (meters 5.8)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 80.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 0.225)) + (:vel-x (meters 0.06666667) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5150 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 36)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 120.0) + (:a 20.0) + (:fade-r -17.0) + (:fade-g -8.5) + (:fade-b 0.0) + (:fade-a -0.6666667) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-ring-explode-final + :id 1550 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5151 :flags (sp3 sp7)) (sp-item 5152 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 5151 + :init-specs ((:texture (middot level-default-sprite)) + (:num 200.0) + (:x (meters 5.8)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 64.0) + (:omega (degrees 0.225)) + (:vel-x (meters 0.06666667) (meters 0.06666667)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5152 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 36)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 120.0) + (:a 20.0) + (:fade-r -17.0) + (:fade-g -8.5) + (:fade-b 0.0) + (:fade-a -0.6666667) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 0.0) + (:rotate-x (degrees -90)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-ring-birth + :id 1551 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5153 :flags (is-3d sp3 sp6 sp7)) (sp-item 5150 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 5153 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:r 40.0) + (:g 80.0) + (:b 255.0) + (:a 64.0) + (:scalevel-x (meters 0.1)) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:timer (seconds 0.4)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-desert-ring-birth-final + :id 1552 + :duration (seconds 0.067) + :linger-duration (seconds 0.5) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5154 :flags (is-3d sp3 sp6 sp7)) (sp-item 5152 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 5154 + :init-specs ((:texture (racegate lbbring6-sprite)) + (:num 1.0) + (:r 255.0) + (:g 80.0) + (:b 40.0) + (:a 64.0) + (:scalevel-x (meters 0.1)) + (:rotvel-y (degrees 0.026666665) (degrees 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.53333336) + (:timer (seconds 0.4)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:rotate-x (degrees -90)) + (:rotate-z (degrees -90) (degrees 180)) + ) + ) + +;; definition for function find-level-name +(defun find-level-name () + (dotimes (gp-0 (-> *tex-level-list* length)) + (let ((v1-3 (level-get *level* (-> *tex-level-list* gp-0)))) + (if v1-3 + (return v1-3) + ) + ) + ) + (the-as level #f) + ) + +;; definition for function set-ring-particle-texture +;; WARN: Return type mismatch texture-id vs none. +(defun set-ring-particle-texture () + (let ((gp-0 (find-level-name))) + (when gp-0 + (set! (-> *part-id-table* 5143 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + (set! (-> *part-id-table* 5146 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + (set! (-> *part-id-table* 5153 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + (set! (-> *part-id-table* 5154 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "racegate" gp-0 7)) + ) + ) + ) + (none) + ) + +;; definition for symbol *des-ring-times*, type (array (array float)) +(define *des-ring-times* + (the-as (array (array float)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type float + 11.0 + 9.0 + 9.0 + 8.0 + 7.0 + 11.0 + 8.0 + 8.0 + 10.0 + 8.0 + 12.0 + 9.0 + 10.0 + 9.0 + 10.0 + 13.0 + 11.0 + 12.0 + 10.0 + 10.0 + 10.0 + 10.0 + 8.0 + 9.0 + 13.0 + 10.0 + 12.0 + 10.0 + 6.0 + 8.0 + 9.0 + 11.0 + 10.0 + 11.0 + 10.0 + 11.0 + 15.0 + 14.0 + 9.0 + 15.0 + 10.0 + 13.0 + 9.0 + 13.0 + 8.0 + 7.0 + ) + (new 'static 'boxed-array :type float + 11.0 + 5.2133 + 5.2066 + 5.8266 + 5.0 + 5.0 + 5.0 + 5.0 + 8.0 + 5.0 + 5.0 + 7.0 + 9.0 + 8.0 + 4.0 + 4.0 + 5.0 + 10.0 + 11.0 + 10.0 + ) + (new 'static 'boxed-array :type float + 11.0 + 4.0 + 4.0 + 3.0 + 3.0 + 6.0 + 3.0 + 4.0 + 5.0 + 7.0 + 5.0 + 4.0 + 6.0 + 6.0 + 3.0 + 4.0 + 6.0 + 3.0 + 5.0 + 4.0 + 4.0 + 9.0 + 5.0 + 9.0 + ) + (new 'static 'boxed-array :type float 11.0 6.0 7.0 8.0 5.0 5.0 7.0 6.0 5.0 5.0 5.0 6.0 8.0 7.0 6.0 6.0 8.0) + (new 'static 'boxed-array :type float + 11.0 + 5.0 + 4.0 + 5.0 + 5.0 + 5.0 + 5.0 + 6.0 + 6.0 + 6.0 + 5.0 + 6.0 + 6.0 + 5.0 + 6.0 + 6.0 + 6.0 + 4.0 + 6.0 + 7.0 + 5.0 + 5.0 + 7.0 + 6.0 + 6.0 + 5.0 + 5.0 + 4.0 + ) + (new 'static 'boxed-array :type float + 11.0 + 6.0 + 5.0 + 7.0 + 8.0 + 4.0 + 3.0 + 4.0 + 5.0 + 5.0 + 5.0 + 5.0 + 5.0 + 6.0 + 5.0 + 7.0 + 7.0 + 4.0 + 5.0 + 5.0 + 6.0 + 7.0 + 4.0 + 4.0 + 7.0 + 5.0 + 5.0 + 5.0 + 4.0 + 4.0 + 7.0 + 5.0 + 7.0 + 7.0 + 7.0 + 7.0 + 4.0 + 7.0 + ) + ) + ) + ) + +;; definition of type task-manager-desert-bbush-ring +(deftype task-manager-desert-bbush-ring (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (current-ring int32) + ) + (:methods + (task-manager-desert-bbush-ring-method-32 (_type_) none) + (task-manager-desert-bbush-ring-method-33 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-desert-bbush-ring +(defmethod inspect ((this task-manager-desert-bbush-ring)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tcurrent-ring: ~D~%" (-> this current-ring)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-desert-bbush-ring) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +;; definition for method 32 of type task-manager-desert-bbush-ring +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring)) + "t-manager-1" + (none) + ) + +;; definition for method 33 of type task-manager-desert-bbush-ring +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring)) + (cond + ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'music 'wasring 0.0 0) + ) + (else + (set-setting! 'extra-bank '((desert2 bbush1) (nest2 bbush1)) 0.0 0) + (set-setting! 'music 'desring 0.0 0) + ) + ) + 0 + (none) + ) + +;; definition for symbol *bb-fail*, type resetter-params +(define *bb-fail* + (new 'static 'resetter-params + :flags (resetter-flag auto-reset text-message no-audio no-slow-down) + :fail (new 'static 'resetter-spec :continue "wasstada-jump-training" :reset-mode 'life :execute #f) + :retry (new 'static 'resetter-spec :continue #f :reset-mode 'try :execute #f) + :reset-delay (seconds 1) + ) + ) + +;; definition for method 21 of type task-manager-desert-bbush-ring +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-desert-bbush-ring)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (format 0 "actor-group-count: ~d~%" (-> this actor-group-count)) + (set! (-> this current-ring) 0) + (task-manager-desert-bbush-ring-method-33 this) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((a0-8 (entity-by-name (the-as string (task-manager-desert-bbush-ring-method-32 this))))) + (when a0-8 + (set! (-> this entity) (the-as entity-actor a0-8)) + (set! sv-16 (new 'static 'res-tag)) + (let ((s5-2 (res-lump-data a0-8 'actor-groups pointer :tag-ptr (& sv-16)))) + (format 0 "elt-count: ~d" (-> sv-16 elt-count)) + (cond + ((and s5-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) s5-2)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 23 of type task-manager-desert-bbush-ring +;; WARN: Return type mismatch int vs none. +(defmethod hud-timer-handler ((this task-manager-desert-bbush-ring)) + (with-pp + (cond + ((and *target* + (= (status-of-level-and-borrows *level* 'desert #f) 'active) + (focus-test? *target* pilot-riding) + ) + (when (nonzero? (-> this start-time)) + (let ((v1-8 (handle->process (-> this hud-timer)))) + (if (and *target* (not v1-8)) + (set! (-> this hud-timer) + (ppointer->handle (process-spawn hud-timer :init hud-init-by-other :name "hud-timer" :to *target*)) + ) + ) + ) + (let ((v1-18 (- (-> this time-limit) (- (current-time) (-> this start-time))))) + (let ((a0-21 *game-info*)) + (set! (-> a0-21 timer) v1-18) + (set! (-> a0-21 timer-flash) (< v1-18 (seconds 10))) + ) + (cond + ((< v1-18 0) + (format #t "speed: ~f~%" (* 0.00024414062 (vector-length (-> *target* control transv)))) + (cond + ((< (vector-length (-> *target* control transv)) 1966.08) + (process-release? *target*) + (if *debug-segment* + (format #t "task failed: ran out of time~%") + ) + (send-event (handle->process (-> this hud-timer)) 'hide-and-die) + (let ((v1-41 (-> this actor-group 0 data (-> this current-ring)))) + (when v1-41 + (let ((a1-9 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-9 from) (process->ppointer pp)) + (set! (-> a1-9 num-params) 0) + (set! (-> a1-9 message) 'fail) + (let ((t9-8 send-event-function) + (v1-42 (-> v1-41 actor)) + ) + (t9-8 + (if v1-42 + (-> v1-42 extra process) + ) + a1-9 + ) + ) + ) + ) + ) + (go (method-of-object this fail) (on-fail this 'fail)) + ) + (else + (set! (-> this time-limit) (- (current-time) (-> this start-time))) + (process-grab? *target* #f) + ) + ) + ) + (else + (process-release? *target*) + ) + ) + ) + ) + ) + (else + (call-parent-method this) + ) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-desert-bbush-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (('ring-hit) + (+! (-> self current-ring) 1) + (cond + ((< (-> self current-ring) (length (-> self actor-group 0))) + (let ((gp-1 (-> self actor-group 0 data (-> self current-ring)))) + (when gp-1 + (cond + ((= (+ (length (-> self actor-group 0)) -1) (-> self current-ring)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer self)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'trigger-final) + (let ((t9-3 send-event-function) + (v1-17 (-> gp-1 actor)) + ) + (t9-3 + (if v1-17 + (-> v1-17 extra process) + ) + a1-2 + ) + ) + ) + ) + (else + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'trigger) + (let ((t9-4 send-event-function) + (v1-23 (-> gp-1 actor)) + ) + (t9-4 + (if v1-23 + (-> v1-23 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (* 300.0 (-> *des-ring-times* (-> self info index) (-> self current-ring))))) + ) + 0 + ) + ) + ) + (else + (send-event self 'complete) + ) + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) + (the-as time-frame (the int (* 300.0 (-> *des-ring-times* (-> self info index) 0)))) + ) + ) + :exit (behavior () + (process-release? *target*) + (let ((t9-2 (-> (find-parent-state) exit))) + (if t9-2 + (t9-2) + ) + ) + 0 + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + (hud-timer-handler self) + ) + :code (behavior () + (suspend) + (when (nonzero? (-> self actor-group-count)) + (let ((v1-4 (-> self actor-group 0 data))) + (when v1-4 + (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) 'trigger) + (let ((t9-0 send-event-function) + (v1-5 (-> v1-4 0 actor)) + ) + (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + 0 + ) + ) + ) + (until #f + (suspend) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate fail (task-manager-desert-bbush-ring) + :virtual #t + :enter (behavior ((arg0 resetter-params)) + (kill-by-type desert-chase-ring *active-pool*) + ) + ) + +;; definition of type task-manager-desert-bbush-ring-2 +(deftype task-manager-desert-bbush-ring-2 (task-manager-desert-bbush-ring) + () + ) + +;; definition for method 3 of type task-manager-desert-bbush-ring-2 +(defmethod inspect ((this task-manager-desert-bbush-ring-2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-desert-bbush-ring inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-desert-bbush-ring-2 +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-2)) + "t-manager-10" + (none) + ) + +;; definition for method 33 of type task-manager-desert-bbush-ring-2 +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring-2)) + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + (set-setting! 'music 'desring 0.0 0) + 0 + (none) + ) + +;; definition of type task-manager-desert-bbush-ring-3 +(deftype task-manager-desert-bbush-ring-3 (task-manager-desert-bbush-ring) + () + ) + +;; definition for method 3 of type task-manager-desert-bbush-ring-3 +(defmethod inspect ((this task-manager-desert-bbush-ring-3)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-desert-bbush-ring inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-desert-bbush-ring-3 +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-3)) + (format 0 "tag1~%") + "t-manager-2" + (none) + ) + +;; definition of type task-manager-desert-bbush-ring-4 +(deftype task-manager-desert-bbush-ring-4 (task-manager-desert-bbush-ring) + () + ) + +;; definition for method 3 of type task-manager-desert-bbush-ring-4 +(defmethod inspect ((this task-manager-desert-bbush-ring-4)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-desert-bbush-ring inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-desert-bbush-ring-4 +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-4)) + (format 0 "tag1~%") + "t-manager-6" + (none) + ) + +;; definition of type task-manager-desert-bbush-ring-5 +(deftype task-manager-desert-bbush-ring-5 (task-manager-desert-bbush-ring) + () + ) + +;; definition for method 3 of type task-manager-desert-bbush-ring-5 +(defmethod inspect ((this task-manager-desert-bbush-ring-5)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-desert-bbush-ring inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 20 of type task-manager-desert-bbush-ring-5 +(defmethod init! ((this task-manager-desert-bbush-ring-5)) + (set-setting! 'use-alternate-bouncer? #t 0.0 0) + (call-parent-method this) + (none) + ) + +;; definition for method 32 of type task-manager-desert-bbush-ring-5 +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-5)) + (format 0 "tag1~%") + "t-manager-7" + (none) + ) + +;; definition for method 33 of type task-manager-desert-bbush-ring-5 +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring-5)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'cityring 0.0 0) + 0 + (none) + ) + +;; definition of type task-manager-desert-bbush-ring-6 +(deftype task-manager-desert-bbush-ring-6 (task-manager-desert-bbush-ring) + () + ) + +;; definition for method 3 of type task-manager-desert-bbush-ring-6 +(defmethod inspect ((this task-manager-desert-bbush-ring-6)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-desert-bbush-ring inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 33 of type task-manager-desert-bbush-ring-6 +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-bbush-ring-method-33 ((this task-manager-desert-bbush-ring-6)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'cityring 0.0 0) + 0 + (none) + ) + +;; definition for method 20 of type task-manager-desert-bbush-ring-6 +(defmethod init! ((this task-manager-desert-bbush-ring-6)) + (set-setting! 'use-alternate-bouncer? #t 0.0 0) + (call-parent-method this) + (none) + ) + +;; definition for symbol *bbush-ring-6-kg-squad-member-settings*, type squad-unit-settings +(define *bbush-ring-6-kg-squad-member-settings* (new 'static 'squad-unit-settings + :target-count 14 + :shot-count #x7f + :inaccuracy (the-as float #x6) + :rand-shot-delay (seconds 108.42) + ) + ) + +;; definition for method 21 of type task-manager-desert-bbush-ring-6 +(defmethod set-time-limit ((this task-manager-desert-bbush-ring-6)) + (set-setting! 'kg-enemy-settings #f 0.0 *bbush-ring-6-kg-squad-member-settings*) + (call-parent-method this) + (none) + ) + +;; definition for method 32 of type task-manager-desert-bbush-ring-6 +;; WARN: Return type mismatch string vs none. +(defmethod task-manager-desert-bbush-ring-method-32 ((this task-manager-desert-bbush-ring-6)) + (format 0 "tag1~%") + "t-manager-8" + (none) + ) + +;; definition of type desert-chase-ring +(deftype desert-chase-ring (process-drawable) + ((mat matrix :inline) + (taskman handle) + (turbo-handle handle) + (alt-actor entity-actor) + (ring-radius float) + (minimap connection-minimap) + (is-final? symbol) + (part-final sparticle-launch-control) + ) + (:state-methods + dormant + idle + die + ) + (:methods + (alloc-trsqv! (_type_) none) + ) + ) + +;; definition for method 3 of type desert-chase-ring +(defmethod inspect ((this desert-chase-ring)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tmat: #~%" (-> this mat)) + (format #t "~2Ttaskman: ~D~%" (-> this taskman)) + (format #t "~2Tturbo-handle: ~D~%" (-> this turbo-handle)) + (format #t "~2Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~2Tring-radius: ~f~%" (-> this ring-radius)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tis-final?: ~A~%" (-> this is-final?)) + (format #t "~2Tpart-final: ~A~%" (-> this part-final)) + (label cfg-4) + this + ) + +;; definition for function desert-chase-ring-cleared? +(defun desert-chase-ring-cleared? ((arg0 vector) (arg1 vector) (arg2 desert-chase-ring)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (and (< (fabs (vector-dot (vector-x-quaternion! s5-0 (the-as quaternion arg0)) arg1)) (-> arg2 ring-radius)) + (< (fabs (vector-dot (vector-y-quaternion! s5-0 (the-as quaternion arg0)) arg1)) (-> arg2 ring-radius)) + (< (fabs (vector-dot (vector-z-quaternion! s5-0 (the-as quaternion arg0)) arg1)) 4096.0) + ) + ) + ) + +;; definition for method 12 of type desert-chase-ring +;; INFO: this function exists in multiple non-identical object files +(defmethod run-logic? ((this desert-chase-ring)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; failed to figure out what this is: +(defstate dormant (desert-chase-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (if (type? proc task-manager-desert-bbush-ring) + (set! (-> self taskman) (process->handle proc)) + ) + (go-virtual idle) + ) + (('trigger-final) + (when (type? proc task-manager-desert-bbush-ring) + (set! (-> self is-final?) #t) + (set! (-> self taskman) (process->handle proc)) + ) + (go-virtual idle) + ) + ) + ) + :trans (behavior () + 0 + ) + :code sleep-code + :post (behavior () + 0 + ) + ) + +;; failed to figure out what this is: +(defstate idle (desert-chase-ring) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fail) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (go-virtual die) + ) + ) + ) + :enter (behavior () + (cond + ((-> self is-final?) + (if (logtest? (-> *part-group-id-table* 1552 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1552) + :mat-joint (-> self mat) + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1552) :mat-joint (-> self mat)) + ) + ) + ((logtest? (-> *part-group-id-table* 1551 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1551) + :mat-joint (-> self mat) + ) + ) + (else + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1551) :mat-joint (-> self mat)) + ) + ) + (sound-play "ring-create") + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) + (when (-> self alt-actor) + (format 0 "setting-up turbo~%") + (turbo-pickup-spawn (-> self alt-actor extra trans)) + ) + ) + :trans (behavior () + (let ((v1-0 *target*) + (a1-0 (new 'stack-no-clear 'vector)) + ) + (when v1-0 + (cond + ((focus-test? v1-0 pilot) + (let ((a2-1 (handle->process (-> v1-0 pilot vehicle)))) + (set! (-> a1-0 quad) (-> (the-as vehicle a2-1) root root-prim prim-core world-sphere quad)) + ) + ) + (else + (set! (-> a1-0 quad) (-> v1-0 control trans quad)) + (+! (-> a1-0 y) 12288.0) + ) + ) + (vector-! a1-0 a1-0 (-> self root trans)) + (let ((a0-12 (-> self root quat))) + (when (desert-chase-ring-cleared? (the-as vector a0-12) a1-0 self) + (if (-> self is-final?) + (sound-play "ring-final") + (sound-play "ring-pass") + ) + (send-event (handle->process (-> self taskman)) 'ring-hit) + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + (cond + ((-> self is-final?) + (if (logtest? (-> *part-group-id-table* 1550 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1550) + :mat-joint (-> self mat) + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1550) :mat-joint (-> self mat)) + ) + ) + ((logtest? (-> *part-group-id-table* 1549 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 1549) + :mat-joint (-> self mat) + ) + ) + (else + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1549) :mat-joint (-> self mat)) + ) + ) + (go-virtual die) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (when (time-elapsed? (-> self state-time) (seconds 0.4)) + (cond + ((-> self is-final?) + (if (nonzero? (-> self part-final)) + (spawn-from-mat (-> self part-final) (-> self mat)) + ) + ) + (else + (if (nonzero? (-> self part)) + (spawn-from-mat (-> self part) (-> self mat)) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (desert-chase-ring) + :virtual #t + :code (behavior () + (kill-callback (-> *minimap* engine) (-> self minimap)) + (while (-> self child) + (suspend) + ) + (go-virtual dormant) + ) + ) + +;; definition for method 12 of type desert-chase-ring +;; INFO: this function exists in multiple non-identical object files +(defmethod run-logic? ((this desert-chase-ring)) + "Should this process be run? Checked by execute-process-tree." + #t + ) + +;; definition for method 23 of type desert-chase-ring +;; WARN: Return type mismatch int vs none. +(defmethod alloc-trsqv! ((this desert-chase-ring)) + (set! (-> this root) (new 'process 'trsqv)) + 0 + (none) + ) + +;; definition for method 7 of type desert-chase-ring +(defmethod relocate ((this desert-chase-ring) (offset int)) + (if (nonzero? (-> this part-final)) + (&+! (-> this part-final) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type desert-chase-ring +(defmethod deactivate ((this desert-chase-ring)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part-final)) + (kill-particles (-> this part-final)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type desert-chase-ring +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this desert-chase-ring) (arg0 entity-actor)) + (set-ring-particle-texture) + (alloc-trsqv! this) + (process-drawable-from-entity! this arg0) + (set! (-> this ring-radius) (res-lump-float arg0 'ring-radius :default 24576.0)) + (quaternion->matrix (-> this mat) (-> this root quat)) + (set! (-> this mat trans quad) (-> this root trans quad)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1547) this)) + (set! (-> this part-final) (create-launch-control (-> *part-group-id-table* 1548) this)) + (logclear! (-> this mask) (process-mask actor-pause)) + (set! (-> this alt-actor) (entity-actor-lookup (-> this entity) 'alt-actor 0)) + (set! (-> this is-final?) #f) + (go (method-of-object this dormant)) + ) + +;; definition of type spirit +(deftype spirit (process-drawable) + ((part-subsampler sparticle-subsampler) + (sound-id sound-id) + (sound-id-2 sound-id) + (play-pixie? symbol) + (goal-part sparticle-launch-control) + (draw-start-goal? symbol) + ) + (:state-methods + idle + dormant + explode + ) + ) + +;; definition for method 3 of type spirit +(defmethod inspect ((this spirit)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpart-subsampler: ~A~%" (-> this part-subsampler)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tsound-id-2: ~D~%" (-> this sound-id-2)) + (format #t "~2Tplay-pixie?: ~A~%" (-> this play-pixie?)) + (format #t "~2Tgoal-part: ~A~%" (-> this goal-part)) + (format #t "~2Tdraw-start-goal?: ~A~%" (-> this draw-start-goal?)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate explode (spirit) + :virtual #t + :enter (behavior () + (cond + ((logtest? (-> *part-group-id-table* 1546 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1546)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1546)) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate dormant (spirit) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-1) quad)) + v0-0 + ) + ) + (('play-pixie) + (go-virtual idle) + ) + (('goal) + (go-virtual explode) + ) + ) + ) + :trans (behavior () + (sound-play "magic-trail" :id (-> self sound-id-2)) + (spawn (-> self goal-part) (-> self root trans)) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (spirit) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-1) quad)) + v0-0 + ) + ) + (('play-pixie) + (set! (-> self play-pixie?) #t) + (set! (-> self draw-start-goal?) #f) + #f + ) + (('goal-state) + (set! (-> self draw-start-goal?) #t) + (go-virtual dormant) + ) + ) + ) + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (init-with-vec! (-> self part-subsampler) (-> self root trans)) + (sound-play "magic-trail" :id (-> self sound-id-2)) + (sound-play-by-name + (static-sound-name "flying-pixie") + (-> self sound-id) + 1024 + (the int (* 1524.0 (doppler-pitch-shift (-> self root trans) (-> self root transv)))) + 0 + (sound-group) + #t + ) + ) + :code sleep-code + ) + +;; definition for method 7 of type spirit +;; WARN: Return type mismatch process-drawable vs spirit. +(defmethod relocate ((this spirit) (offset int)) + (if (nonzero? (-> this part-subsampler)) + (&+! (-> this part-subsampler) offset) + ) + (if (nonzero? (-> this goal-part)) + (&+! (-> this goal-part) offset) + ) + (the-as spirit ((method-of-type process-drawable relocate) this offset)) + ) + +;; definition for method 10 of type spirit +(defmethod deactivate ((this spirit)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this goal-part)) + (kill-particles (-> this goal-part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for function spirit-init-by-other +;; INFO: Used lq/sq +(defbehavior spirit-init-by-other spirit ((arg0 vector)) + (set! (-> self play-pixie?) #f) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self sound-id) (new-sound-id)) + (set! (-> self sound-id-2) (new-sound-id)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1541) self)) + self + (set! (-> self part-subsampler) + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 5117) 3.0) + ) + (set! (-> self goal-part) (create-launch-control (-> *part-group-id-table* 1540) self)) + (set! (-> self draw-start-goal?) #t) + (go-virtual dormant) + ) + +;; definition of type hud-spider-killed +(deftype hud-spider-killed (hud-goal) + () + ) + +;; definition for method 3 of type hud-spider-killed +(defmethod inspect ((this hud-spider-killed)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud-goal inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-spider-killed +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-spider-killed)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 65 125) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-spider-killed +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-spider-killed)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-spider-killed +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-spider-killed)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) + (let ((s5-0 format) + (gp-1 (clear (-> this strings 1 text))) + (s4-0 "~S") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-07f6) #f)) + (s5-0 gp-1 s4-0 *temp-string*) + ) + 0 + (none) + ) + +;; definition of type task-manager-bbush-egg-spider +(deftype task-manager-bbush-egg-spider (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (goal-score uint32) + (hud-score handle) + (hud-goal handle) + ) + (:methods + (task-manager-bbush-egg-spider-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-bbush-egg-spider +(defmethod inspect ((this task-manager-bbush-egg-spider)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tgoal-score: ~D~%" (-> this goal-score)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-bbush-egg-spider) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +;; definition for method 25 of type task-manager-bbush-egg-spider +(defmethod task-manager-method-25 ((this task-manager-bbush-egg-spider)) + (dotimes (s5-0 44) + (let ((s4-0 (-> *vehicle-info* handle-by-vehicle-type s5-0))) + (when (handle->process s4-0) + (send-event (handle->process s4-0) 'ignore-damage #f) + (send-event (handle->process s4-0) 'ignore-impulse #f) + ) + ) + ) + ((method-of-type task-manager task-manager-method-25) this) + (none) + ) + +;; definition for method 32 of type task-manager-bbush-egg-spider +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-bbush-egg-spider-method-32 ((this task-manager-bbush-egg-spider)) + (set-setting! 'extra-bank '((desert2 bbush2)) 0.0 0) + (set-setting! 'music 'despider 0.0 0) + 0 + (none) + ) + +;; definition for method 21 of type task-manager-bbush-egg-spider +;; INFO: Used lq/sq +;; WARN: Return type mismatch float vs none. +(defmethod set-time-limit ((this task-manager-bbush-egg-spider)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set-setting! 'string-max-height 'abs (meters 8) 0) + (set-setting! 'string-max-length 'abs (meters 24) 0) + (set-setting! 'string-min-height 'abs (meters 6) 0) + (set-setting! 'string-min-length 'abs (meters 20) 0) + (adjust-player-ammo 5000.0 (pickup-type ammo-yellow)) + (adjust-player-ammo 5000.0 (pickup-type ammo-red)) + (adjust-player-ammo 5000.0 (pickup-type ammo-blue)) + (adjust-player-ammo 5000.0 (pickup-type ammo-dark)) + (set-setting! 'pilot #f 0.0 0) + (set-setting! 'gun-special-mode #t 0.0 0) + (task-manager-bbush-egg-spider-method-32 this) + (let ((s5-0 (entity-by-name "tmanager-4"))) + (when s5-0 + (set! (-> this entity) (the-as entity-actor s5-0)) + (set! (-> this goal-score) + (res-lump-value s5-0 'goal-score uint :default (the-as uint128 80) :time -1000000000.0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-20 (res-lump-data s5-0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-20 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-20)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (set! (-> this hud-score) + (ppointer->handle + (process-spawn hud-spider-killed :init hud-init-by-other :name "hud-spider-killed" :to this) + ) + ) + (set! (-> this hud-goal) + (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :name "hud-goal" :to this)) + ) + (set! (-> *game-info* goal) (the float (-> this goal-score))) + (set! (-> *game-info* score) 0.0) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-bbush-egg-spider) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) (seconds 60)) + ) + :trans (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'count-death) + (let* ((t9-0 send-event-function) + (v1-5 (-> self actor-group 0 data 0 actor)) + (v1-7 (t9-0 + (if v1-5 + (-> v1-5 extra process) + ) + a1-0 + ) + ) + ) + (set! (-> *game-info* score) (the float v1-7)) + (if (= v1-7 (-> self goal-score)) + (send-event self 'complete) + ) + ) + ) + (hud-timer-handler self) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (until #f + (dotimes (v1-2 44) + (let ((gp-0 (-> *vehicle-info* handle-by-vehicle-type v1-2))) + (when (handle->process gp-0) + (send-event (handle->process gp-0) 'ignore-damage #t) + (send-event (handle->process gp-0) 'ignore-impulse #t) + (goto cfg-27) + ) + ) + ) + (suspend) + ) + #f + (until #f + (label cfg-27) + (suspend) + ) + #f + ) + ) + +;; definition of type task-manager-bbush-spirit-chase +(deftype task-manager-bbush-spirit-chase (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (path-pos float) + (trans vector :inline) + (touched symbol) + (spirit handle) + (current-curve-distance float) + (current-curve-length float) + (min-spirit-vel float) + (current-spirit-vel float) + (high-spirit-vel float) + (fail-radius float) + (chase-distance float) + (start-offset-vel float) + (sound-id sound-id) + ) + (:methods + (get-entity-name (_type_) string) + (task-manager-bbush-spirit-chase-method-33 (_type_) float) + (task-manager-bbush-spirit-chase-method-34 (_type_) float) + (set-sbanks (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-bbush-spirit-chase +(defmethod inspect ((this task-manager-bbush-spirit-chase)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Ttrans: #~%" (-> this trans)) + (format #t "~2Ttouched: ~A~%" (-> this touched)) + (format #t "~2Tspirit: ~D~%" (-> this spirit)) + (format #t "~2Tcurrent-curve-distance: ~f~%" (-> this current-curve-distance)) + (format #t "~2Tcurrent-curve-length: ~f~%" (-> this current-curve-length)) + (format #t "~2Tmin-spirit-vel: ~f~%" (-> this min-spirit-vel)) + (format #t "~2Tcurrent-spirit-vel: ~f~%" (-> this current-spirit-vel)) + (format #t "~2Thigh-spirit-vel: ~f~%" (-> this high-spirit-vel)) + (format #t "~2Tfail-radius: ~f~%" (-> this fail-radius)) + (format #t "~2Tchase-distance: ~f~%" (-> this chase-distance)) + (format #t "~2Tstart-offset-vel: ~f~%" (-> this start-offset-vel)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-bbush-spirit-chase) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-38 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 + (ppointer->handle + (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (set-time! (-> self state-time)) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (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) + ) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-38 (or (handle->process (-> self arrow)) (begin + (countdown (v1-39 4) + (when (handle->process (-> self hud v1-39)) + (set! v1-38 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-38 + ) + (suspend) + ) + ) + ) + +;; definition for method 35 of type task-manager-bbush-spirit-chase +;; WARN: Return type mismatch int vs none. +(defmethod set-sbanks ((this task-manager-bbush-spirit-chase)) + (cond + ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'music 'waspirit 0.0 0) + ) + (else + (set-setting! 'extra-bank '((desert2 bbush1)) 0.0 0) + (set-setting! 'music 'despirit 0.0 0) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type task-manager-bbush-spirit-chase +(defmethod get-entity-name ((this task-manager-bbush-spirit-chase)) + "tmanager-5" + ) + +;; definition for method 33 of type task-manager-bbush-spirit-chase +(defmethod task-manager-bbush-spirit-chase-method-33 ((this task-manager-bbush-spirit-chase)) + 4096.0 + ) + +;; definition for method 34 of type task-manager-bbush-spirit-chase +(defmethod task-manager-bbush-spirit-chase-method-34 ((this task-manager-bbush-spirit-chase)) + 655360.0 + ) + +;; definition for method 21 of type task-manager-bbush-spirit-chase +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-bbush-spirit-chase)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this path-pos) 0.0) + (set! (-> this touched) #f) + (set! (-> this spirit) (ppointer->handle (process-spawn spirit *null-vector* :name "spirit" :to this))) + (logclear! (-> this mask) (process-mask actor-pause)) + (let ((s5-2 (entity-by-name (get-entity-name this)))) + (when s5-2 + (set! (-> this min-spirit-vel) (res-lump-float s5-2 'min-spirit-vel :default 163840.0)) + (set! (-> this high-spirit-vel) (res-lump-float s5-2 'high-spirit-vel :default 163840.0)) + (set! (-> this fail-radius) (res-lump-float s5-2 'fail-radius :default 655360.0)) + (set! (-> this chase-distance) (res-lump-float s5-2 'chase-distance :default 102400.0)) + (set! (-> this start-offset-vel) (res-lump-float s5-2 'start-offset-vel :default 20480.0)) + (format #t "new-vel: ~f~%" (* 0.00024414062 (-> this start-offset-vel))) + (set! (-> this entity) (the-as entity-actor s5-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-19 (res-lump-data s5-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-19 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-19)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (set-sbanks this) + (set! (-> this sound-id) (new 'static 'sound-id)) + (set! (-> this current-spirit-vel) (-> this min-spirit-vel)) + (format #t "min-spirit-vel: ~f~%" (* 0.00024414062 (-> this min-spirit-vel))) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-bbush-spirit-chase) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) (seconds 60)) + (set! (-> self current-curve-distance) 1.0) + (set! (-> self current-curve-distance) 0.0) + ) + :trans (behavior () + (local-vars (sv-240 vector) (sv-256 vector) (sv-272 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (when (nonzero? (-> self actor-group)) + (dotimes (gp-0 (+ (length (-> self actor-group 0)) -1)) + (cond + ((and (>= (-> self path-pos) (the float gp-0)) (>= (the float (+ gp-0 1)) (-> self path-pos))) + (let ((v1-7 (-> self actor-group 0 data gp-0)) + (a1-2 (-> self actor-group 0 data (+ gp-0 1))) + ) + (when (and v1-7 a1-2) + (let ((s3-0 (-> v1-7 actor)) + (s5-0 (-> a1-2 actor)) + (s4-0 (new 'stack 'cubic-curve)) + ) + (new 'stack-no-clear 'vector) + (when (and s3-0 s5-0) + (let ((s2-0 s4-0) + (s1-0 (method-of-type cubic-curve cubic-curve-method-9)) + (s0-0 (-> s3-0 trans)) + ) + (set! sv-240 (new 'stack-no-clear 'vector)) + (let ((v0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (f0-3 204800.0) + ) + (.lvf vf1 (&-> v0-1 quad)) + (let ((v1-14 f0-3)) + (.mov vf2 v1-14) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-240 quad) vf1) + (set! sv-256 (-> s5-0 trans)) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let ((v0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-0 quat))) + (f0-4 204800.0) + ) + (.lvf vf1 (&-> v0-2 quad)) + (let ((v1-19 f0-4)) + (.mov vf2 v1-19) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-272 quad) vf1) + (s1-0 s2-0 s0-0 sv-240 sv-256 sv-272) + ) + (set! (-> self current-curve-length) (vector-vector-distance (-> s3-0 trans) (-> s5-0 trans))) + (cubic-curve-method-10 s4-0 (-> self trans) (- (-> self path-pos) (the float gp-0))) + (cond + ((not (time-elapsed? (-> self state-time) (seconds 4))) + (let ((f0-9 (+ (vector-length (-> *target* control transv)) (-> self start-offset-vel)))) + (seek! (-> self current-spirit-vel) f0-9 (* 0.5 (seconds-per-frame) (-> self high-spirit-vel))) + ) + ) + ((< (vector-vector-distance (target-pos 0) (-> s5-0 trans)) + (+ (vector-vector-distance (-> self trans) (-> s5-0 trans)) (-> self chase-distance)) + ) + (let ((f0-17 (fmax (vector-length (-> *target* control transv)) (-> self high-spirit-vel)))) + (seek! (-> self current-spirit-vel) (-> self high-spirit-vel) (* 0.5 (seconds-per-frame) f0-17)) + ) + ) + (else + (seek! + (-> self current-spirit-vel) + (-> self min-spirit-vel) + (* 0.5 (seconds-per-frame) (-> self high-spirit-vel)) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> self current-curve-distance) 0.0) + ) + ) + ) + ) + (send-event (handle->process (-> self spirit)) 'trans (-> self trans)) + (cond + ((-> self touched) + (+! (-> self current-curve-distance) (* (-> self current-spirit-vel) (seconds-per-frame))) + (+! (-> self path-pos) (/ (-> self current-curve-distance) (-> self current-curve-length))) + (when (< (the float (+ (length (-> self actor-group 0)) -1)) (-> self path-pos)) + (set! (-> self path-pos) (the float (+ (length (-> self actor-group 0)) -1))) + (send-event (handle->process (-> self spirit)) 'goal-state) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel bbush) (gui-action queue) "miss001" -99.0 0) + ) + (when (< (vector-vector-distance (target-pos 0) (-> self trans)) 20480.0) + (send-event (handle->process (-> self spirit)) 'goal) + (send-event self 'complete) + ) + ) + (let ((f0-36 (-> self fail-radius))) + (if (< (* f0-36 f0-36) (vector-vector-distance-squared (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + ) + ) + (else + (set-time! (-> self state-time)) + (let ((f0-39 (vector-vector-distance-squared (target-pos 0) (-> self trans))) + (f1-23 20480.0) + ) + (when (< f0-39 (* f1-23 f1-23)) + (set! (-> self touched) #t) + (sound-play "start-pickup") + (send-event (handle->process (-> self spirit)) 'play-pixie) + ) + ) + (if (< 409600.0 (vector-vector-distance (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +;; definition of type task-manager-bbush-spirit-chase-2 +(deftype task-manager-bbush-spirit-chase-2 (task-manager-bbush-spirit-chase) + () + ) + +;; definition for method 3 of type task-manager-bbush-spirit-chase-2 +(defmethod inspect ((this task-manager-bbush-spirit-chase-2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-bbush-spirit-chase inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-bbush-spirit-chase-2 +(defmethod get-entity-name ((this task-manager-bbush-spirit-chase-2)) + (format 0 "tag1~%") + "t-manager-4" + ) + +;; definition for method 33 of type task-manager-bbush-spirit-chase-2 +(defmethod task-manager-bbush-spirit-chase-method-33 ((this task-manager-bbush-spirit-chase-2)) + 18.0 + ) + +;; definition for method 34 of type task-manager-bbush-spirit-chase-2 +(defmethod task-manager-bbush-spirit-chase-method-34 ((this task-manager-bbush-spirit-chase-2)) + 163840.0 + ) + +;; definition of type task-manager-bbush-spirit-chase-3 +(deftype task-manager-bbush-spirit-chase-3 (task-manager-bbush-spirit-chase) + () + ) + +;; definition for method 3 of type task-manager-bbush-spirit-chase-3 +(defmethod inspect ((this task-manager-bbush-spirit-chase-3)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-bbush-spirit-chase inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-bbush-spirit-chase-3 +(defmethod get-entity-name ((this task-manager-bbush-spirit-chase-3)) + (format 0 "tag1~%") + "t-manager-5" + ) + +;; definition for method 35 of type task-manager-bbush-spirit-chase-3 +;; WARN: Return type mismatch int vs none. +(defmethod set-sbanks ((this task-manager-bbush-spirit-chase-3)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'ctysprit 0.0 0) + 0 + (none) + ) + +;; definition for method 33 of type task-manager-bbush-spirit-chase-3 +(defmethod task-manager-bbush-spirit-chase-method-33 ((this task-manager-bbush-spirit-chase-3)) + 94208.0 + ) + +;; definition for method 34 of type task-manager-bbush-spirit-chase-3 +(defmethod task-manager-bbush-spirit-chase-method-34 ((this task-manager-bbush-spirit-chase-3)) + 163840.0 + ) + +;; definition of type bb-score-a-pickup +(deftype bb-score-a-pickup (process-hidden) + () + ) + +;; definition for method 3 of type bb-score-a-pickup +(defmethod inspect ((this bb-score-a-pickup)) + (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 bb-score-b-pickup +(deftype bb-score-b-pickup (process-hidden) + () + ) + +;; definition for method 3 of type bb-score-b-pickup +(defmethod inspect ((this bb-score-b-pickup)) + (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 bb-score-c-pickup +(deftype bb-score-c-pickup (process-hidden) + () + ) + +;; definition for method 3 of type bb-score-c-pickup +(defmethod inspect ((this bb-score-c-pickup)) + (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 (debug) for function bb-score-type->string +(defun-debug bb-score-type->string ((arg0 bb-score-type)) + (case arg0 + (((bb-score-type large)) + "large" + ) + (((bb-score-type small)) + "small" + ) + (((bb-score-type medium)) + "medium" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition of type score-drop +(deftype score-drop (process-drawable) + ((src vector :inline) + (dst vector :inline) + (pickup-radius float) + (score uint32) + (score-pickup-radius float) + (bb-score-type bb-score-type) + (traj trajectory :inline) + ) + (:state-methods + idle + dormant + die + ) + ) + +;; definition for method 3 of type score-drop +(defmethod inspect ((this score-drop)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tsrc: #~%" (-> this src)) + (format #t "~2Tdst: #~%" (-> this dst)) + (format #t "~2Tpickup-radius: ~f~%" (-> this pickup-radius)) + (format #t "~2Tscore: ~D~%" (-> this score)) + (format #t "~2Tscore-pickup-radius: ~f~%" (-> this score-pickup-radius)) + (format #t "~2Tbb-score-type: ~D~%" (-> this bb-score-type)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate dormant (score-drop) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (set! (-> self src quad) (-> (the-as vector (-> block param 0)) quad)) + (set! (-> self dst quad) (-> self root trans quad)) + (setup-from-to-duration! (-> self traj) (-> self src) (-> self dst) 300.0 -4.551111) + (go-virtual idle) + ) + ) + ) + :trans (behavior () + (add-debug-sphere #t (bucket-id debug) (-> self dst) (meters 1) *color-green*) + (add-debug-sphere #t (bucket-id debug) (-> self root trans) (meters 2) *color-red*) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (score-drop) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v0-0 (-> self src quad))) + (set! (-> self root trans quad) v0-0) + ) + ) + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (/ (the float (- (current-time) (-> self state-time))) (-> self traj time)) + (let ((f0-3 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-1 (-> self pickup-radius)) + ) + (when (< f0-3 (* f1-1 f1-1)) + (send-event (ppointer->process (-> self parent)) 'score (-> self score)) + (case (-> self bb-score-type) + (((bb-score-type small)) + (sound-play "small-pickup") + ) + (((bb-score-type medium)) + (sound-play "medium-pickup") + ) + (((bb-score-type large)) + (sound-play "large-pickup") + ) + ) + (go-virtual die) + ) + ) + ) + :code (behavior () + (until #f + (compute-trans-at-time + (-> self traj) + (fmin (the float (- (current-time) (-> self state-time))) (-> self traj time)) + (-> self root trans) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (score-drop) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +;; definition for method 10 of type score-drop +(defmethod deactivate ((this score-drop)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 11 of type score-drop +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this score-drop) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for function score-drop-init-by-other +(defbehavior score-drop-init-by-other score-drop ((arg0 entity-actor)) + (process-entity-set! self arg0) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (cond + ((= (-> arg0 etype) bb-score-a-pickup) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1545) self)) + (set! (-> self bb-score-type) (bb-score-type small)) + 0 + ) + ((= (-> arg0 etype) bb-score-b-pickup) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1544) self)) + (set! (-> self bb-score-type) (bb-score-type medium)) + ) + (else + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1543) self)) + (set! (-> self bb-score-type) (bb-score-type large)) + ) + ) + (set! (-> self pickup-radius) (res-lump-float arg0 'score-pickup-radius :default 4096.0)) + (format 0 "score-radius: ~f~%" (-> self pickup-radius)) + (set! (-> self score) + (res-lump-value arg0 'score-amount uint :default (the-as uint128 100) :time -1000000000.0) + ) + (go-virtual dormant) + ) + +;; definition of type task-manager-bbush-spirit-drop +(deftype task-manager-bbush-spirit-drop (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (path-pos float) + (trans vector :inline) + (touched symbol) + (spirit handle) + (score-drop-handles handle 64) + (score-drop-num int32) + (current-curve-distance float) + (current-curve-length float) + (goal-score uint32) + (current-score uint32) + (score-drop-activation-radius float) + (min-spirit-vel float) + (high-spirit-vel float) + (current-spirit-vel float) + (fail-radius float) + (hud-score handle) + (hud-goal handle) + ) + (:methods + (get-entity-name (_type_) string) + (task-manager-bbush-spirit-drop-method-33 (_type_) float) + (task-manager-bbush-spirit-drop-method-34 (_type_) float) + (task-manager-bbush-spirit-drop-method-35 (_type_) int) + (send-trigger (_type_) symbol) + (spawn-drops (_type_) symbol) + (set-sbanks (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-bbush-spirit-drop +(defmethod inspect ((this task-manager-bbush-spirit-drop)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Ttrans: #~%" (-> this trans)) + (format #t "~2Ttouched: ~A~%" (-> this touched)) + (format #t "~2Tspirit: ~D~%" (-> this spirit)) + (format #t "~2Tscore-drop-handles[64] @ #x~X~%" (-> this score-drop-handles)) + (format #t "~2Tscore-drop-num: ~D~%" (-> this score-drop-num)) + (format #t "~2Tcurrent-curve-distance: ~f~%" (-> this current-curve-distance)) + (format #t "~2Tcurrent-curve-length: ~f~%" (-> this current-curve-length)) + (format #t "~2Tgoal-score: ~D~%" (-> this goal-score)) + (format #t "~2Tcurrent-score: ~D~%" (-> this current-score)) + (format #t "~2Tscore-drop-activation-radius: ~f~%" (-> this score-drop-activation-radius)) + (format #t "~2Tmin-spirit-vel: ~f~%" (-> this min-spirit-vel)) + (format #t "~2Thigh-spirit-vel: ~f~%" (-> this high-spirit-vel)) + (format #t "~2Tcurrent-spirit-vel: ~f~%" (-> this current-spirit-vel)) + (format #t "~2Tfail-radius: ~f~%" (-> this fail-radius)) + (format #t "~2Thud-score: ~D~%" (-> this hud-score)) + (format #t "~2Thud-goal: ~D~%" (-> this hud-goal)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-bbush-spirit-drop) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +;; definition for method 38 of type task-manager-bbush-spirit-drop +;; WARN: Return type mismatch int vs none. +(defmethod set-sbanks ((this task-manager-bbush-spirit-drop)) + (set-setting! 'extra-bank '((desert2 bbush1) (nest2 bbush1)) 0.0 0) + (set-setting! 'music 'desring 0.0 0) + 0 + (none) + ) + +;; definition for method 32 of type task-manager-bbush-spirit-drop +(defmethod get-entity-name ((this task-manager-bbush-spirit-drop)) + "tmanager-6" + ) + +;; definition for method 33 of type task-manager-bbush-spirit-drop +(defmethod task-manager-bbush-spirit-drop-method-33 ((this task-manager-bbush-spirit-drop)) + 36.0 + ) + +;; definition for method 34 of type task-manager-bbush-spirit-drop +(defmethod task-manager-bbush-spirit-drop-method-34 ((this task-manager-bbush-spirit-drop)) + 655360.0 + ) + +;; definition for method 35 of type task-manager-bbush-spirit-drop +(defmethod task-manager-bbush-spirit-drop-method-35 ((this task-manager-bbush-spirit-drop)) + 100 + ) + +;; definition for method 37 of type task-manager-bbush-spirit-drop +(defmethod spawn-drops ((this task-manager-bbush-spirit-drop)) + (when (-> this actor-group 1) + (set! (-> this score-drop-num) (-> this actor-group 1 length)) + (format 0 "num-drops: ~d~%" (-> this score-drop-num)) + (when (< 1 (-> this actor-group-count)) + (format 0 "activating score-drops~%") + (dotimes (s5-0 (-> this actor-group 1 length)) + (let ((s4-0 (-> this actor-group 1 data s5-0))) + (set! (-> this score-drop-handles s5-0) + (ppointer->handle (process-spawn score-drop (-> s4-0 actor) :name "score-drop" :to this)) + ) + ) + ) + #f + ) + ) + ) + +;; definition for method 36 of type task-manager-bbush-spirit-drop +(defmethod send-trigger ((this task-manager-bbush-spirit-drop)) + (dotimes (s5-0 (-> this score-drop-num)) + (when (handle->process (-> this score-drop-handles s5-0)) + (let ((s4-0 (-> this score-drop-handles s5-0 process 0))) + (if (< (vector-vector-distance (-> (the-as spirit s4-0) root trans) (-> this trans)) + (-> this score-drop-activation-radius) + ) + (send-event s4-0 'trigger (-> this trans)) + ) + ) + ) + ) + #f + ) + +;; definition for method 21 of type task-manager-bbush-spirit-drop +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-bbush-spirit-drop)) + (local-vars (sv-16 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this path-pos) 0.0) + (set! (-> this touched) #f) + (set! (-> this spirit) (ppointer->handle (process-spawn spirit *null-vector* :name "spirit" :to this))) + (let ((s5-2 (entity-by-name (get-entity-name this)))) + (when s5-2 + (set! (-> this entity) (the-as entity-actor s5-2)) + (set! (-> this goal-score) + (res-lump-value s5-2 'goal-score uint :default (the-as uint128 200) :time -1000000000.0) + ) + (set! (-> this score-drop-activation-radius) + (res-lump-float s5-2 'score-drop-activation-radius :default 409600.0) + ) + (format 0 "activation-radius: ~f~%" (-> this score-drop-activation-radius)) + (set! (-> this min-spirit-vel) (res-lump-float s5-2 'min-spirit-vel :default 163840.0)) + (set! (-> this high-spirit-vel) (res-lump-float s5-2 'high-spirit-vel :default 163840.0)) + (set! (-> this fail-radius) (res-lump-float s5-2 'fail-radius :default 655360.0)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data s5-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-16)) + (spawn-drops this) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (if *cty-attack-controller* + (logior! (-> *cty-attack-controller* target-attacker flags) (city-attacker-info-flag cai3)) + ) + (set-sbanks this) + (set! (-> this hud-score) + (ppointer->handle (process-spawn hud-big-score :init hud-init-by-other :name "hud-big-score" :to this)) + ) + (set! (-> this hud-goal) + (ppointer->handle (process-spawn hud-goal :init hud-init-by-other :name "hud-goal" :to this)) + ) + (set! (-> *game-info* goal) (the float (-> this goal-score))) + (set! (-> *game-info* score) 0.0) + (set! (-> this current-score) (the-as uint 0)) + (set! (-> this current-spirit-vel) (-> this min-spirit-vel)) + (format 0 "num drops: ~d~%" (length (-> this score-drop-handles))) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-bbush-spirit-drop) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('goal) + (send-event self 'complete) + ) + (('score) + (let* ((v1-3 (-> block param 0)) + (v0-0 (the-as object (+ (-> self current-score) v1-3))) + ) + (set! (-> self current-score) (the-as uint v0-0)) + v0-0 + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self start-time)) + (set! (-> self time-limit) (seconds 60)) + (set! (-> self current-curve-distance) 1.0) + (set! (-> self current-curve-distance) 0.0) + ) + :exit (behavior () + (if *cty-attack-controller* + (logclear! (-> *cty-attack-controller* target-attacker flags) (city-attacker-info-flag cai3)) + ) + ) + :trans (behavior () + (local-vars (sv-240 vector) (sv-256 vector) (sv-272 vector)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (set! (-> *game-info* score) (the float (-> self current-score))) + (when (nonzero? (-> self actor-group)) + (dotimes (gp-0 (+ (length (-> self actor-group 0)) -1)) + (cond + ((and (>= (-> self path-pos) (the float gp-0)) (>= (the float (+ gp-0 1)) (-> self path-pos))) + (let ((v1-9 (-> self actor-group 0 data gp-0)) + (a1-2 (-> self actor-group 0 data (+ gp-0 1))) + ) + (when (and v1-9 a1-2) + (let ((s3-0 (-> v1-9 actor)) + (s5-0 (-> a1-2 actor)) + (s4-0 (new 'stack 'cubic-curve)) + ) + (new 'stack-no-clear 'vector) + (when (and s3-0 s5-0) + (let ((s2-0 s4-0) + (s1-0 (method-of-type cubic-curve cubic-curve-method-9)) + (s0-0 (-> s3-0 trans)) + ) + (set! sv-240 (new 'stack-no-clear 'vector)) + (let ((v0-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (f0-5 204800.0) + ) + (.lvf vf1 (&-> v0-1 quad)) + (let ((v1-16 f0-5)) + (.mov vf2 v1-16) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-240 quad) vf1) + (set! sv-256 (-> s5-0 trans)) + (set! sv-272 (new 'stack-no-clear 'vector)) + (let ((v0-2 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s5-0 quat))) + (f0-6 204800.0) + ) + (.lvf vf1 (&-> v0-2 quad)) + (let ((v1-21 f0-6)) + (.mov vf2 v1-21) + ) + ) + (.add.x.vf vf1 vf0 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> sv-272 quad) vf1) + (s1-0 s2-0 s0-0 sv-240 sv-256 sv-272) + ) + (set! (-> self current-curve-length) (vector-vector-distance (-> s3-0 trans) (-> s5-0 trans))) + (cubic-curve-method-10 s4-0 (-> self trans) (- (-> self path-pos) (the float gp-0))) + (cond + ((< (vector-vector-distance (target-pos 0) (-> s5-0 trans)) + (+ 102400.0 (vector-vector-distance (-> self trans) (-> s5-0 trans))) + ) + (let ((f0-13 (fmax (vector-length (-> *target* control transv)) (-> self high-spirit-vel)))) + (seek! (-> self current-spirit-vel) (-> self high-spirit-vel) (* 0.5 (seconds-per-frame) f0-13)) + ) + ) + (else + (seek! + (-> self current-spirit-vel) + (-> self min-spirit-vel) + (* 0.5 (seconds-per-frame) (-> self high-spirit-vel)) + ) + ) + ) + ) + ) + ) + ) + ) + (else + (set! (-> self current-curve-distance) 0.0) + ) + ) + ) + ) + (send-event (handle->process (-> self spirit)) 'trans (-> self trans)) + (send-trigger self) + (cond + ((-> self touched) + (+! (-> self current-curve-distance) (* (-> self current-spirit-vel) (seconds-per-frame))) + (+! (-> self path-pos) (/ (-> self current-curve-distance) (-> self current-curve-length))) + (when (< (the float (+ (length (-> self actor-group 0)) -1)) (-> self path-pos)) + (set! (-> self path-pos) (the float (+ (length (-> self actor-group 0)) -1))) + (send-event self 'fail) + ) + (if (< (-> self fail-radius) (vector-vector-distance (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + (if (or (< (-> self goal-score) (-> self current-score)) (= (-> self current-score) (-> self goal-score))) + (send-event self 'complete) + ) + ) + (else + (let ((f0-32 (vector-vector-distance-squared (target-pos 0) (-> self trans))) + (f1-17 20480.0) + ) + (when (< f0-32 (* f1-17 f1-17)) + (set! (-> self touched) #t) + (sound-play "start-pickup") + ) + ) + ) + ) + ) + ) + :code (behavior () + (set-setting! 'minimap 'clear 0.0 (minimap-flag minimap)) + (until #f + (suspend) + ) + #f + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc b/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc new file mode 100644 index 0000000000..0f1a1f5672 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/oasis/ash-oasis-course_REF.gc @@ -0,0 +1,513 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type ashelin-oasis +(deftype ashelin-oasis (ashelin) + ((player-in-bounds-time time-frame) + (last-speech-time time-frame) + (last-speech-id int32) + (last-sound-trans vector :inline) + (last-sound-id sound-id) + (minimap connection-minimap) + ) + (:methods + (set-frontline (_type_) none) + (ashelin-oasis-method-263 (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type ashelin-oasis +(defmethod inspect ((this ashelin-oasis)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type ashelin inspect))) + (t9-0 this) + ) + (format #t "~2Tplayer-in-bounds-time: ~D~%" (-> this player-in-bounds-time)) + (format #t "~2Tlast-speech-time: ~D~%" (-> this last-speech-time)) + (format #t "~2Tlast-speech-id: ~D~%" (-> this last-speech-id)) + (format #t "~2Tlast-sound-trans: #~%" (-> this last-sound-trans)) + (format #t "~2Tlast-sound-id: ~D~%" (-> this last-sound-id)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; definition for method 122 of type ashelin-oasis +(defmethod go-idle2 ((this ashelin-oasis)) + (go-idle this) + ) + +;; definition for method 262 of type ashelin-oasis +;; WARN: Return type mismatch int vs none. +(defmethod set-frontline ((this ashelin-oasis)) + (let ((a0-1 *target*)) + (when a0-1 + (set! (-> this frontline w) + (- (+ 40960.0 (vector-dot (the-as vector (-> this frontline)) (get-trans a0-1 0)))) + ) + 0 + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate traveling (ashelin-oasis) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type ashelin traveling) enter))) + (if t9-0 + (t9-0) + ) + ) + (nav-enemy-method-177 self) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (ashelin-oasis) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type ashelin knocked) exit))) + (if t9-0 + (t9-0) + ) + ) + (logclear! (-> self root penetrated-by) (penetrate vehicle)) + ) + ) + +;; definition for method 256 of type ashelin-oasis +(defmethod ashelin-method-256 ((this ashelin-oasis)) + (if (time-elapsed? (-> this last-speech-time) (seconds 10)) + ((method-of-type ashelin ashelin-method-256) this) + ) + (none) + ) + +;; definition for method 218 of type ashelin-oasis +;; WARN: Return type mismatch time-frame vs gui-connection. +(defmethod play-speech-by-id ((this ashelin-oasis) (arg0 int)) + (let* ((s4-0 (-> this course)) + (s3-0 (-> s4-0 speeches arg0)) + ) + (logior! (-> s3-0 flags) (bot-speech-info-flag playing)) + (let* ((t2-0 (-> s3-0 hold-time)) + (s5-0 (add-process + *gui-control* + this + (-> this channel) + (gui-action play) + (-> s3-0 name) + -99.0 + (the-as time-frame t2-0) + ) + ) + ) + (let ((v1-5 (-> s4-0 speech-tunings (-> s3-0 tuning-id)))) + (sound-params-set! + *gui-control* + s5-0 + (-> v1-5 trans?) + (-> v1-5 fo-min) + (-> v1-5 fo-max) + (-> v1-5 fo-curve) + -1.0 + ) + ) + (set! (-> this last-sound-id) s5-0) + ) + ) + (ashelin-oasis-method-263 this #t) + (let ((v0-3 (current-time))) + (set! (-> this last-speech-time) v0-3) + (the-as gui-connection v0-3) + ) + ) + +;; definition for method 263 of type ashelin-oasis +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod ashelin-oasis-method-263 ((this ashelin-oasis) (arg0 symbol)) + (with-pp + (when (channel-active? this (gui-channel none)) + (let* ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (math-camera-pos))) + (f30-0 (vector-length s4-1)) + (v1-7 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> (math-camera-matrix) fvec) f30-0)) + (s3-2 (new 'stack-no-clear 'vector)) + ) + (if (< f30-0 122880.0) + (set! (-> s3-2 quad) (-> v1-7 quad)) + (set! (-> s3-2 quad) (-> s4-1 quad)) + ) + (vector+! s3-2 s3-2 (math-camera-pos)) + (if arg0 + (set! (-> this last-sound-trans quad) (-> s3-2 quad)) + (vector-seek-3d-smooth! (-> this last-sound-trans) s3-2 (* 102400.0 (seconds-per-frame)) 1.0) + ) + ) + (when *sound-player-enable* + (let ((s5-1 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s5-1 command) (sound-command set-param)) + (set! (-> s5-1 id) (-> this last-sound-id)) + (let ((a1-4 (-> this last-sound-trans))) + (let ((gp-1 pp)) + (when (= a1-4 #t) + (if (and gp-1 (type? gp-1 process-drawable) (nonzero? (-> (the-as process-drawable gp-1) root))) + (set! a1-4 (-> (the-as process-drawable gp-1) root trans)) + (set! a1-4 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> s5-1 params trans) a1-4) + ) + (set! (-> s5-1 params mask) (the-as uint 32)) + (-> s5-1 id) + ) + ) + 0 + ) + 0 + (none) + ) + ) + +;; definition for method 59 of type ashelin-oasis +(defmethod enemy-common-post ((this ashelin-oasis)) + (let ((t9-0 (method-of-type ashelin enemy-common-post))) + (t9-0 this) + ) + (ashelin-oasis-method-263 this #f) + (none) + ) + +;; definition for method 27 of type ashelin-oasis +(defmethod get-inv-mass ((this ashelin-oasis)) + 0.033333335 + ) + +;; definition for method 82 of type ashelin-oasis +(defmethod event-handler ((this ashelin-oasis) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('impact-impulse) + (let ((v1-1 (the-as object (-> arg3 param 0)))) + (when (< 4096.0 (-> (the-as rigid-body-impact v1-1) impulse)) + (logior! (-> this root penetrated-by) (penetrate vehicle)) + (go (method-of-object this knocked)) + ((method-of-type ashelin event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + (else + ((method-of-type ashelin event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for symbol *ash-oasis-course*, type ashelin-course +(define *ash-oasis-course* + (new 'static 'ashelin-course + :speech-count #x2b + :spot-count #x6 + :attack-player-speeches (new 'static 'bot-speech-list-shuffle + :flags (bot-speech-list-flag bsl1 bsl2 bsl3) + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 5 1 2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19) + ) + :default-check-too-far #f + :waypoints (new 'static 'boxed-array :type bot-waypoint + (new 'static 'bot-waypoint + :waypoint-id 1 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-oasis)) + (bot-method-223 arg0) + (move-to-point! (-> arg0 root) (the-as vector (-> arg0 course spots 0))) + (let ((v1-6 25)) + (set! (-> arg0 hit-points) (the float v1-6)) + (set! (-> arg0 enemy-info default-hit-points) (the float v1-6)) + ) + (set! (-> arg0 waypoint-time0) 0) + (go-to-waypoint! arg0 3 #f) + (ai-task-control-method-10 (-> arg0 ai-ctrl) arg0) + #t + ) + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 2 + :nav-mesh-index -1 + :skip-to -1 + :on-set #f + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 3 + :nav-mesh-index -1 + :skip-to -1 + :on-set (lambda ((arg0 ashelin-oasis)) + (send-event arg0 'hide #f) + (set! (-> arg0 minimap) (add-icon! *minimap* arg0 (the-as uint 146) (the-as int #f) (the-as vector #t) 0)) + (set-time! (-> arg0 last-speech-time)) + (ashelin-method-261 arg0 #t) + (set! (-> arg0 notice-enemy-dist) 245760.0) + (logior! (-> arg0 bot-flags) (bot-flag bf06)) + (logior! (-> arg0 bot-flags) (bot-flag bf20)) + (let ((s5-0 (-> arg0 course spots))) + (vector-! (the-as vector (-> arg0 frontline)) (the-as vector (-> s5-0 2)) (the-as vector (-> s5-0 1))) + (vector-normalize! (-> arg0 frontline) 1.0) + (set! (-> arg0 frontline w) (- (vector-dot (the-as vector (-> arg0 frontline)) (the-as vector (-> s5-0 1))))) + ) + (set-frontline arg0) + (let ((v1-23 (get-task-by-type (-> arg0 ai-ctrl) asht-wait-spot arg0))) + (set! (-> v1-23 bytes 5) 2) + (set! (-> v1-23 bytes 6) 3) + (set! (-> v1-23 bytes 7) 4) + (let ((v0-6 + (lambda ((arg0 asht-wait-spot) (arg1 ashelin-oasis)) + (when (and (not (channel-active? arg1 (gui-channel none))) (time-elapsed? (-> arg1 last-speech-time) (seconds 5))) + (cond + ((and (not (course-speech-playing? arg1 35)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 1))) + (play-speech-by-id arg1 35) + ) + ((and (not (course-speech-playing? arg1 39)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 30))) + (play-speech-by-id arg1 39) + ) + ((and (not (course-speech-playing? arg1 37)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 60))) + (play-speech-by-id arg1 37) + ) + ((and (not (course-speech-playing? arg1 38)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 90))) + (play-speech-by-id arg1 38) + ) + ((and (not (course-speech-playing? arg1 36)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 120))) + (play-speech-by-id arg1 36) + ) + ((and (not (course-speech-playing? arg1 42)) (time-elapsed? (-> arg1 waypoint-time0) (seconds 150))) + (play-speech-by-id arg1 42) + ) + ) + ) + ) + ) + ) + (set! (-> (the-as asht-wait-spot v1-23) check-done) (the-as (function asht-wait-spot ashelin symbol) v0-6)) + v0-6 + ) + ) + ) + :on-update (lambda ((arg0 ashelin-oasis)) + (local-vars (v0-5 bot-flag)) + (set-frontline arg0) + (let* ((a1-0 (target-pos 0)) + (f0-0 (vector-vector-xz-distance-squared (-> arg0 root trans) a1-0)) + (f1-0 409600.0) + (s5-0 (< f0-0 (* f1-0 f1-0))) + ) + (if s5-0 + (set-time! (-> arg0 player-in-bounds-time)) + ) + (when (time-elapsed? (-> arg0 player-in-bounds-time) (seconds 6)) + (send-event arg0 'instant-death) + (play-speech-by-id arg0 41) + ) + (cond + ((not s5-0) + (set! v0-5 (logior (-> arg0 bot-flags) (bot-flag bf10))) + (set! (-> arg0 bot-flags) v0-5) + ) + (else + (set! v0-5 (logclear (-> arg0 bot-flags) (bot-flag bf10))) + (set! (-> arg0 bot-flags) v0-5) + ) + ) + ) + v0-5 + ) + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 4 + :nav-mesh-index -1 + :skip-to -1 + :on-set #f + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + (new 'static 'bot-waypoint + :waypoint-id 5 + :nav-mesh-index -1 + :skip-to -1 + :on-set #f + :on-update #f + :on-skipping-here #f + :check-too-far #f + ) + ) + :speeches (new 'static 'inline-array bot-speech-info 43 + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha008") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha002") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf10) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha003" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf06) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha004" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf06) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha005" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha006") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha018" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha019") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha020" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha021" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha022" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha023" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha024" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha025" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha026") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha027" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha028") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha029" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf10) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha030" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf09) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha031" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha035") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha036") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha039") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha041") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha052") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha054") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha014") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha015") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha016") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha017") + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf11) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha038" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf11) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha044" + ) + (new 'static 'bot-speech-info + :flags (bot-speech-info-flag sf11) + :hold-time (seconds 0.3) + :slave-id -1 + :name "asha049" + ) + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha032") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha034") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha037") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "asha042") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash104") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash111") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash113") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash114") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash117") + (new 'static 'bot-speech-info :hold-time (seconds 0.3) :slave-id -1 :name "ash118") + ) + :speech-tunings (new 'static 'inline-array bot-speech-tuning 1 + (new 'static 'bot-speech-tuning :fo-min 15 :fo-max #x12c :fo-curve 9 :trans? #f) + ) + :spots (new 'static 'inline-array bot-spot 6 + (new 'static 'bot-spot :center (new 'static 'vector :x 2540830.8 :y 72540.16 :z 10318971.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2381537.2 :y 85770.24 :z 10326016.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2333696.0 :y 87941.12 :z 10350346.0 :w 4096.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2456617.0 :y 87777.28 :z 10412892.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2405294.0 :y 84623.36 :z 10283336.0 :w 16384.0)) + (new 'static 'bot-spot :center (new 'static 'vector :x 2439454.8 :y 106086.4 :z 10570424.0 :w 16384.0)) + ) + :ouch-speeches (new 'static 'bot-speech-list-shuffle + :flags (bot-speech-list-flag bsl1 bsl2) + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 26 27 28 29 30 31 32 40) + ) + :victory-speeches (new 'static 'bot-speech-list-shuffle + :flags (bot-speech-list-flag bsl2 bsl3) + :last-local-index -1 + :speech-indexes (new 'static 'boxed-array :type int16 0 20 21 22 23 24 25) + ) + ) + ) + +;; failed to figure out what this is: +(set! (-> *bot-course-table* course 0) *ash-oasis-course*) + + + + diff --git a/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc b/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc new file mode 100644 index 0000000000..7c4c665d4e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/desert/oasis/oasis-defense_REF.gc @@ -0,0 +1,911 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type oasis-point +(deftype oasis-point (structure) + ((pos vector :inline) + (quat quaternion :inline) + ) + ) + +;; definition for method 3 of type oasis-point +(defmethod inspect ((this oasis-point)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'oasis-point) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tquat: #~%" (-> this quat)) + (label cfg-4) + this + ) + +;; definition for symbol *oasis-marauder-start*, type (array oasis-point) +(define *oasis-marauder-start* (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2458461.0 :y 81688.164 :z 10302577.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0006 :y 0.5862 :z -0.0012 :w 0.8101) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2450950.2 :y 82370.97 :z 10330767.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0008 :y -0.7239 :z 0.001 :w -0.6898) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2458173.8 :y 82435.69 :z 10352404.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.001 :y 0.8624 :z -0.0008 :w 0.506) + ) + ) + ) + +;; definition for symbol *oasis-vehicle-start*, type (array oasis-point) +(define *oasis-vehicle-start* (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2378927.8 :y 89453.77 :z 10338013.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0047 :y 0.8075 :z -0.0137 :w 0.5896) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2416701.5 :y 87323.85 :z 10297737.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0007 :y -0.1249 :z -0.0329 :w 0.9916) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2411298.5 :y 90682.984 :z 10373812.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.041 :y 0.9921 :z -0.0557 :w 0.104) + ) + ) + ) + +;; definition for symbol *oasis-vehicle-path*, type (array (array oasis-point)) +(define *oasis-vehicle-path* (the-as (array (array oasis-point)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1643712.1 :y 135682.05 :z 10027475.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0013 :y 0.52 :z 0.0005 :w 0.8541) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1834901.5 :y 126926.03 :z 10381510.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.4936 :w 0.8696) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2164965.5 :y 103604.23 :z 10309546.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.7718 :w 0.6357) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2351683.5 :y 89942.836 :z 10210302.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9924 :w -0.1222) + ) + ) + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2656992.8 :y 158144.11 :z 12118015.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9957 :w 0.092) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2729601.5 :y 154424.11 :z 11455859.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9626 :w 0.2709) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2346952.2 :y 104915.766 :z 10551702.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7954 :w 0.6059) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2446049.2 :y 93183.59 :z 10450630.0 :w 1.0) + :quat (new 'static 'quaternion :x -0.0005 :y -0.999 :z 0.0014 :w -0.044) + ) + ) + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1486110.8 :y 118251.52 :z 11689861.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9323 :w 0.3615) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1744946.0 :y 140856.11 :z 10625518.0 :w 1.0) + :quat (new 'static 'quaternion :x 0.0001 :y -0.7207 :z 0.0015 :w -0.6932) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2165376.5 :y 96137.625 :z 10535523.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9339 :w -0.3572) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2379151.2 :y 85637.12 :z 10319897.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9317 :w -0.3631) + ) + ) + ) + ) + ) + +;; definition for symbol *oasis-vehicle-fx-path*, type (array (array oasis-point)) +(define *oasis-vehicle-fx-path* (the-as (array (array oasis-point)) + (new 'static 'boxed-array :type array + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 1905749.2 :y 139053.06 :z 11196600.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.876 :w -0.4823) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2656209.8 :y 67824.44 :z 10573690.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.876 :w -0.4823) + ) + ) + (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2206190.0 :y 154991.83 :z 11345007.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9882 :w -0.153) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2565465.0 :y 111149.055 :z 10101822.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.9882 :w -0.153) + ) + ) + ) + ) + ) + +;; definition for symbol *oasis-marauder-spawn-point*, type (array oasis-point) +(define *oasis-marauder-spawn-point* (new 'static 'boxed-array :type oasis-point + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2397388.5 :y 91552.56 :z 10411445.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8685 :w 0.4955) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2498060.2 :y 95181.62 :z 10163618.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.0501 :w 0.9987) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2601913.5 :y 70653.95 :z 10246909.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.2036 :w -0.979) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2304180.2 :y 88062.36 :z 10259569.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.3212 :w -0.9469) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2293810.0 :y 89958.4 :z 10373563.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.7906 :w -0.6123) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2557681.8 :y 86204.01 :z 10528274.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9788 :w -0.2044) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2483336.8 :y 95299.99 :z 10500398.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.9819 :w -0.189) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2579720.2 :y 69928.55 :z 10425897.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.8771 :w -0.4801) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2405315.0 :y 90315.164 :z 10202601.0 :w 1.0) + :quat (new 'static 'quaternion :y -0.2878 :w -0.9576) + ) + (new 'static 'oasis-point + :pos (new 'static 'vector :x 2543300.5 :y 79528.76 :z 10235757.0 :w 1.0) + :quat (new 'static 'quaternion :y 0.493 :w -0.87) + ) + ) + ) + +;; definition of type oasis-vehicle +(deftype oasis-vehicle (structure) + ((handle handle) + (path-type int8) + (path-pos int8) + (spawned-marauder? symbol) + ) + :pack-me + ) + +;; definition for method 3 of type oasis-vehicle +(defmethod inspect ((this oasis-vehicle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'oasis-vehicle) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tpath-type: ~D~%" (-> this path-type)) + (format #t "~1Tpath-pos: ~D~%" (-> this path-pos)) + (format #t "~1Tspawned-marauder?: ~A~%" (-> this spawned-marauder?)) + (label cfg-4) + this + ) + +;; definition of type oasis-marauder +(deftype oasis-marauder (structure) + ((handle handle) + (initialized? symbol) + ) + :pack-me + ) + +;; definition for method 3 of type oasis-marauder +(defmethod inspect ((this oasis-marauder)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'oasis-marauder) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tinitialized?: ~A~%" (-> this initialized?)) + (label cfg-4) + this + ) + +;; definition of type task-manager-desert-oasis-defense +(deftype task-manager-desert-oasis-defense (task-manager) + ((nav-mesh nav-mesh) + (vehicle oasis-vehicle 3 :inline) + (vehicle-count uint8) + (v-free-list (array uint8)) + (marauder oasis-marauder 7 :inline) + (m-free-list (array uint8)) + (marauder-count uint8) + (total-spawned uint8) + (total-veh-spawned uint8) + (check-timer time-frame) + (trans-timer time-frame) + (veh-fx handle 2) + (veh-fx-timer time-frame) + (ash-entity entity-actor) + (marauder-entity entity-actor) + (last-kill-time time-frame) + ) + (:methods + (spawn-v-marauder (_type_ int int) handle) + (spawn-marauder (_type_ oasis-point symbol) handle) + (task-manager-desert-oasis-defense-method-34 (_type_) none) + (task-manager-desert-oasis-defense-method-35 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-desert-oasis-defense +(defmethod inspect ((this task-manager-desert-oasis-defense)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~2Tvehicle[3] @ #x~X~%" (-> this vehicle)) + (format #t "~2Tvehicle-count: ~D~%" (-> this vehicle-count)) + (format #t "~2Tv-free-list: ~A~%" (-> this v-free-list)) + (format #t "~2Tmarauder[7] @ #x~X~%" (-> this marauder)) + (format #t "~2Tm-free-list: ~A~%" (-> this m-free-list)) + (format #t "~2Tmarauder-count: ~D~%" (-> this marauder-count)) + (format #t "~2Ttotal-spawned: ~D~%" (-> this total-spawned)) + (format #t "~2Ttotal-veh-spawned: ~D~%" (-> this total-veh-spawned)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Ttrans-timer: ~D~%" (-> this trans-timer)) + (format #t "~2Tveh-fx[2] @ #x~X~%" (-> this veh-fx)) + (format #t "~2Tveh-fx-timer: ~D~%" (-> this veh-fx-timer)) + (format #t "~2Tash-entity: ~A~%" (-> this ash-entity)) + (format #t "~2Tmarauder-entity: ~A~%" (-> this marauder-entity)) + (format #t "~2Tlast-kill-time: ~D~%" (-> this last-kill-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-desert-oasis-defense) + :virtual #t + :code (behavior () + (local-vars (f30-1 float)) + (when (not (task-node-closed? (game-task-node desert-oasis-defense-meeting))) + (was-squad-manager-start self) + (let ((v1-1 *was-squad-control*)) + (set! (-> v1-1 target-count) 3) + (set! (-> v1-1 reserve-count) 40) + ) + (loop + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self ash-entity extra trans quad)) + (let ((f30-0 (vector-vector-distance gp-0 (target-pos 0)))) + (when (and *was-squad-manager* (< f30-0 3276800.0)) + (set! (-> *was-squad-control* target-count) 0) + 0 + ) + (if (and (< f30-0 819200.0) (-> *setting-control* user-current turbo)) + (set-setting! 'turbo #f 0.0 0) + ) + (when (< f30-0 327680.0) + (was-squad-manager-kill) + (set-setting! 'stop-vehicle? #t 0.0 0) + (send-event *target* 'change-mode 'normal) + (set-setting! 'pilot #f 0.0 0) + #t + (goto cfg-23) + ) + ) + ) + (suspend) + 0 + ) + ) + (label cfg-23) + (when (and *target* (focus-test? *target* pilot-riding) (handle->process (-> *target* pilot vehicle))) + (-> self player-vehicle) + (let ((v1-49 (-> *target* pilot vehicle))) + (send-event (handle->process v1-49) 'ignore-damage #t) + ) + ) + (while (not (task-node-closed? (game-task-node desert-oasis-defense-meeting))) + (suspend) + ) + (when (not (task-node-closed? (game-task-node desert-oasis-defense-battle))) + (set-setting! 'string-max-length 'abs (meters 18.5) 0) + (set-setting! 'string-max-height 'abs (meters 6) 0) + (set-setting! 'music 'oasisfi 0.0 0) + (set-setting! 'fog-special-interp-rate #f 0.025 0) + (set-setting! 'fog-special-interp-targ #f 0.9 0) + (dotimes (gp-1 (length *oasis-vehicle-start*)) + (spawn-v-marauder self -1 gp-1) + ) + (dotimes (gp-2 (length *oasis-marauder-start*)) + (spawn-marauder self (-> *oasis-marauder-start* gp-2) #f) + ) + (set-time! (-> self check-timer)) + (set-time! (-> self veh-fx-timer)) + (set! (-> self hud-counter) + (ppointer->handle (process-spawn hud-marauder :init hud-init-by-other :name "hud-marauder" :to self)) + ) + (set! (-> *game-info* counter) (the float (- (+ (-> self marauder-count) 57) (-> self total-spawned)))) + (until (and (>= (-> self total-spawned) (the-as uint 57)) + (zero? (-> self marauder-count)) + (zero? (-> self vehicle-count)) + ) + (when (>= (+ (current-time) (seconds -20)) (-> self veh-fx-timer)) + (dotimes (gp-4 2) + (when (= (-> self veh-fx gp-4) #f) + (when (rand-vu-percent? 0.7) + (let ((s5-1 (-> *oasis-vehicle-fx-path* gp-4 0)) + (s4-0 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + ) + (vector-z-quaternion! (-> s4-0 vec) (-> s5-1 quat)) + (vector-float*! (-> s4-0 vec) (-> s4-0 vec) 204800.0) + (set! (-> s4-0 params object-type) (the-as uint 6)) + (set! (-> s4-0 params behavior) (the-as uint 3)) + (set! (-> s4-0 params id) (the-as uint 0)) + (set! (-> s4-0 params nav-mesh) (-> self nav-mesh)) + (set! (-> s4-0 params nav-branch) #f) + (set! (-> s4-0 params proc) #f) + (set! (-> s4-0 params handle) (the-as handle #f)) + (set! (-> s4-0 params user-data) (the-as uint 0)) + (set! (-> s4-0 params flags) (traffic-spawn-flags)) + (set! (-> s4-0 params guard-type) (the-as uint 11)) + (set! (-> s4-0 params entity) #f) + (set! (-> s4-0 params velocity quad) (-> s4-0 vec quad)) + (set! (-> s4-0 params position quad) (-> s5-1 pos quad)) + (quaternion-copy! (-> s4-0 params rotation) (-> s5-1 quat)) + (let ((s5-2 (vehicle-spawn (vehicle-type v-marauder) (-> s4-0 params)))) + (when s5-2 + (iterate-prims + (the-as collide-shape-moving (-> s5-2 root)) + (lambda ((arg0 collide-shape-prim)) (logior! (-> arg0 prim-core collide-as) (collide-spec enemy)) (none)) + ) + (logior! (-> s5-2 mask) (process-mask enemy)) + (set! (-> self veh-fx gp-4) (process->handle s5-2)) + (suspend) + (send-event + (handle->process (-> self veh-fx gp-4)) + 'ai-set-target-position + (-> *oasis-vehicle-fx-path* gp-4 1 pos) + ) + (send-event (handle->process (-> self veh-fx gp-4)) 'ai-set-target-speed 327680.0) + ) + ) + ) + ) + ) + ) + (set-time! (-> self veh-fx-timer)) + ) + (when (>= (+ (current-time) (seconds -2.5)) (-> self check-timer)) + (when (and (< (-> self vehicle-count) (the-as uint 3)) (< (-> self total-spawned) (the-as uint 57))) + (let ((gp-5 0)) + (dotimes (v1-156 3) + (let ((a0-71 (-> self vehicle v1-156))) + (if (!= (-> a0-71 handle) #f) + (set! gp-5 (logior gp-5 (ash 1 (-> a0-71 path-type)))) + ) + ) + ) + (spawn-v-marauder self (rand-vu-int-count-excluding (length *oasis-vehicle-path*) gp-5) -1) + ) + ) + (let ((gp-6 (-> (camera-matrix) fvec)) + (s5-4 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-2 (length *oasis-marauder-spawn-point*)) + (when (and (< (-> self marauder-count) (the-as uint 7)) (< (-> self total-spawned) (the-as uint 57))) + (let ((s3-1 (-> *oasis-marauder-spawn-point* s4-2))) + (vector-! s5-4 (-> s3-1 pos) (camera-pos)) + (if (< (vector-dot gp-6 s5-4) 0.0) + (spawn-marauder self s3-1 #f) + ) + ) + ) + ) + ) + (set-time! (-> self check-timer)) + ) + (let ((v1-182 (- (+ (-> self marauder-count) 57) (-> self total-spawned)))) + (cond + ((zero? v1-182) + (when (-> self hud-counter) + (send-event (handle->process (-> self hud-counter)) 'hide-and-die) + (set! (-> self hud-counter) (the-as handle #f)) + ) + ) + (else + (set! (-> *game-info* counter) (the float v1-182)) + ) + ) + ) + (suspend) + ) + (dotimes (gp-7 2) + (let ((a0-92 (handle->process (-> self veh-fx gp-7)))) + (when a0-92 + (deactivate a0-92) + (set! (-> self veh-fx gp-7) (the-as handle #f)) + ) + ) + ) + (set-setting! 'fog-special-interp-rate #f 0.2 0) + (set-setting! 'fog-special-interp-targ #f 0.2 0) + (when (handle->process (-> *game-info* dust-storm)) + 1.0 + (let ((gp-8 (-> *game-info* dust-storm))) + (until (< f30-1 0.4) + (let ((a1-37 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-37 from) (process->ppointer self)) + (set! (-> a1-37 num-params) 0) + (set! (-> a1-37 message) 'get-intensity) + (let ((t9-42 send-event-function) + (a0-102 (handle->process gp-8)) + ) + (set! f30-1 (the-as float (t9-42 a0-102 a1-37))) + ) + ) + (suspend) + ) + ) + ) + (send-event self 'complete) + ) + (sleep-code) + ) + :post (behavior () + (task-manager-desert-oasis-defense-method-35 self) + 0 + ) + ) + +;; definition for method 34 of type task-manager-desert-oasis-defense +;; ERROR: function was not converted to expressions. Cannot decompile. + +;; definition for method 26 of type task-manager-desert-oasis-defense +;; INFO: Used lq/sq +;; WARN: Return type mismatch time-frame vs none. +(defmethod task-manager-method-26 ((this task-manager-desert-oasis-defense)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (time-elapsed? (-> this trans-timer) (seconds 0.1)) + (dotimes (s5-0 3) + (let ((s4-0 (-> this vehicle s5-0)) + (v1-8 (-> this vehicle s5-0 handle)) + ) + (when (!= v1-8 #f) + (let ((s3-0 (handle->process v1-8))) + (cond + (s3-0 + (when (>= (-> s4-0 path-type) 0) + (let* ((s2-0 (-> *oasis-vehicle-path* (-> s4-0 path-type) (-> s4-0 path-pos))) + (s1-0 (= (+ (length (-> *oasis-vehicle-path* (-> s4-0 path-type))) -1) (-> s4-0 path-pos))) + (f30-0 (vector-vector-distance-squared (-> s2-0 pos) (-> (the-as process-drawable s3-0) root trans))) + ) + (when (and (not s1-0) (let ((f0-0 81920.0)) + (< f30-0 (* f0-0 f0-0)) + ) + ) + (+! (-> s4-0 path-pos) 1) + (send-event s3-0 'ai-set-target-position (-> *oasis-vehicle-path* (-> s4-0 path-type) (-> s4-0 path-pos) pos)) + (send-event s3-0 'ai-set-target-speed 163840.0) + (send-event s3-0 'ai-set-target-process *target*) + ) + (if (and s1-0 (let ((f0-3 122880.0)) + (< f30-0 (* f0-3 f0-3)) + ) + ) + (send-event s3-0 'ai-set-target-speed 122880.0) + ) + (when (-> s4-0 spawned-marauder?) + (send-event s3-0 'ai-set-target-speed 81920.0) + (send-event s3-0 'ai-set-target-position (-> *oasis-vehicle-path* (-> s4-0 path-type) (-> s4-0 path-pos) pos)) + ) + (when (and s1-0 (not (-> s4-0 spawned-marauder?)) (let ((f0-6 40960.0)) + (and (< f30-0 (* f0-6 f0-6)) + (< (-> this marauder-count) (the-as uint 7)) + (< (-> this total-spawned) (the-as uint 57)) + ) + ) + ) + (let ((a1-10 (handle->process (spawn-marauder this s2-0 #t)))) + (when a1-10 + (let ((v1-83 (new 'stack-no-clear 'wvehicle-ai-drop-off-params))) + (set! (-> v1-83 proc) a1-10) + (set! (-> v1-83 dest quad) (-> s2-0 pos quad)) + (send-event s3-0 'ai-drop-off v1-83) + ) + (set! (-> s4-0 spawned-marauder?) #t) + ) + ) + ) + ) + ) + ) + (else + (set! (-> this vehicle s5-0 handle) (the-as handle #f)) + (+! (-> this vehicle-count) -1) + (let ((s4-1 (-> this v-free-list))) + (set! (-> s4-1 (length s4-1)) (the-as uint s5-0)) + (+! (-> s4-1 length) 1) + ) + ) + ) + ) + ) + ) + ) + (dotimes (s5-1 2) + (let ((s4-2 (handle->process (-> this veh-fx s5-1)))) + (cond + (s4-2 + (let ((f30-1 (vector-vector-distance-squared + (-> *oasis-vehicle-fx-path* s5-1 1 pos) + (-> (the-as process-drawable s4-2) root trans) + ) + ) + ) + (let ((f0-9 102400.0)) + (when (< f30-1 (* f0-9 f0-9)) + (let* ((s2-1 (-> (the-as process-drawable s4-2) root quat)) + (s3-2 (vector-normalize! (vector-x-quaternion! (new 'stack-no-clear 'vector) s2-1) 40960.0)) + (v1-109 (vector-normalize! (vector-y-quaternion! (new 'stack-no-clear 'vector) s2-1) 102400.0)) + ) + (vector+! s3-2 (-> (the-as process-drawable s4-2) root trans) s3-2) + (send-event s4-2 'apply-impulse s3-2 v1-109) + ) + ) + ) + (let ((f0-12 40960.0)) + (when (< f30-1 (* f0-12 f0-12)) + (send-event + s4-2 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 2000.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.0) + (attacker-velocity (new 'static 'vector :w 1.0)) + ) + ) + ) + (set! (-> this veh-fx s5-1) (the-as handle #f)) + ) + ) + ) + ) + (else + (set! (-> this veh-fx s5-1) (the-as handle #f)) + ) + ) + ) + ) + (dotimes (s5-2 7) + (let* ((s3-3 (-> this marauder s5-2)) + (v1-129 (-> s3-3 handle)) + ) + (when (!= v1-129 #f) + (let* ((s2-2 (handle->process v1-129)) + (s4-3 (if (type? s2-2 process-focusable) + s2-2 + ) + ) + ) + (cond + (s4-3 + (cond + ((not (-> s3-3 initialized?)) + (send-event s4-3 'go-hostile) + (send-event s4-3 'target-pos (target-pos 0)) + (set! (-> s3-3 initialized?) #t) + ) + ((and (-> s3-3 initialized?) + (and (-> s4-3 next-state) (= (-> s4-3 next-state name) 'dormant)) + (>= (+ (current-time) (seconds -10)) (-> this last-kill-time)) + ) + (deactivate s4-3) + ) + ) + ) + (else + (set! (-> this marauder s5-2 handle) (the-as handle #f)) + (+! (-> this marauder-count) -1) + (let ((s4-4 (-> this m-free-list))) + (set! (-> s4-4 (length s4-4)) (the-as uint s5-2)) + (+! (-> s4-4 length) 1) + ) + (set-time! (-> this last-kill-time)) + ) + ) + ) + ) + ) + ) + (set-time! (-> this trans-timer)) + ) + (none) + ) + +;; definition for method 35 of type task-manager-desert-oasis-defense +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-desert-oasis-defense-method-35 ((this task-manager-desert-oasis-defense)) + 0 + (none) + ) + +;; definition for method 33 of type task-manager-desert-oasis-defense +;; INFO: Used lq/sq +(defmethod spawn-marauder ((this task-manager-desert-oasis-defense) (arg0 oasis-point) (arg1 symbol)) + (let ((s5-0 (-> this m-free-list))) + (when (nonzero? (length s5-0)) + (let ((s3-0 (-> this marauder (-> s5-0 (+ (length s5-0) -1)))) + (s2-0 49) + (f30-0 30.0) + ) + (let ((v1-13 (-> *game-info* sub-task-list (game-task-node desert-oasis-defense-battle)))) + (when (and v1-13 (>= (-> v1-13 death-count) 0)) + (when (and *target* (and (>= 5.0 (-> *target* fact health)) (rand-vu-percent? 0.6))) + (set! s2-0 20) + (set! f30-0 2.0) + ) + ) + ) + (let ((s0-0 (new 'stack-no-clear 'marauder-init-by-other-params))) + (set! (-> s0-0 trans quad) (-> arg0 pos quad)) + (quaternion-copy! (-> s0-0 quat) (-> arg0 quat)) + (set! (-> s0-0 entity) (-> this marauder-entity)) + (set! (-> s0-0 directed?) #f) + (set! (-> s0-0 no-initial-move-to-ground?) #t) + (set! (-> s0-0 multi-focus) #t) + (set! (-> s0-0 skip-jump) #f) + (let* ((s1-2 (ppointer->process (process-spawn marauder this s0-0 :name "marauder" :to this))) + (s0-1 (if (type? s1-2 process-focusable) + s1-2 + ) + ) + (s1-3 (if (type? s0-1 marauder) + (the-as marauder s0-1) + ) + ) + ) + (when s1-3 + (change-to (-> this nav-mesh) s1-3) + (let ((v1-38 (-> s1-3 nav state))) + (set! (-> v1-38 current-poly) (the-as nav-poly #f)) + ) + 0 + (reset-to-collide-spec (-> s1-3 focus) (collide-spec jak bot hit-by-others-list player-list jak-vehicle)) + (logior! (-> s1-3 fact options) (actor-option dont-override-fact)) + (set! (-> s1-3 fact pickup-type) (the-as pickup-type s2-0)) + (set! (-> s1-3 fact pickup-amount) f30-0) + (set! (-> s1-3 fact pickup-spawn-amount) f30-0) + (set! (-> s3-0 handle) (process->handle s1-3)) + (set! (-> s3-0 initialized?) arg1) + (+! (-> this marauder-count) 1) + (+! (-> s5-0 length) -1) + (+! (-> this total-spawned) 1) + (add-icon! *minimap* s1-3 (the-as uint 117) (the-as int #f) (the-as vector #t) 0) + (return (-> s3-0 handle)) + ) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +;; definition for method 32 of type task-manager-desert-oasis-defense +;; INFO: Used lq/sq +(defmethod spawn-v-marauder ((this task-manager-desert-oasis-defense) (arg0 int) (arg1 int)) + (local-vars (sv-240 mystery-traffic-object-spawn-params0)) + (let ((s5-0 (-> this v-free-list)) + (s4-0 (>= arg1 0)) + ) + (when (nonzero? (length s5-0)) + (let ((s3-0 (-> this vehicle (-> s5-0 (+ (length s5-0) -1))))) + (let ((s0-0 (if s4-0 + (-> *oasis-vehicle-start* arg1) + (-> *oasis-vehicle-path* arg0 0) + ) + ) + ) + (set! sv-240 (new 'stack-no-clear 'mystery-traffic-object-spawn-params0)) + (vector-z-quaternion! (-> sv-240 vec) (-> s0-0 quat)) + (vector-float*! (-> sv-240 vec) (-> sv-240 vec) (if s4-0 + 0.0 + 204800.0 + ) + ) + (set! (-> sv-240 params object-type) (the-as uint 6)) + (set! (-> sv-240 params behavior) (the-as uint 3)) + (set! (-> sv-240 params id) (the-as uint 0)) + (set! (-> sv-240 params nav-mesh) (-> this nav-mesh)) + (set! (-> sv-240 params nav-branch) #f) + (set! (-> sv-240 params proc) #f) + (set! (-> sv-240 params handle) (the-as handle #f)) + (set! (-> sv-240 params user-data) (the-as uint 0)) + (set! (-> sv-240 params flags) (traffic-spawn-flags)) + (set! (-> sv-240 params guard-type) (the-as uint 11)) + (set! (-> sv-240 params entity) #f) + (set! (-> sv-240 params velocity quad) (-> sv-240 vec quad)) + (set! (-> sv-240 params position quad) (-> s0-0 pos quad)) + (quaternion-copy! (-> sv-240 params rotation) (-> s0-0 quat)) + ) + (let ((s0-1 (vehicle-spawn (vehicle-type v-marauder) (-> sv-240 params)))) + (when s0-1 + (iterate-prims + (the-as collide-shape-moving (-> s0-1 root)) + (lambda ((arg0 collide-shape-prim)) (logior! (-> arg0 prim-core collide-as) (collide-spec enemy)) (none)) + ) + (logior! (-> s0-1 mask) (process-mask enemy)) + (send-event s0-1 'ai-set-attack-delay-factor 4.0) + (send-event s0-1 'ai-set-inaccuracy-factor 2.0) + (set! arg0 (cond + (s4-0 + arg1 + ) + (else + (empty) + arg0 + ) + ) + ) + (set! (-> s3-0 path-type) arg0) + (set! (-> s3-0 path-pos) (if s4-0 + (+ (length (-> *oasis-vehicle-path* arg1)) -1) + 0 + ) + ) + (set! (-> s3-0 handle) (process->handle s0-1)) + (set! (-> s3-0 spawned-marauder?) (if s4-0 + #t + #f + ) + ) + (+! (-> this vehicle-count) 1) + (+! (-> s5-0 length) -1) + (+! (-> this total-veh-spawned) 1) + (return (-> s3-0 handle)) + ) + ) + ) + ) + ) + (the-as handle #f) + ) + +;; definition for method 25 of type task-manager-desert-oasis-defense +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-desert-oasis-defense)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (send-event (handle->process (-> this player-vehicle)) 'ignore-damage #f) + (none) + ) + +;; definition for method 21 of type task-manager-desert-oasis-defense +;; WARN: Return type mismatch int vs none. +(defmethod set-time-limit ((this task-manager-desert-oasis-defense)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this nav-mesh) (get-nav-mesh (the-as actor-id #xb5d9))) + (set! (-> this v-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 3)) + (dotimes (v1-2 3) + (set! (-> this vehicle v1-2 handle) (the-as handle #f)) + (set! (-> this vehicle v1-2 spawned-marauder?) #f) + (set! (-> this v-free-list v1-2) (the-as uint v1-2)) + ) + (set! (-> this v-free-list length) 3) + (set! (-> this m-free-list) (new 'static 'boxed-array :type uint8 :length 0 :allocated-length 7)) + (dotimes (v1-7 7) + (set! (-> this marauder v1-7 handle) (the-as handle #f)) + (set! (-> this marauder v1-7 initialized?) #f) + (set! (-> this m-free-list v1-7) (the-as uint v1-7)) + ) + (set! (-> this m-free-list length) 7) + (set! (-> this ash-entity) (the-as entity-actor (entity-by-name "ashelin-npc-3"))) + (set! (-> this marauder-entity) (the-as entity-actor (entity-by-name "marauder-2"))) + (dotimes (v1-11 2) + (set! (-> this veh-fx v1-11) (the-as handle #f)) + ) + (if (= (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-snake v-toad v-fox)) + (set! (-> *game-info* current-vehicle) (game-vehicle-u8 v-turtle v-scorpion v-toad)) + ) + (none) + ) + +;; definition of type desoasis-hellcat +(deftype desoasis-hellcat (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type desoasis-hellcat +(defmethod inspect ((this desoasis-hellcat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-desoasis-hellcat hellcat hellcat-lod0-jg hellcat-idle-ja + ((hellcat-lod0-mg (meters 20)) (hellcat-lod1-mg (meters 40)) (hellcat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow hellcat-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defstate idle (desoasis-hellcat) + :virtual #t + :code sleep-code + ) + +;; definition for method 11 of type desoasis-hellcat +(defmethod init-from-entity! ((this desoasis-hellcat) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 34816.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-2) + ) + (set! (-> s4-0 nav-radius) 34816.0) + (let ((v1-4 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-4 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-4 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (add-process-drawable-to-nav-mesh (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0) this #f) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-desoasis-hellcat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (transform-post) + (go (method-of-object this idle)) + ) diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc index a5b4442ca7..d71a19750e 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/was-squad-control_REF.gc @@ -577,11 +577,9 @@ ) ;; definition for function was-squad-manager-start -;; WARN: Return type mismatch (pointer process) vs none. (defun was-squad-manager-start ((arg0 process)) (kill-by-type was-squad-manager *active-pool*) (process-spawn was-squad-manager :name "was-squad-manager" :to arg0) - (none) ) ;; definition for function was-squad-manager-kill @@ -611,7 +609,3 @@ 0 (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc index 2a97c55549..8917576288 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-h_REF.gc @@ -27,7 +27,7 @@ ;; definition of type vehicle-wheel-surface (deftype vehicle-wheel-surface (structure) ((flags vehicle-wheel-surface-flag) - (surface-type uint8) + (surface-type vehicle-wheel-surface-type) (friction float) (drag float) (depth float) @@ -64,28 +64,28 @@ (v1-5 (-> this surface-type)) ) (t9-4 a0-7 a1-4 a2-2 (cond - ((= v1-5 5) + ((= v1-5 (vehicle-wheel-surface-type wall)) "wall" ) - ((= v1-5 6) + ((= v1-5 (vehicle-wheel-surface-type conveyor)) "conveyor" ) - ((zero? v1-5) + ((= v1-5 (vehicle-wheel-surface-type stone)) "stone" ) - ((= v1-5 1) + ((= v1-5 (vehicle-wheel-surface-type dirt)) "dirt" ) - ((= v1-5 4) + ((= v1-5 (vehicle-wheel-surface-type water)) "water" ) - ((= v1-5 3) + ((= v1-5 (vehicle-wheel-surface-type quicksand)) "quicksand" ) - ((= v1-5 7) + ((= v1-5 (vehicle-wheel-surface-type none)) "none" ) - ((= v1-5 2) + ((= v1-5 (vehicle-wheel-surface-type sand)) "sand" ) (else diff --git a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc index 8e9cb2e489..e961d48cce 100644 --- a/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc +++ b/test/decompiler/reference/jak3/levels/desert/wvehicle/wvehicle-physics_REF.gc @@ -2,60 +2,65 @@ (in-package goal) ;; definition for symbol *wvehicle-surfaces*, type (inline-array vehicle-wheel-surface) -(define *wvehicle-surfaces* - (new 'static 'inline-array vehicle-wheel-surface 7 - (new 'static 'vehicle-wheel-surface - :friction 1.0 - :drag 1.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) - :tire-slide-mix (new 'static 'array float 2 1.0 0.0) - ) - (new 'static 'vehicle-wheel-surface - :surface-type #x1 - :friction 0.9 - :drag 1.0 - :depth 409.6 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 0.5 0.5 0.0 0.5) - :tire-slide-mix (new 'static 'array float 2 0.5 1.0) - ) - (new 'static 'vehicle-wheel-surface - :surface-type #x2 - :friction 0.85 - :drag 2.0 - :depth 1024.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 0.0 0.0 1.0 0.25) - :tire-slide-mix (new 'static 'array float 2 0.0 0.5) - ) - (new 'static 'vehicle-wheel-surface - :flags (vehicle-wheel-surface-flag moving) - :surface-type #x3 - :friction 0.5 - :drag 5.0 - :damage 1.0 - ) - (new 'static 'vehicle-wheel-surface :surface-type #x4 :friction 0.25 :drag 4.0 :depth 2048.0 :damage 1.0) - (new 'static 'vehicle-wheel-surface - :surface-type #x5 - :friction 0.1 - :drag 1.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) - :tire-slide-mix (new 'static 'array float 2 1.0 0.0) - ) - (new 'static 'vehicle-wheel-surface - :flags (vehicle-wheel-surface-flag moving) - :surface-type #x6 - :friction 1.0 - :drag 1.0 - :damage 1.0 - :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) - :tire-slide-mix (new 'static 'array float 2 1.0 0.0) - ) - ) - ) +(define *wvehicle-surfaces* (new 'static 'inline-array vehicle-wheel-surface 7 + (new 'static 'vehicle-wheel-surface + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type dirt) + :friction 0.9 + :drag 1.0 + :depth 409.6 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.5 0.5 0.0 0.5) + :tire-slide-mix (new 'static 'array float 2 0.5 1.0) + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type sand) + :friction 0.85 + :drag 2.0 + :depth 1024.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 0.0 0.0 1.0 0.25) + :tire-slide-mix (new 'static 'array float 2 0.0 0.5) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type (vehicle-wheel-surface-type quicksand) + :friction 0.5 + :drag 5.0 + :damage 1.0 + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type water) + :friction 0.25 + :drag 4.0 + :depth 2048.0 + :damage 1.0 + ) + (new 'static 'vehicle-wheel-surface + :surface-type (vehicle-wheel-surface-type wall) + :friction 0.1 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + (new 'static 'vehicle-wheel-surface + :flags (vehicle-wheel-surface-flag moving) + :surface-type (vehicle-wheel-surface-type conveyor) + :friction 1.0 + :drag 1.0 + :damage 1.0 + :tire-roll-mix (new 'static 'array float 4 1.0 0.0 0.0 1.0) + :tire-slide-mix (new 'static 'array float 2 1.0 0.0) + ) + ) + ) ;; definition for method 160 of type wvehicle ;; WARN: Return type mismatch int vs none. @@ -634,7 +639,3 @@ (apply-gravity! this arg0) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc index 29f1d99465..538013f230 100644 --- a/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc +++ b/test/decompiler/reference/jak3/levels/factory/car/hvehicle_REF.gc @@ -518,7 +518,7 @@ ;; definition for method 91 of type hvehicle ;; WARN: Return type mismatch int vs none. -(defmethod control-hook-player ((this hvehicle) (arg0 vehicle-controls)) +(defmethod control-hook-player ((this hvehicle)) (let ((gp-0 (new 'stack-no-clear 'vehicle-controls))) (mem-set32! (&-> gp-0 steering) 6 0) (cond @@ -1334,7 +1334,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/factory/car/lfaccar-init_REF.gc b/test/decompiler/reference/jak3/levels/factory/car/lfaccar-init_REF.gc new file mode 100644 index 0000000000..790bc0ae1c --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/car/lfaccar-init_REF.gc @@ -0,0 +1,29 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function lfaccar-activate +;; WARN: Return type mismatch int vs none. +(defun lfaccar-activate ((arg0 level)) + (format 0 "factorya-activate~%") + (let ((v1-0 *traffic-info*)) + (set! (-> v1-0 vehicle-level) arg0) + (set! (-> v1-0 vehicle-levels 21) (-> arg0 name)) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +;; definition for function lfaccar-deactivate +;; WARN: Return type mismatch int vs none. +(defun lfaccar-deactivate ((arg0 level)) + (format 0 "factorya-deactivate~%") + (set! (-> *traffic-info* vehicle-level) #f) + (vehicle-manager-kill) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc b/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc new file mode 100644 index 0000000000..c878d419da --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/conveyor_REF.gc @@ -0,0 +1,445 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type conveyor-section +(deftype conveyor-section (structure) + ((start vector :inline) + (trailing plane :inline) + (pull-dir vector :inline) + (radial-dir vector :inline) + ) + ) + +;; definition for method 3 of type conveyor-section +(defmethod inspect ((this conveyor-section)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'conveyor-section) + (format #t "~1Tstart: #~%" (-> this start)) + (format #t "~1Ttrailing: #~%" (-> this trailing)) + (format #t "~1Tpull-dir: #~%" (-> this pull-dir)) + (format #t "~1Tradial-dir: #~%" (-> this radial-dir)) + (label cfg-4) + this + ) + +;; definition of type conveyor-section-array +(deftype conveyor-section-array (inline-array-class) + ((data conveyor-section :inline :dynamic) + ) + ) + +;; definition for method 3 of type conveyor-section-array +(defmethod inspect ((this conveyor-section-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! (-> conveyor-section-array heap-base) (the-as uint 64)) + +;; definition of type conveyor +(deftype conveyor (process-drawable) + ((speed float) + (belt-radius float) + (pull-y-threshold float) + (speed-mult-array (pointer float)) + (speed-mult-array-len int8) + (sections conveyor-section-array) + (leading plane :inline) + (collide-bounds sphere :inline) + ) + (:state-methods + idle + ) + (:methods + (conveyor-method-21 (_type_) float) + (get-skel (_type_) art-group) + (alloc-trsqv! (_type_) none) + (init-fields! (_type_) none) + (alloc-sound! (_type_) none) + (init-skel! (_type_) none) + (push-focus (_type_ process-focusable) symbol) + (find-pushables (_type_) symbol) + ) + ) + +;; definition for method 3 of type conveyor +(defmethod inspect ((this conveyor)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tbelt-radius: ~f~%" (-> this belt-radius)) + (format #t "~2Tpull-y-threshold: ~f~%" (-> this pull-y-threshold)) + (format #t "~2Tspeed-mult-array: #x~X~%" (-> this speed-mult-array)) + (format #t "~2Tspeed-mult-array-len: ~D~%" (-> this speed-mult-array-len)) + (format #t "~2Tsections: ~A~%" (-> this sections)) + (format #t "~2Tleading: #~%" (-> this leading)) + (format #t "~2Tcollide-bounds: #~%" (-> this collide-bounds)) + (label cfg-4) + this + ) + +;; definition for method 7 of type conveyor +(defmethod relocate ((this conveyor) (offset int)) + (&+! (-> this sections) offset) + (call-parent-method this offset) + ) + +;; definition for method 22 of type conveyor +;; WARN: Return type mismatch symbol vs art-group. +(defmethod get-skel ((this conveyor)) + (the-as art-group #f) + ) + +;; definition for method 23 of type conveyor +;; WARN: Return type mismatch int vs none. +(defmethod alloc-trsqv! ((this conveyor)) + (set! (-> this root) (new 'process 'trsqv)) + 0 + (none) + ) + +;; definition for method 24 of type conveyor +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-fields! ((this conveyor)) + (local-vars (sv-16 res-tag)) + (set! (-> this speed) 24576.0) + (set! (-> this belt-radius) 11878.4) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this speed-mult-array) (the-as (pointer float) #f)) + (set! (-> this speed-mult-array-len) 0) + (let ((a0-1 (-> this entity))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-4 (res-lump-data a0-1 'scale-factor (pointer float) :tag-ptr (& sv-16)))) + (when v1-4 + (set! (-> this speed-mult-array) v1-4) + (set! (-> this speed-mult-array-len) (the-as int (-> sv-16 elt-count))) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 25 of type conveyor +;; WARN: Return type mismatch object vs none. +(defmethod alloc-sound! ((this conveyor)) + (let ((v1-1 (res-lump-value (-> this entity) 'options uint128 :time -1000000000.0))) + (cond + ((not (logtest? #x10000 v1-1)) + (set! (-> this sound) + (new 'process 'ambient-sound (static-sound-spec "conveyor" :group 0 :fo-max 80) (-> this root trans) 0.0) + ) + ) + (else + (set! (-> this sound) (the-as ambient-sound 0)) + 0 + ) + ) + ) + (none) + ) + +;; definition for method 27 of type conveyor +;; INFO: Used lq/sq +(defmethod push-focus ((this conveyor) (arg0 process-focusable)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 quad) (-> (get-trans arg0 0) quad)) + (set! (-> s4-0 w) 1.0) + (when (>= (vector4-dot s4-0 (the-as vector (-> this leading))) 0.0) + (let* ((a1-2 (-> this sections)) + (a2-0 (-> a1-2 length)) + ) + (dotimes (a0-3 a2-0) + (let ((v1-8 (-> a1-2 data a0-3))) + (when (< (vector4-dot s4-0 (the-as vector (-> v1-8 trailing))) 0.0) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (vector-! a1-3 s4-0 (-> v1-8 start)) + (when (>= (-> this belt-radius) (fabs (vector-dot a1-3 (-> v1-8 radial-dir)))) + (let* ((f0-7 (vector-dot a1-3 (-> v1-8 pull-dir))) + (f1-6 (- (-> a1-3 y) (* (-> v1-8 pull-dir y) f0-7))) + ) + (when (>= (-> this pull-y-threshold) (fabs f1-6)) + (let ((a2-8 (new 'stack-no-clear 'vector))) + (let ((f0-10 (-> this speed))) + (if (< a0-3 (-> this speed-mult-array-len)) + (set! f0-10 (* f0-10 (-> this speed-mult-array a0-3))) + ) + (vector-float*! a2-8 (-> v1-8 pull-dir) (* f0-10 (seconds-per-frame))) + ) + (send-event arg0 'push-trans a2-8 (seconds 10)) + ) + ) + ) + ) + ) + (return #f) + ) + ) + ) + ) + #f + ) + ) + ) + +;; definition for method 28 of type conveyor +(defmethod find-pushables ((this conveyor)) + (local-vars (a0-10 float) (a2-5 float) (a2-12 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (set! *actor-list-length* 0) + (if #t + (set! *actor-list-length* (fill-actor-list-for-box *actor-hash* (-> this collide-bounds) *actor-list* 256)) + ) + (when #t + (let ((a0-2 (-> *collide-player-list* alive-list next0))) + *collide-player-list* + (let ((v1-11 (-> a0-2 next0))) + (while (!= a0-2 (-> *collide-player-list* alive-list-end)) + (let* ((a0-3 (-> (the-as connection a0-2) param1)) + (a1-1 (-> (the-as collide-shape a0-3) root-prim)) + ) + (when (logtest? (-> a1-1 prim-core collide-as) + (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (let ((a1-2 (-> a1-1 prim-core))) + (let ((a2-4 a1-2) + (a3-1 (-> this collide-bounds)) + ) + (.lvf vf2 (&-> a2-4 world-sphere quad)) + (.lvf vf3 (&-> a3-1 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-5 vf1) + (let ((f0-0 a2-5) + (f1-1 (+ (-> a1-2 world-sphere w) (-> this collide-bounds r))) + ) + (when (< f0-0 (* f1-1 f1-1)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-3)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-2 v1-11) + *collide-player-list* + (set! v1-11 (-> v1-11 next0)) + ) + ) + ) + ) + (when #f + (let ((a0-5 (-> *collide-hit-by-player-list* alive-list next0))) + *collide-hit-by-player-list* + (let ((v1-18 (-> a0-5 next0))) + (while (!= a0-5 (-> *collide-hit-by-player-list* alive-list-end)) + (let* ((a0-6 (-> (the-as connection a0-5) param1)) + (a1-13 (-> (the-as collide-shape a0-6) root-prim)) + ) + (when (logtest? (-> a1-13 prim-core collide-as) + (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (let ((a1-14 (-> a1-13 prim-core))) + (let ((a2-11 a1-14) + (a3-2 (-> this collide-bounds)) + ) + (.lvf vf2 (&-> a2-11 world-sphere quad)) + (.lvf vf3 (&-> a3-2 quad)) + ) + (.sub.vf vf1 vf3 vf2) + (.mul.vf vf1 vf1 vf1) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov a2-12 vf1) + (let ((f0-1 a2-12) + (f1-5 (+ (-> a1-14 world-sphere w) (-> this collide-bounds r))) + ) + (when (< f0-1 (* f1-5 f1-5)) + (when (< *actor-list-length* 256) + (set! (-> *actor-list* *actor-list-length*) (the-as collide-shape a0-6)) + (set! *actor-list-length* (+ *actor-list-length* 1)) + ) + ) + ) + ) + ) + ) + (set! a0-5 v1-18) + *collide-hit-by-player-list* + (set! v1-18 (-> v1-18 next0)) + ) + ) + ) + ) + (dotimes (s5-0 *actor-list-length*) + (let* ((v1-23 (-> *actor-list* s5-0)) + (a0-9 (-> v1-23 root-prim)) + ) + (when (logtest? (-> a0-9 prim-core collide-as) + (collide-spec jak bot enemy vehicle-sphere hit-by-others-list player-list) + ) + (.lvf vf1 (&-> this collide-bounds quad)) + (.lvf vf2 (&-> a0-9 prim-core world-sphere quad)) + (.sub.vf vf3 vf1 vf2) + (.add.w.vf vf4 vf1 vf2 :mask #b1000) + (.mul.vf vf3 vf3 vf3 :mask #b111) + (.mul.w.vf vf4 vf4 vf4 :mask #b1000) + (.mul.x.vf acc vf0 vf3 :mask #b1000) + (.add.mul.y.vf acc vf0 vf3 acc :mask #b1000) + (.add.mul.z.vf vf3 vf0 vf3 acc :mask #b1000) + (.sub.w.vf vf3 vf3 vf4 :mask #b1000) + (let ((f0-2 0.0)) + (.add.w.vf vf3 vf0 vf3 :mask #b1) + (.mov a0-10 vf3) + (let ((s4-0 (-> v1-23 process))) + (b! (< f0-2 a0-10) cfg-27) + (let ((a1-29 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (if a1-29 + (push-focus this (the-as process-focusable a1-29)) + ) + ) + ) + ) + (label cfg-27) + 0 + ) + ) + ) + #f + ) + ) + +;; definition for method 21 of type conveyor +;; INFO: Used lq/sq +(defmethod conveyor-method-21 ((this conveyor)) + (local-vars (sv-32 conveyor-section) (sv-48 conveyor-section)) + (let* ((s5-0 (-> this path)) + (s4-0 (-> s5-0 curve num-cverts)) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((s2-0 (new 'process 'conveyor-section-array (+ s4-0 -1)))) + (set! (-> this sections) s2-0) + (set! (-> this collide-bounds quad) (the-as uint128 0)) + (get-point-in-path! s5-0 s3-0 0.0 'exact) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) + (let ((s1-0 (+ s4-0 -1))) + (set! sv-32 (the-as conveyor-section #f)) + (dotimes (s0-0 s1-0) + (set! sv-48 (-> s2-0 data s0-0)) + (set! (-> sv-48 start quad) (-> s3-0 quad)) + (get-point-in-path! s5-0 s3-0 (the float (+ s0-0 1)) 'exact) + (vector+! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) s3-0) + (vector-! (-> sv-48 pull-dir) s3-0 (-> sv-48 start)) + (vector-normalize! (-> sv-48 pull-dir) 1.0) + (set! (-> sv-48 trailing quad) (-> sv-48 pull-dir quad)) + (set! (-> sv-48 trailing y) 0.0) + (vector-normalize! (-> sv-48 trailing) 1.0) + (set-vector! (-> sv-48 radial-dir) (- (-> sv-48 trailing z)) 0.0 (-> sv-48 trailing x) 1.0) + (set! (-> sv-48 trailing w) (- (vector-dot s3-0 (the-as vector (-> sv-48 trailing))))) + (when sv-32 + (vector+! + (the-as vector (-> sv-32 trailing)) + (the-as vector (-> sv-32 trailing)) + (the-as vector (-> sv-48 trailing)) + ) + (vector-normalize! (-> sv-32 trailing) 1.0) + (set! (-> sv-32 trailing w) (- (vector-dot (-> sv-48 start) (the-as vector (-> sv-32 trailing))))) + ) + (set! sv-32 sv-48) + sv-32 + ) + ) + ) + (let ((s2-1 (-> this sections data))) + (set! (-> this leading quad) (-> s2-1 0 pull-dir quad)) + (set! (-> this leading y) 0.0) + (vector-normalize! (-> this leading) 1.0) + (set! (-> this leading w) (- (vector-dot (the-as vector (-> s2-1 0)) (the-as vector (-> this leading))))) + ) + (let ((f0-19 (/ 1.0 (the float s4-0))) + (f30-0 0.0) + ) + (vector-float*! (the-as vector (-> this collide-bounds)) (the-as vector (-> this collide-bounds)) f0-19) + (dotimes (s2-2 s4-0) + (get-point-in-path! s5-0 s3-0 (the float s2-2) 'exact) + (let ((f0-22 (vector-vector-distance-squared s3-0 (-> this collide-bounds)))) + (if (< f30-0 f0-22) + (set! f30-0 f0-22) + ) + ) + ) + (set! (-> this collide-bounds r) (+ (sqrtf f30-0) (-> this belt-radius))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (conveyor) + :virtual #t + :code sleep-code + :post (behavior () + (find-pushables self) + (if (nonzero? (-> self sound)) + (update! (-> self sound)) + ) + ) + ) + +;; definition for method 26 of type conveyor +;; WARN: Return type mismatch draw-control vs none. +(defmethod init-skel! ((this conveyor)) + (if (get-skel this) + (initialize-skeleton this (the-as skeleton-group (get-skel this)) (the-as pair 0)) + ) + (none) + ) + +;; definition for method 11 of type conveyor +(defmethod init-from-entity! ((this conveyor) (arg0 entity-actor)) + (alloc-trsqv! this) + (process-drawable-from-entity! this arg0) + (init-skel! this) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (if (< (-> this path curve num-cverts) 2) + (go process-drawable-art-error "bad path") + ) + (init-fields! this) + (alloc-sound! this) + (conveyor-method-21 this) + (go (method-of-object this idle)) + ) diff --git a/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc new file mode 100644 index 0000000000..5d6f6f9d80 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/fac-gunturret_REF.gc @@ -0,0 +1,1157 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-fac-gunturret-hit + :id 779 + :duration (seconds 3) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2914 :period (seconds 3) :length (seconds 0.017)) + (sp-item 2915 :period (seconds 0.067) :length (seconds 0.017)) + (sp-item 2916 :period (seconds 5) :length (seconds 0.017)) + (sp-item 2917 :period (seconds 0.335) :length (seconds 0.017)) + (sp-item 2918 :period (seconds 5) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2914 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters -2)) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 50.0) + (:b 0.0) + (:a 32.0) + (:fade-a -0.053333335) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2915 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.0 2.0) + (:x (meters -1) (meters 2)) + (:y (meters -3) (meters 1)) + (:z (meters -1) (meters 2)) + (:scale-x (meters 5) (meters 5)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 180.0) + (:a 128.0) + (:omega (degrees 9011.25)) + (:scalevel-x (meters -0.16666667)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.067) (seconds 0.065)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2916 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.33333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2917 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 1 50.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 20.0 50.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 0.045)) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:accel-y (meters -0.0016666667)) + (:friction 0.98) + (:timer (seconds 0.167) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2918 + :init-specs ((:texture (lightning-anim-01 level-default-sprite)) + (:num 0.2 3.0) + (:y (meters -3)) + (:scale-x (meters 3) (meters 5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.5) (meters 1)) + (:r 255.0) + (:g 80.0 20.0) + (:b 20.0) + (:a 255.0) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:timer (seconds 0.035) (seconds 0.165)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata :data (new 'static 'boxed-array :type int32 20 1 0 #x405700 #x405800 #x405900)) + (:func 'sparticle-texture-animate) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-gunturret-smoke + :id 780 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2919 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2919 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 16.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.10666667) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-gunturret-casing + :id 781 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2920 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 2921 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2921 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 32.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.56) + (:fade-g -2.56) + (:fade-b 2.56) + (:fade-a -0.32) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.167)) + (:next-launcher 2922) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2922 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpart 2920 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:z (meters -0.4)) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.15) (meters 0.02)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:fade-b -8.0) + (:accel-y (meters -0.0016666667) (meters -0.0016666667)) + (:friction 0.9 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.05)) + (:next-launcher 2923) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2923 + :init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gunturret fac-gun-tower-turret fac-gun-tower-turret-lod0-jg fac-gun-tower-turret-idle-ja + ((fac-gun-tower-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gunturret-explode fac-gun-tower-turret fac-gun-tower-turret-explode-lod0-jg fac-gun-tower-turret-explode-idle-ja + ((fac-gun-tower-turret-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 100) + ) + +;; definition for symbol *fac-gunturret-exploder-params*, type joint-exploder-static-params +(define *fac-gunturret-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition of type fac-gun-tower-turret-params +(deftype fac-gun-tower-turret-params (structure) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (left-barrel-joint int32) + (right-barrel-joint int32) + (left-gun-joint int32) + (right-gun-joint int32) + ) + ) + +;; definition for method 3 of type fac-gun-tower-turret-params +(defmethod inspect ((this fac-gun-tower-turret-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-gun-tower-turret-params) + (format #t "~1Tnormal-sg: ~A~%" (-> this normal-sg)) + (format #t "~1Texplode-sg: ~A~%" (-> this explode-sg)) + (format #t "~1Tenemy-info: ~A~%" (-> this enemy-info)) + (format #t "~1Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~1Tshoot-anim: ~D~%" (-> this shoot-anim)) + (format #t "~1Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~1Tleft-barrel-joint: ~D~%" (-> this left-barrel-joint)) + (format #t "~1Tright-barrel-joint: ~D~%" (-> this right-barrel-joint)) + (format #t "~1Tleft-gun-joint: ~D~%" (-> this left-gun-joint)) + (format #t "~1Tright-gun-joint: ~D~%" (-> this right-gun-joint)) + (label cfg-4) + this + ) + +;; definition of type fac-gunturret +(deftype fac-gunturret (enemy) + ((left-gun-tilt-jm joint-mod) + (right-gun-tilt-jm joint-mod) + (params fac-gun-tower-turret-params) + (aim-pos vector :inline) + (gun-twist float) + (gun-tilt float) + (desired-twist float) + (desired-tilt float) + (los-clear symbol) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (flash-state symbol) + (can-shoot symbol) + (last-hit-time time-frame) + (init-mat matrix :inline) + (activate-distance float) + (aim-offset vector :inline) + (use-alt-barrel symbol) + (rotate-sound sound-id) + (rotate-sound-playing symbol) + (snd-cmd-time time-frame) + ) + (:methods + (track-target (_type_ symbol) none) + (check-los (_type_) none) + (reset-aim (_type_) none) + (fire-shot (_type_ symbol) none) + (init-turret-params! (_type_) none) + (go-explode (_type_) (pointer joint-exploder)) + ) + ) + +;; definition for method 3 of type fac-gunturret +(defmethod inspect ((this fac-gunturret)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tleft-gun-tilt-jm: ~A~%" (-> this left-gun-tilt-jm)) + (format #t "~2Tright-gun-tilt-jm: ~A~%" (-> this right-gun-tilt-jm)) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Taim-pos: #~%" (-> this aim-pos)) + (format #t "~2Tgun-twist: ~f~%" (-> this gun-twist)) + (format #t "~2Tgun-tilt: ~f~%" (-> this gun-tilt)) + (format #t "~2Tdesired-twist: ~f~%" (-> this desired-twist)) + (format #t "~2Tdesired-tilt: ~f~%" (-> this desired-tilt)) + (format #t "~2Tlos-clear: ~A~%" (-> this los-clear)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tcasing-part: ~A~%" (-> this casing-part)) + (format #t "~2Tflash-state: ~A~%" (-> this flash-state)) + (format #t "~2Tcan-shoot: ~A~%" (-> this can-shoot)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tinit-mat: #~%" (-> this init-mat)) + (format #t "~2Tactivate-distance: ~f~%" (-> this activate-distance)) + (format #t "~2Taim-offset: #~%" (-> this aim-offset)) + (format #t "~2Tuse-alt-barrel: ~A~%" (-> this use-alt-barrel)) + (format #t "~2Trotate-sound: ~D~%" (-> this rotate-sound)) + (format #t "~2Trotate-sound-playing: ~A~%" (-> this rotate-sound-playing)) + (format #t "~2Tsnd-cmd-time: ~D~%" (-> this snd-cmd-time)) + (label cfg-4) + this + ) + +;; definition for symbol *fac-gunturret-enemy-info*, type enemy-info +(define *fac-gunturret-enemy-info* (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x4 + :param0 2 + :param1 2 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 4 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 4 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :bullseye-joint 9 + :notice-distance (meters 50) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +;; failed to figure out what this is: +(set! (-> *fac-gunturret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 155 of type fac-gunturret +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod track-target ((this fac-gunturret) (arg0 symbol)) + (cond + ((and arg0 (-> this los-clear)) + (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) + (when a0-2 + (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + (vector+! (-> this aim-pos) (-> this aim-pos) (-> this aim-offset)) + ) + ) + ) + (else + (reset-aim this) + ) + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params track-joint)))) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> this aim-pos) (-> this root trans)) + (vector-flatten! s4-0 s4-0 (-> this init-mat uvec)) + (vector-normalize! s4-0 1.0) + (set! (-> this desired-twist) + (atan (vector-dot (the-as vector (-> this init-mat)) s4-0) (vector-dot (-> this init-mat fvec) s4-0)) + ) + (cond + (#t + (vector-normalize-copy! + s3-0 + (-> this node-list data (-> this params right-barrel-joint) bone transform uvec) + 1.0 + ) + (vector-! s4-0 (-> this aim-pos) s5-1) + (vector-normalize! s4-0 1.0) + (set! (-> this desired-tilt) (- (asin (-> s4-0 y)))) + (set! (-> this desired-tilt) (fmax -14563.556 (fmin 0.0 (+ 3640.889 (-> this desired-tilt))))) + ) + (else + ) + ) + ) + (vector-normalize-copy! + (-> this aim-pos) + (-> this node-list data (-> this params left-gun-joint) bone transform uvec) + (vector-vector-distance s5-1 (-> this aim-pos)) + ) + ) + (vector+! + (-> this aim-pos) + (-> this aim-pos) + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params left-barrel-joint))) + ) + (let ((s5-3 (new 'stack-no-clear 'matrix))) + (+! (-> this gun-twist) + (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-twist) (-> this gun-twist))))) + ) + (matrix-rotate-y! s5-3 (-> this gun-twist)) + (matrix*! s5-3 s5-3 (-> this init-mat)) + (matrix->quaternion (-> this root quat) s5-3) + ) + (+! (-> this gun-tilt) (fmax -364.0889 (fmin 364.0889 (* 0.3 (- (-> this desired-tilt) (-> this gun-tilt)))))) + (quaternion-axis-angle! (-> this left-gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) + (quaternion-axis-angle! (-> this right-gun-tilt-jm quat) 1.0 0.0 0.0 (-> this gun-tilt)) + 0 + (none) + ) + +;; definition for method 156 of type fac-gunturret +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod check-los ((this fac-gunturret)) + (let ((a0-2 (the-as process-focusable (handle->process (-> this focus handle))))) + (if a0-2 + (set! (-> this aim-pos quad) (-> (get-trans a0-2 3) quad)) + ) + ) + (let* ((s4-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params left-gun-joint))) + ) + (s5-3 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) s4-0)) + ) + (when (< (vector-dot (vector-normalize-copy! (new 'stack-no-clear 'vector) s5-3 1.0) (-> this init-mat fvec)) + (cos 364.0889) + ) + (let ((a1-5 (new 'stack-no-clear 'collide-query))) + (set! (-> a1-5 start-pos quad) (-> s4-0 quad)) + (set! (-> a1-5 move-dist quad) (-> s5-3 quad)) + (let ((v1-17 a1-5)) + (set! (-> v1-17 radius) 409.6) + (set! (-> v1-17 collide-with) + (collide-spec backgnd crate obstacle hit-by-player-list hit-by-others-list pusher) + ) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (if (>= (fill-and-probe-using-line-sphere *collide-cache* a1-5) 0.0) + (set! (-> this los-clear) #f) + (set! (-> this los-clear) #t) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 157 of type fac-gunturret +;; WARN: Return type mismatch int vs none. +(defmethod reset-aim ((this fac-gunturret)) + (vector+float*! (-> this aim-pos) (-> this root trans) (-> this init-mat fvec) 163840.0) + (vector-reset! (-> this aim-offset)) + 0 + (none) + ) + +;; definition for method 158 of type fac-gunturret +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod fire-shot ((this fac-gunturret) (arg0 symbol)) + (let ((s0-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params right-barrel-joint))) + ) + (s3-0 + (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data (-> this params left-barrel-joint))) + ) + (s4-0 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (let* ((s1-1 (vector-! (new 'stack-no-clear 'vector) (-> this aim-pos) s0-0)) + (f30-0 (/ 2013265900.0 (vector-length s1-1))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 ent) (-> this entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options)) + (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) + (set! (-> s4-0 pos quad) (-> s0-0 quad)) + (set! (-> s4-0 notify-handle) (process->handle this)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 target-handle) (the-as handle #f)) + (set! (-> s4-0 target-pos quad) (the-as uint128 0)) + (set! (-> s4-0 ignore-handle) (process->handle this)) + (let* ((v1-24 *game-info*) + (a0-15 (+ (-> v1-24 attack-id) 1)) + ) + (set! (-> v1-24 attack-id) a0-15) + (set! (-> s4-0 attack-id) a0-15) + ) + (set! (-> s4-0 timeout) (seconds 4)) + (set! (-> s4-0 damage) 2.0) + (logior! (-> s4-0 options) (projectile-options po14)) + (vector-normalize-copy! (-> s4-0 vel) s1-1 491520.0) + (let ((f30-1 (fmin 16384.0 f30-0))) + (set-vector! s2-0 (-> s1-1 z) (-> s1-1 y) (- (-> s1-1 x)) 1.0) + (vector-normalize! s2-0 (rand-vu-float-range (- f30-1) f30-1)) + (vector+! (-> s4-0 vel) (-> s4-0 vel) s2-0) + (vector-cross! s2-0 s2-0 (-> s4-0 vel)) + (vector-normalize! s2-0 (rand-vu-float-range (- f30-1) f30-1)) + ) + (vector+! (-> s4-0 vel) (-> s4-0 vel) s2-0) + ) + (if (-> this use-alt-barrel) + (set! (-> s4-0 pos quad) (-> s3-0 quad)) + ) + (set! (-> this use-alt-barrel) (not (-> this use-alt-barrel))) + (spawn-projectile fturret-shot s4-0 this *default-dead-pool*) + ) + (if arg0 + (sound-play "smallturret-fir") + ) + (set! (-> this flash-state) #t) + (none) + ) + +;; failed to figure out what this is: +(defstate hostile (fac-gunturret) + :virtual #t + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (ja :group! (-> self draw art-group data (-> self params idle-anim))) + (set! (-> self flash-state) #f) + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (if (>= 2 (the-as int (-> self focus aware))) + (go-stare self) + ) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (reset-aim self) + (until #f + (current-time) + (until (time-elapsed? (-> self last-hit-time) (seconds 2)) + (suspend) + ) + (when (task-node-closed? (game-task-node factory-sky-battle-wave2)) + (cleanup-for-death self) + (go-virtual die-fast) + ) + (check-los self) + (when (-> self los-clear) + (new 'stack-no-clear 'vector) + (rand-vu-sphere-point-uniform! (-> self aim-offset) (* 61440.0 (rand-vu))) + ) + (set! (-> self rotate-sound-playing) #t) + (sound-play-by-name + (static-sound-name "smallturret-rot") + (-> self rotate-sound) + 1024 + (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) + 0 + (sound-group) + (-> self root trans) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.75)) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> self aim-pos quad)) + (track-target self #t) + (vector-! s5-2 (-> self aim-pos) s5-2) + (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.12)) + 0.0 + (vector-length s5-2) + (sound-play-by-name + (static-sound-name "smallturret-rot") + (-> self rotate-sound) + 1024 + (the int (* 1524.0 (* 0.5 (doppler-pitch-shift (-> self root trans) (-> self root transv))))) + 0 + (sound-group) + (-> self root trans) + ) + (set-time! (-> self snd-cmd-time)) + ) + ) + (suspend) + ) + ) + (when (-> self rotate-sound-playing) + (sound-stop (-> self rotate-sound)) + (set! (-> self rotate-sound-playing) #f) + ) + (ja :group! (-> self draw art-group data (-> self params shoot-anim))) + (let ((s5-4 0) + (gp-3 #t) + ) + (sound-play "smallturret-fir") + (cond + ((not (-> self can-shoot)) + ) + ((time-elapsed? (the-as time-frame s5-4) (seconds 0.05)) + (fire-shot self gp-3) + (current-time) + (not gp-3) + ) + (else + (set! (-> self flash-state) #f) + ) + ) + ) + (ja :num! (loop!)) + (set! (-> self flash-state) #f) + (ja-channel-push! 1 (seconds 0.2)) + (ja :group! (-> self draw art-group data (-> self params idle-anim))) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate stare (fac-gunturret) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type enemy stare) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (!= (-> self activate-distance) 0.0) + (track-target self #f) + ) + ) + ) + +;; definition for method 82 of type fac-gunturret +(defmethod event-handler ((this fac-gunturret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (if (and (= arg2 'notify) (< 1 arg1) (= (-> arg3 param 0) 'attack) (= (-> arg3 param 1) *target*)) + (set-time! (-> this last-hit-time)) + ) + (case arg2 + (('start) + (let ((v0-0 (the-as object #t))) + (set! (-> this can-shoot) (the-as symbol v0-0)) + v0-0 + ) + ) + (('stop) + (set! (-> this can-shoot) #f) + #f + ) + (('bonk) + (send-event arg0 'target-mech-get-off (seconds 0.3)) + (send-event arg0 'shove #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) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + #f + ) + (('flash-state) + (-> this flash-state) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 160 of type fac-gunturret +;; WARN: Return type mismatch (pointer process) vs (pointer joint-exploder). +(defmethod go-explode ((this fac-gunturret)) + (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 'joint-exploder-tuning (the-as uint 0)))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sound-play "explosion") + (let ((v1-2 (-> s5-0 fountain-rand-transv-lo))) + (let ((a0-5 (-> this root trans))) + (let ((a1-2 *up-vector*)) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-2 quad)) + ) + (.lvf vf4 (&-> a0-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-2 quad) vf6) + ) + (vector-float*! s4-0 *up-vector* (* 4096.0 (rand-vu-float-range 20.0 30.0))) + (let ((a1-4 (-> s5-0 fountain-rand-transv-lo))) + (let ((v1-4 s4-0)) + (let ((a0-7 *identity-vector*)) + (let ((a2-5 -204800.0)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-7 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-4 quad) vf6) + ) + (let ((a0-8 (-> s5-0 fountain-rand-transv-hi))) + (let ((v1-5 *identity-vector*)) + (let ((a1-6 204800.0)) + (.mov vf7 a1-6) + ) + (.lvf vf5 (&-> v1-5 quad)) + ) + (.lvf vf4 (&-> s4-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-8 quad) vf6) + ) + ) + (set! (-> s5-0 gravity) -122880.0) + (process-spawn + joint-exploder + (-> this params explode-sg) + 9 + s5-0 + *fac-gunturret-exploder-params* + :name "joint-exploder" + :to this + :unk 0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (fac-gunturret) + :virtual #t + :enter (behavior () + (on-dying self) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self hit-points) 0.0) + (when (-> self rotate-sound-playing) + (sound-stop (-> self rotate-sound)) + (set! (-> self rotate-sound-playing) #f) + ) + ) + :code (behavior () + (go-explode self) + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> self clock)) + (sound-play "smallturret-exp") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (+! (-> gp-1 y) 12288.0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2)) + (spawn (-> self part) gp-1) + (suspend) + ) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; definition for method 120 of type fac-gunturret +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this fac-gunturret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 9216.0 4096.0 24576.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 8192.0 0.0 18432.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-16 transform-index) 5) + (set-vector! (-> v1-16 local-sphere) 0.0 24576.0 0.0 4096.0) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-18 transform-index) 7) + (set-vector! (-> v1-18 local-sphere) 0.0 24576.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-21 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-21 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-21 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 107 of type fac-gunturret +(defmethod is-pfoc-in-mesh? ((this fac-gunturret) (arg0 process-focusable) (arg1 vector)) + (if (= (-> this activate-distance) 0.0) + (return #t) + (return (< (fabs (vector-dot + (vector-! (new 'stack-no-clear 'vector) (get-trans arg0 3) (-> this root trans)) + (-> this init-mat fvec) + ) + ) + (-> this activate-distance) + ) + ) + ) + (the-as symbol 0) + ) + +;; definition for method 10 of type fac-gunturret +(defmethod deactivate ((this fac-gunturret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (-> this rotate-sound-playing) + (sound-stop (-> this rotate-sound)) + (set! (-> this rotate-sound-playing) #f) + ) + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this casing-part)) + (kill-particles (-> this casing-part)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +;; definition for method 67 of type fac-gunturret +(defmethod coin-flip? ((this fac-gunturret)) + #f + ) + +;; definition for method 7 of type fac-gunturret +;; WARN: Return type mismatch enemy vs fac-gunturret. +(defmethod relocate ((this fac-gunturret) (offset int)) + (if (nonzero? (-> this left-gun-tilt-jm)) + (&+! (-> this left-gun-tilt-jm) offset) + ) + (if (nonzero? (-> this right-gun-tilt-jm)) + (&+! (-> this right-gun-tilt-jm) offset) + ) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this casing-part)) + (&+! (-> this casing-part) offset) + ) + (the-as fac-gunturret ((method-of-type enemy relocate) this offset)) + ) + +;; definition for method 159 of type fac-gunturret +;; WARN: Return type mismatch int vs none. +(defmethod init-turret-params! ((this fac-gunturret)) + (let ((s5-0 + (new 'static 'fac-gun-tower-turret-params + :idle-anim 4 + :shoot-anim 4 + :track-joint 3 + :left-barrel-joint 6 + :right-barrel-joint 8 + :left-gun-joint 7 + :right-gun-joint 5 + ) + ) + ) + (set! (-> s5-0 normal-sg) + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gunturret" (the-as (pointer level) #f))) + ) + (set! (-> s5-0 explode-sg) + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gunturret-explode" (the-as (pointer level) #f)) + ) + ) + (set! (-> s5-0 enemy-info) *fac-gunturret-enemy-info*) + (set! (-> this params) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type fac-gunturret +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this fac-gunturret)) + (init-turret-params! this) + (initialize-skeleton this (-> this params normal-sg) (the-as pair 0)) + (init-enemy-defaults! this (-> this params enemy-info)) + (set! (-> this draw light-index) (the-as uint 10)) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 779) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 780) this)) + (set! (-> this casing-part) (create-launch-control (-> *part-group-id-table* 781) this)) + (set! (-> this left-gun-tilt-jm) + (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this params left-gun-joint)) + ) + (set! (-> this right-gun-tilt-jm) + (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this params right-gun-joint)) + ) + (set! (-> this los-clear) #f) + (set! (-> this gun-twist) 0.0) + (set! (-> this gun-tilt) 0.0) + (set! (-> this desired-twist) 0.0) + (set! (-> this desired-tilt) 0.0) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this last-hit-time) 0) + (set! (-> this use-alt-barrel) #f) + (set! (-> this rotate-sound) (new-sound-id)) + (set! (-> this rotate-sound-playing) #f) + (set-time! (-> this snd-cmd-time)) + (quaternion->matrix (-> this init-mat) (-> this root quat)) + (set! (-> this activate-distance) (res-lump-float (-> this entity) 'distance)) + (set! (-> this activate-distance) 163840.0) + 0 + (none) + ) + +;; definition for method 122 of type fac-gunturret +(defmethod go-idle2 ((this fac-gunturret)) + (go (method-of-object this idle)) + ) + +;; definition of type fac-gun-tower-turret +(deftype fac-gun-tower-turret (fac-gunturret) + () + ) + +;; definition for method 3 of type fac-gun-tower-turret +(defmethod inspect ((this fac-gun-tower-turret)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type fac-gunturret inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/fac-part_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-part_REF.gc new file mode 100644 index 0000000000..db55c9b1cf --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/fac-part_REF.gc @@ -0,0 +1,2564 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thrust + :id 728 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2761 :flags (is-3d sp3 sp7)) (sp-item 2762 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2761 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 1.0) + (:z (meters 0)) + (:scale-x (meters 0)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 200.0) + (:vel-y (meters 0)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2762 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0)) + (:scale-y (meters 0)) + (:r 40.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 30.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thrust-afterburn + :id 729 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2763 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2763 + :init-specs ((:texture (glow level-default-sprite)) + (:num 3.0) + (:scale-x (meters 4) (meters 1)) + (:scale-y :copy scale-x) + (:r 40.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 128.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-fighter-explosion + :id 730 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2765 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2766 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2767 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2768 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2769 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2770 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2771 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2772 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2773 :flags (sp3) :binding 2764) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2764 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2765 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2766 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2767 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2768 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.7) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2769 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ffexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ffexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ffexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-fighter-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-fac-fighter-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2769 init-specs 14 initial-valuef) + (the-as float *part-fac-fighter-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* color-start) *range-ffexplo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* alpha-start) *range-ffexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-x-start) *range-ffexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-y-start) *range-ffexplo-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* a-scalar) *curve-ffexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-x-scalar) *curve-ffexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-dust-in-curve-settings* scale-y-scalar) *curve-ffexplo-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 2771 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2772 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ffexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ffexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ffexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ffexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-fighter-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-fac-fighter-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2772 init-specs 16 initial-valuef) + (the-as float *part-fac-fighter-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* color-start) *range-ffexplo-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* alpha-start) *range-ffexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-x-start) *range-ffexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-y-start) *range-ffexplo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* a-scalar) *curve-ffexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-x-scalar) *curve-ffexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-fighter-explosion-texture-curve-settings* scale-y-scalar) *curve-ffexplo-scale-y*) + +;; failed to figure out what this is: +(defpart 2770 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2773 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2764 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-gun-tower-explosion + :id 731 + :duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2775 :flags (sp3) :period (seconds 5) :length (seconds 0.017)) + (sp-item 2776 :flags (sp3) :period (seconds 5) :length (seconds 0.017)) + (sp-item 2777 :flags (sp3) :period (seconds 5) :length (seconds 0.017)) + (sp-item 2778 :period (seconds 5) :length (seconds 0.335)) + (sp-item 2779 :period (seconds 5) :length (seconds 0.5)) + (sp-item 2780 :flags (sp3) :binding 2774) + (sp-item 2780 :flags (sp3) :binding 2774) + (sp-item 2780 :flags (sp3) :binding 2774) + (sp-item 2774 :flags (sp2) :period (seconds 5) :length (seconds 2)) + (sp-item 2774 :flags (sp2) :period (seconds 5) :length (seconds 2)) + (sp-item 2774 :flags (sp2) :period (seconds 5) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2775 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 200)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.10666667) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2776 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 10.0) + (:scale-x (meters 20) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.4)) + (:scalevel-x (meters 0.06666667)) + (:rotvel-z (degrees -0.2) 1 (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.85 -0.85) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2778 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 30) (meters 20)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 2.6666667) (meters 1)) + (:scalevel-x (meters 0.33333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.7) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2779 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 4.0) + (:x (meters -10) (meters 20)) + (:y (meters 0) (meters 10)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.16666667)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fgtexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fgtexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fgtexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fgtexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fgtexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fgtexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fgtexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-tower-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-fac-tower-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2779 init-specs 16 initial-valuef) + (the-as float *part-fac-tower-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* color-start) *range-fgtexplo-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* alpha-start) *range-fgtexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-x-start) *range-fgtexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-y-start) *range-fgtexplo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* a-scalar) *curve-fgtexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-x-scalar) *curve-fgtexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tower-explosion-texture-curve-settings* scale-y-scalar) *curve-fgtexplo-scale-y*) + +;; failed to figure out what this is: +(defpart 2777 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 200)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -3.3333333)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2780 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 20)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.33333334)) + (:scalevel-x (meters -0.13333334) (meters -0.13333334)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2774 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 0.5) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 80.0) + (:a 128.0) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-tank-explosion + :id 732 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2782 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2783 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2784 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2785 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2786 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2787 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2788 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2789 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2790 :flags (sp3) :binding 2781) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2781 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2782 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 60.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2783 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0 20.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2784 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0 20.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2785 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 8.0 8.0) + (:g :copy r) + (:b :copy r) + (:a 64.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2786 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 32.0 :z 33.0 :w 34.0) + :one-over-x-deltas (new 'static 'vector :x -32.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 20.0 :z 21.0 :w 22.0) + :one-over-x-deltas (new 'static 'vector :x 12.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-tank-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-fac-tank-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2786 init-specs 14 initial-valuef) + (the-as float *part-fac-tank-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* color-start) *range-ftexplo-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* alpha-start) *range-ftexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-x-start) *range-ftexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-y-start) *range-ftexplo-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* a-scalar) *curve-ftexplo-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-x-scalar) *curve-ftexplo-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-dust-in-curve-settings* scale-y-scalar) *curve-ftexplo-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 2788 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2789 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags ()) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 200.0 :z 100.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 5.0 :y 7.0 :z 8.0 :w 9.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-ftexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-tank-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-fac-tank-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2789 init-specs 16 initial-valuef) + (the-as float *part-fac-tank-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* color-start) *range-ftexplo-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* alpha-start) *range-ftexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-x-start) *range-ftexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-y-start) *range-ftexplo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* a-scalar) *curve-ftexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-x-scalar) *curve-ftexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-tank-explosion-texture-curve-settings* scale-y-scalar) *curve-ftexplo-scale-y*) + +;; failed to figure out what this is: +(defpart 2787 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2790 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.02) (meters -0.02)) + (:rotvel-z (degrees -300) (degrees 600)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.001)) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 70)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2781 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 100.0) + (:a 128.0) + (:fade-r -1.7) + (:fade-g -1.3333334) + (:fade-b -1.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-target-explosion + :id 733 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2791 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2792 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2793 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 2791 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 200.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2792 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.8) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2793 + :init-specs ((:texture (dust-sparkle factorya-sprite)) + (:num 10.0 10.0) + (:y (meters 2)) + (:scale-x (meters 5) (meters 10)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.33333334)) + (:scalevel-x (meters 0.06666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2794 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.75)) + (:rot-x (degrees 0.225)) + (:rot-z (degrees -4) (degrees 8)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 64.0 32.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 2795 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 20.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 9013.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +;; failed to figure out what this is: +(defpart 2796 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 20.0 20.0) + (:a 64.0) + (:omega (degrees 9013.5)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3 glow)) + (:userdata 40.96) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-tower-hit-explosion + :id 734 + :duration (seconds 4) + :linger-duration (seconds 1) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2797 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2797 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0) + (:b 0.0) + (:a 255.0) + (:vel-z (meters -0.033333335)) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -4.25) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-tower-hit-object + :id 735 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2799 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2800 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2801 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2802 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2803 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2804 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2805 :flags (sp3) :binding 2798) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + (sp-item 2798 :flags (sp2) :period (seconds 4) :length (seconds 2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2799 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2800 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 0.8) (meters 1.2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2801 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.22857143) + (:fade-b -0.08571429) + (:fade-a -0.36571428 -0.36571428) + (:friction 0.93) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2803 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2804 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-gthoexplo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-gthoexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-gthoexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-gthoexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-gthoexplo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-gthoexplo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-gthoexplo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-gun-tower-hit-object-texture-curve-settings*, type particle-curve-settings +(define *part-gun-tower-hit-object-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2804 init-specs 16 initial-valuef) + (the-as float *part-gun-tower-hit-object-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* color-start) *range-gthoexplo-color*) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* alpha-start) *range-gthoexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-x-start) *range-gthoexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-y-start) *range-gthoexplo-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* a-scalar) *curve-gthoexplo-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-x-scalar) *curve-gthoexplo-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-gun-tower-hit-object-texture-curve-settings* scale-y-scalar) *curve-gthoexplo-scale-y*) + +;; failed to figure out what this is: +(defpart 2802 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2805 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 4)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 200.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:scalevel-x (meters -0.033333335) (meters -0.033333335)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.00066666666) (meters -0.00066666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 170)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2798 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-inherit-size) + (:num 1.0) + (:scale-x (meters 0.00024414062) (meters 0.00012207031)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 32.0) + (:a 128.0) + (:fade-a -0.36571428 -0.36571428) + (:accel-y (meters 0) (meters -0.00033333333)) + (:timer (seconds 1.167)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-positionlight-yellow-glow + :id 736 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2806 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2806 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-launchpad-red-glow + :id 737 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2807 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2807 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-hangingbrace-white-glow + :id 738 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2808 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2808 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-spot-white-glow + :id 739 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 2809 :fade-after (meters 400) :flags (sp6)) + (sp-item 2810 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + (sp-item 2811 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + (sp-item 2812 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + (sp-item 2813 :fade-after (meters 400) :flags (is-3d sp6 sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2809 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20) (meters 0.1)) + (:rot-x (degrees 13.500001)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 2810 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2811 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 45)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2812 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees -45)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2813 + :init-specs ((:texture (vol-light level-default-sprite)) + (:num 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 19.5)) + (:scale-x (meters 10)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0)) + (:rot-z (degrees 90)) + (:scale-y (meters 40)) + (:r 128.0) + (:g 128.0) + (:b 64.0) + (:a 20.0 5.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-bulb-red-glow + :id 740 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2814 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2814 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-topsidewall-white-glow + :id 741 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2815 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2815 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-cornertower-white-glow + :id 742 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2816 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2816 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-supportarm-white-glow + :id 743 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2817 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2817 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 80.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-blinklite-glow + :id 744 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2818 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2818 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 40.0 10.0) + (:omega (degrees 9011.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-steam + :id 745 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 2819 :fade-after (meters 100) :falloff-to (meters 140) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2819 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1 0.1) + (:x (meters -2) (meters 4)) + (:y (meters -1) (meters 2)) + (:z (meters 0)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters -0.0033333334) (meters -0.0033333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.26666668) + (:accel-y (meters 0.00006666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x405c00 #x400000)) + (:next-time (seconds 0.5)) + (:next-launcher 2820) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2820 + :init-specs ((:fade-a -0.03809524 -0.03809524)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-volumelight-yellow-glow + :id 746 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2821 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2821 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 80.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-glowlite-yellow-glow + :id 747 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2822 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2822 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 10.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-glowt-yellow-glow + :id 748 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2823 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2823 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 40.0 5.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-grate-yellow-glow + :id 749 + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 2824 :fade-after (meters 120) :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2824 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 0.0) + (:a 80.0 5.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-break-floor-bust + :id 750 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2825 :flags (sp7) :period (seconds 20) :length (seconds 0.067))) + ) + +;; failed to figure out what this is: +(defpart 2825 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 6.0) + (:x (meters 0) (meters 4)) + (:scale-x (meters 2) (meters 3)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 190.0) + (:g 170.0) + (:b 150.0) + (:a 64.0 64.0) + (:vel-y (meters 0.033333335) (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.0033333334)) + (:rotvel-z (degrees -0.06666667) (degrees 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 80) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-break-fence-bust + :id 751 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2826 :flags (sp7) :period (seconds 20) :length (seconds 0.067))) + ) + +;; failed to figure out what this is: +(defpart 2826 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 10.0) + (:x (meters -6) (meters 12)) + (:y (meters -4) (meters 8)) + (:scale-x (meters 4) (meters 4)) + (:rot-z (degrees -90)) + (:scale-y :copy scale-x) + (:r 100.0 80.0) + (:g :copy r) + (:b :copy r) + (:a 64.0 64.0) + (:scalevel-x (meters 0.0033333334) (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.00016666666)) + (:friction 0.9) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-robopod-bust + :id 752 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2827 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2828 :period (seconds 30) :length (seconds 0.035)) + (sp-item 2829 :period (seconds 30) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 2827 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:y (meters 2)) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 220.0) + (:g 200.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2828 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 50.0) + (:y (meters 2)) + (:scale-x (meters 0.8) (meters 1.2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.33333334)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.9) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2829 + :init-specs ((:texture (dust-sparkle factorya-sprite)) + (:num 10.0 10.0) + (:y (meters 2)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.33333334)) + (:scalevel-x (meters 0.006666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.28444445 -0.28444445) + (:accel-y (meters -0.0016666667)) + (:friction 0.75) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-switch-glow-red + :id 753 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2830 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2830 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-switch-glow-green + :id 754 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2831 :flags (sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2831 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.1)) + (:rot-x (degrees 9)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 40.0 1.0) + (:omega (degrees 2715.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-rotfan-barrier + :id 755 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2832 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 2832 + :init-specs ((:texture (fan-blade factorya-sprite)) + (:num 0.017) + (:scale-x (meters 38)) + (:rot-z (degrees 90)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 70.0) + (:b 128.0) + (:a 40.0 10.0) + (:rotvel-y (degrees -3.0000002)) + (:timer (seconds 2)) + (:flags ()) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc new file mode 100644 index 0000000000..0454e12305 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank-turret_REF.gc @@ -0,0 +1,1132 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fac-robotank-turret +(deftype fac-robotank-turret (process-focusable) + ((los los-control :inline) + (tank-quat quaternion :inline) + (tank-quat-vibe-only quaternion :inline) + (rotate-quat quaternion :inline) + (rotate-rate float) + (rotate-mult float) + (shot-range float) + (fov-mult float) + (offset vector :inline) + (sight-pos vector :inline) + (firing-sight-pos vector :inline) + (aim-pos vector 3 :inline) + (gun-timer time-frame) + (gun-elev-jmod joint-mod) + (gun-elev float) + (gun-elev-cam float) + (gun-joint-l int32 2) + (gun-joint-r int32 2) + (gun-spread float) + (gun-index int32) + (flags fac-robotank-turret-flag) + (turn-sound-id sound-id) + ) + (:state-methods + ready + fire + die + ) + (:methods + (fac-robotank-turret-method-31 (_type_ vector vector) object) + (fac-robotank-turret-method-32 (_type_ (inline-array vector)) (pointer ftank-shot)) + (fac-robotank-turret-method-33 (_type_) none) + (fac-robotank-turret-method-34 (_type_ vector float) symbol) + ) + ) + +;; definition for method 3 of type fac-robotank-turret +(defmethod inspect ((this fac-robotank-turret)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tlos: #~%" (-> this los)) + (format #t "~2Ttank-quat: #~%" (-> this tank-quat)) + (format #t "~2Ttank-quat-vibe-only: #~%" (-> this tank-quat-vibe-only)) + (format #t "~2Trotate-quat: #~%" (-> this rotate-quat)) + (format #t "~2Trotate-rate: ~f~%" (-> this rotate-rate)) + (format #t "~2Trotate-mult: ~f~%" (-> this rotate-mult)) + (format #t "~2Tshot-range: ~f~%" (-> this shot-range)) + (format #t "~2Tfov-mult: ~f~%" (-> this fov-mult)) + (format #t "~2Toffset: #~%" (-> this offset)) + (format #t "~2Tsight-pos: #~%" (-> this sight-pos)) + (format #t "~2Tfiring-sight-pos: #~%" (-> this firing-sight-pos)) + (format #t "~2Taim-pos[3] @ #x~X~%" (-> this aim-pos)) + (format #t "~2Tgun-timer: ~D~%" (-> this gun-timer)) + (format #t "~2Tgun-elev-jmod: ~A~%" (-> this gun-elev-jmod)) + (format #t "~2Tgun-elev: ~f~%" (-> this gun-elev)) + (format #t "~2Tgun-elev-cam: ~f~%" (-> this gun-elev-cam)) + (format #t "~2Tgun-joint-l[2] @ #x~X~%" (-> this gun-joint-l)) + (format #t "~2Tgun-joint-r[2] @ #x~X~%" (-> this gun-joint-r)) + (format #t "~2Tgun-spread: ~f~%" (-> this gun-spread)) + (format #t "~2Tgun-index: ~D~%" (-> this gun-index)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tturn-sound-id: ~D~%" (-> this turn-sound-id)) + (label cfg-4) + this + ) + +;; definition of type fac-robotank-reticle +(deftype fac-robotank-reticle (process-drawable) + ((shadow-jmod joint-mod-set-local) + (sight-jmod joint-mod-set-local) + (ring-jmod joint-mod 3) + (ring-timer time-frame) + (sight-scale vector :inline) + (collide-dist float) + ) + (:state-methods + unlock + lock + ) + ) + +;; definition for method 3 of type fac-robotank-reticle +(defmethod inspect ((this fac-robotank-reticle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tshadow-jmod: #~%" (-> this shadow-jmod)) + (format #t "~2Tsight-jmod: #~%" (-> this sight-jmod)) + (format #t "~2Tring-jmod[3] @ #x~X~%" (-> this ring-jmod)) + (format #t "~2Tring-timer: ~D~%" (-> this ring-timer)) + (format #t "~2Tsight-scale: #~%" (-> this sight-scale)) + (format #t "~2Tcollide-dist: ~f~%" (-> this collide-dist)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defpartgroup group-robotank-steamescape + :id 782 + :bounds (static-bspherem 0 0 0 6) + :parts ((sp-item 2924 :fade-after (meters 100) :falloff-to (meters 100) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2924 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5 1.0) + (:x (meters -3) (meters 5)) + (:y (meters -0.1) (meters 0.3)) + (:z (meters 0.2) (meters 0.2)) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 0.0) + (:vel-z (meters 0.005) (meters 0.0025)) + (:scalevel-x (meters 0.0016666667) (meters 0.0033333334)) + (:rotvel-z (degrees -1.2) (degrees 2.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:accel-y (meters 0.00016666666) (meters 0.00016666666)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.085) (seconds 0.08)) + (:next-launcher 2925) + (:launchrot-x (degrees -5) (degrees 10)) + (:launchrot-y (degrees -5) (degrees 10)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2925 + :init-specs ((:fade-a -0.064 -0.064)) + ) + +;; definition for function fac-robotank-reticle-post +;; INFO: Used lq/sq +(defbehavior fac-robotank-reticle-post fac-robotank-reticle () + (let ((s5-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (camera-pos)) + (s4-0 (-> self draw shadow-ctrl settings shadow-dir)) + (gp-0 (-> self draw shadow-ctrl settings bot-plane)) + (s2-0 (-> self draw shadow-ctrl settings top-plane)) + ) + (-> self draw shadow-ctrl settings) + (vector-normalize! s5-0 1.0) + (vector-negate! s1-0 s5-0) + (set! (-> s4-0 x) (-> s5-0 x)) + (set! (-> s4-0 y) (-> s5-0 y)) + (set! (-> s4-0 z) (-> s5-0 z)) + (set! (-> s4-0 w) -16384.0) + (set! (-> s2-0 quad) (-> s5-0 quad)) + (set! (-> gp-0 quad) (-> s5-0 quad)) + (let ((s4-1 (new 'stack-no-clear 'vector))) + (vector+float*! s4-1 (-> self root trans) s5-0 -4096.0) + (set! (-> s2-0 w) (- (vector-dot s4-1 s5-0))) + (vector+float*! s4-1 (-> self root trans) s5-0 (-> self collide-dist)) + (let* ((a1-6 (vector-! (new 'stack-no-clear 'vector) s3-0 s4-1)) + (f1-0 (vector-length a1-6)) + (a2-2 + (vector-normalize-copy! (new 'stack-no-clear 'vector) a1-6 (fmax -20480.0 (fmin 20480.0 (* 0.75 f1-0)))) + ) + (v1-26 (vector-float*! (new 'stack-no-clear 'vector) s5-0 (- (vector-dot a2-2 s5-0)))) + ) + (vector+! s4-1 s4-1 v1-26) + ) + (set! (-> gp-0 w) (- (vector-dot s4-1 s5-0))) + ) + ) + 0 + (vector-seek! (-> self sight-jmod transform scale) (-> self sight-scale) (* 6.0 (seconds-per-frame))) + (ja-post) + (none) + ) + +;; definition for function fac-robotank-reticle-handler +;; INFO: Used lq/sq +(defbehavior fac-robotank-reticle-handler fac-robotank-reticle ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('update-trans-only) + (set! v0-0 (-> self root trans)) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> arg3 param 0)) quad)) + v0-0 + ) + (('update) + (let ((s5-0 (the-as vector (-> arg3 param 0))) + (gp-0 (the-as vector (-> arg3 param 1))) + ) + (let ((a1-3 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0) 1.0) + ) + ) + (set! (-> self root trans quad) (-> s5-0 quad)) + (forward-up->quaternion (-> self root quat) a1-3 *up-vector*) + ) + (let ((f0-0 (vector-length (vector-! (new 'stack-no-clear 'vector) gp-0 s5-0))) + (gp-1 (-> self sight-scale)) + ) + (set! (-> gp-1 z) (* 0.000024414063 f0-0)) + (let ((f0-1 (lerp-scale 0.1 6.0 f0-0 61440.0 163840.0))) + (set! (-> gp-1 x) f0-1) + (set! (-> gp-1 y) f0-1) + f0-1 + ) + ) + ) + ) + (('collide-dist) + (set! (-> self collide-dist) (the-as float (-> arg3 param 0))) + ) + (('on) + (let ((v1-14 (-> self draw shadow-ctrl))) + (logclear! (-> v1-14 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! v0-0 (logclear (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('off) + (let ((v1-19 (-> self draw shadow-ctrl))) + (logior! (-> v1-19 settings flags) (shadow-flags disable-draw)) + ) + 0 + (set! v0-0 (logior (-> self draw status) (draw-control-status no-draw))) + (set! (-> self draw status) (the-as draw-control-status v0-0)) + v0-0 + ) + (('spotlight-on) + (let ((v1-25 (-> self draw shadow-ctrl))) + (logclear! (-> v1-25 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (('spotlight-off) + (let ((v1-27 (-> self draw shadow-ctrl))) + (logior! (-> v1-27 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + (('lock) + (go-virtual lock) + ) + (('unlock) + (go-virtual unlock) + ) + (('die) + (go empty-state) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-robotank-turret fac-robotank-top fac-robotank-top-lod0-jg fac-robotank-top-idle-ja + ((fac-robotank-top-lod0-mg (meters 20)) (fac-robotank-top-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defpart 2926 + :init-specs ((:texture (glow-hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 1.125)) + (:scale-y :copy scale-x) + (:r 128.0 64.0) + (:g 0.0) + (:b :copy g) + (:a 96.0 64.0) + (:rotvel-z (degrees 0.3)) + (:fade-g -1.0666667) + (:fade-b -1.0666667) + (:fade-a -8.533334) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 glow)) + (:userdata 1.0) + ) + ) + +;; definition for function draw-2d-hud +;; INFO: Used lq/sq +;; WARN: Return type mismatch pointer vs symbol. +;; ERROR: Failed load: (set! t0-6 (l.d (+ a0-28 8))) at op 170 +(defun draw-2d-hud ((arg0 vector)) + (let ((s5-0 (new 'stack-no-clear 'inline-array 'vector4w 4)) + (gp-0 (new 'stack-no-clear 'vector4w)) + ) + (set! (-> arg0 w) 1.0) + (the-as + symbol + (when (transform-point-qword! (-> s5-0 0) arg0) + (set! (-> s5-0 1 quad) (-> s5-0 0 quad)) + (set! (-> s5-0 2 quad) (-> s5-0 0 quad)) + (set! (-> s5-0 3 quad) (-> s5-0 0 quad)) + (let ((v1-5 160)) + (set! (-> s5-0 0 x) (- (-> s5-0 0 x) v1-5)) + (set! (-> s5-0 0 y) (- (-> s5-0 0 y) v1-5)) + (+! (-> s5-0 1 x) v1-5) + (set! (-> s5-0 1 y) (- (-> s5-0 1 y) v1-5)) + (+! (-> s5-0 2 x) v1-5) + (+! (-> s5-0 2 y) v1-5) + (set! (-> s5-0 3 x) (- (-> s5-0 3 x) v1-5)) + (+! (-> s5-0 3 y) v1-5) + ) + (set! (-> gp-0 x) 0) + (set! (-> gp-0 y) 128) + (set! (-> gp-0 z) 128) + (set! (-> gp-0 w) 128) + (with-dma-buffer-add-bucket ((v1-15 (-> *display* frames (-> *display* on-screen) global-buf)) + (bucket-id debug-no-zbuf1) + ) + (let ((a1-1 (-> s5-0 0)) + (t3-0 (-> s5-0 1)) + (t2-0 (-> s5-0 2)) + (a3-0 (-> s5-0 3)) + (t0-0 (make-u128 0 (the-as uint #x4024c00000008001))) + (t1-0 #x4141) + ) + (+! (-> a1-1 z) -8192) + (+! (-> t3-0 z) -8192) + (+! (-> t2-0 z) -8192) + (+! (-> a3-0 z) -8192) + (let ((a0-28 (-> v1-15 base))) + (let* ((t4-0 v1-15) + (t5-0 (-> t4-0 base)) + ) + (set! (-> (the-as (pointer int64) t5-0)) #x10000000) + (s.w! (+ t5-0 8) 0) + (let ((t6-1 #x50000000)) + (s.w! (+ t5-0 12) t6-1) + ) + (set! (-> t4-0 base) (&+ t5-0 16)) + ) + (let* ((t4-1 v1-15) + (t5-2 (-> t4-1 base)) + ) + (set! (-> (the-as (pointer uint64) t5-2)) t0-0) + (s.d! (+ t5-2 8) t1-0) + (set! (-> t4-1 base) (&+ t5-2 16)) + ) + (let* ((t4-2 v1-15) + (t5-4 (-> t4-2 base)) + ) + (set! (-> (the-as (pointer uint128) t5-4)) (-> gp-0 quad)) + (let ((t6-3 (-> a1-1 quad))) + (s.q! (+ t5-4 16) t6-3) + ) + (let ((t6-4 (-> gp-0 quad))) + (s.q! (+ t5-4 32) t6-4) + ) + (let ((t6-5 (-> t3-0 quad))) + (s.q! (+ t5-4 48) t6-5) + ) + (set! (-> t4-2 base) (&+ t5-4 64)) + ) + (let* ((t4-3 v1-15) + (t5-6 (-> t4-3 base)) + ) + (set! (-> (the-as (pointer uint64) t5-6)) t0-0) + (s.d! (+ t5-6 8) t1-0) + (set! (-> t4-3 base) (&+ t5-6 16)) + ) + (let* ((t4-4 v1-15) + (t5-8 (-> t4-4 base)) + ) + (set! (-> (the-as (pointer uint128) t5-8)) (-> gp-0 quad)) + (let ((t3-1 (-> t3-0 quad))) + (s.q! (+ t5-8 16) t3-1) + ) + (let ((t3-2 (-> gp-0 quad))) + (s.q! (+ t5-8 32) t3-2) + ) + (let ((t3-3 (-> t2-0 quad))) + (s.q! (+ t5-8 48) t3-3) + ) + (set! (-> t4-4 base) (&+ t5-8 64)) + ) + (let* ((t3-5 v1-15) + (t4-5 (-> t3-5 base)) + ) + (set! (-> (the-as (pointer uint64) t4-5)) t0-0) + (s.d! (+ t4-5 8) t1-0) + (set! (-> t3-5 base) (&+ t4-5 16)) + ) + (let* ((t3-6 v1-15) + (t4-7 (-> t3-6 base)) + ) + (set! (-> (the-as (pointer uint128) t4-7)) (-> gp-0 quad)) + (let ((t2-1 (-> t2-0 quad))) + (s.q! (+ t4-7 16) t2-1) + ) + (let ((t2-2 (-> gp-0 quad))) + (s.q! (+ t4-7 32) t2-2) + ) + (let ((t2-3 (-> a3-0 quad))) + (s.q! (+ t4-7 48) t2-3) + ) + (set! (-> t3-6 base) (&+ t4-7 64)) + ) + (let* ((t2-5 v1-15) + (t3-7 (-> t2-5 base)) + ) + (set! (-> (the-as (pointer uint64) t3-7)) t0-0) + (s.d! (+ t3-7 8) t1-0) + (set! (-> t2-5 base) (&+ t3-7 16)) + ) + (let* ((t0-2 v1-15) + (t1-1 (-> t0-2 base)) + ) + (set! (-> (the-as (pointer uint128) t1-1)) (-> gp-0 quad)) + (let ((a3-1 (-> a3-0 quad))) + (s.q! (+ t1-1 16) a3-1) + ) + (let ((a3-2 (-> gp-0 quad))) + (s.q! (+ t1-1 32) a3-2) + ) + (let ((a1-2 (-> a1-1 quad))) + (s.q! (+ t1-1 48) a1-2) + ) + (set! (-> t0-2 base) (&+ t1-1 64)) + ) + (let ((a3-6 (/ (the-as int (+ (- -16 (the-as int a0-28)) (the-as int (-> v1-15 base)))) 16))) + (cond + ((nonzero? a3-6) + (logior! (-> (the-as (pointer uint64) a0-28)) (shr (shl a3-6 48) 48)) + (let ((a3-10 (logior (l.d (&+ a0-28 8)) (shl (shr (shl a3-6 48) 48) 32)))) + (s.d! (+ a0-28 8) a3-10) + ) + ) + (else + (set! (-> v1-15 base) a0-28) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 32 of type fac-robotank-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer ftank-shot). +(defmethod fac-robotank-turret-method-32 ((this fac-robotank-turret) (arg0 (inline-array vector))) + (let ((s4-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s5-0 (-> arg0 0)) + (gp-0 (-> arg0 1)) + ) + (set! (-> s4-0 ent) (-> this entity)) + (set! (-> s4-0 charge) 1.0) + (set! (-> s4-0 options) (projectile-options)) + (logclear! (-> s4-0 options) (projectile-options po14 po15 po16)) + (set! (-> s4-0 pos quad) (-> s5-0 quad)) + (set! (-> s4-0 notify-handle) (process->handle this)) + (set! (-> s4-0 owner-handle) (the-as handle #f)) + (set! (-> s4-0 target-handle) (the-as handle #f)) + (set! (-> s4-0 target-pos quad) (the-as uint128 0)) + (set! (-> s4-0 ignore-handle) (process->handle this)) + (let* ((v1-12 *game-info*) + (a0-13 (+ (-> v1-12 attack-id) 1)) + ) + (set! (-> v1-12 attack-id) a0-13) + (set! (-> s4-0 attack-id) a0-13) + ) + (set! (-> s4-0 timeout) (seconds 4)) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (rand-vu-sphere-point-uniform! s2-0 (* 40960.0 (rand-vu))) + (vector+! gp-0 gp-0 s2-0) + ) + (vector-! (-> s4-0 vel) gp-0 s5-0) + ) + (vector-normalize! (-> s4-0 vel) 512000.0) + (the-as (pointer ftank-shot) (spawn-projectile ftank-shot s4-0 this *default-dead-pool*)) + ) + ) + +;; definition for method 33 of type fac-robotank-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer ftank-shot) vs none. +(defmethod fac-robotank-turret-method-33 ((this fac-robotank-turret)) + (local-vars (sv-144 vector) (sv-160 vector)) + (let ((s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) + (s5-0 (new 'stack-no-clear 'inline-array 'vector 2)) + ) + (-> this node-list data 11) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s1-0 (-> this sight-pos)) + (s2-0 (-> this gun-index)) + ) + 0.0 + 0.0 + (vector<-cspace! (-> s3-0 0) (-> this node-list data (-> this gun-joint-l s2-0))) + (vector<-cspace! (-> s3-0 1) (-> this node-list data (-> this gun-joint-r s2-0))) + (let ((f30-0 (* 0.5 (vector-length (vector-! (new 'stack-no-clear 'vector) (-> s3-0 1) (-> s3-0 0)))))) + (let ((f28-0 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 0))))))) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-l s2-0) bone transform fvec) 1.0) + (let ((s0-0 vector-rotate-y!)) + (set! sv-144 s4-0) + (set! sv-160 s4-0) + (let ((a2-1 (- 16384.0 (acos (/ f30-0 f28-0))))) + (s0-0 sv-144 sv-160 a2-1) + ) + ) + (set! (-> s5-0 0 quad) (-> s3-0 0 quad)) + (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) + (set! (-> this shot-range) (fmin 204800.0 f28-0)) + ) + (fac-robotank-turret-method-32 this s5-0) + (let ((f28-1 (fmax 81920.0 (+ 12288.0 (vector-length (vector-! (new 'stack-no-clear 'vector) s1-0 (-> s3-0 1))))))) + (vector-normalize-copy! s4-0 (-> this node-list data (-> this gun-joint-r s2-0) bone transform fvec) 1.0) + (vector-rotate-y! s4-0 s4-0 (- (- 16384.0 (acos (/ f30-0 f28-1))))) + (set! (-> s5-0 0 quad) (-> s3-0 1 quad)) + (vector+float*! (-> s5-0 1) (-> s5-0 0) s4-0 512000.0) + (set! (-> this shot-range) (fmin 204800.0 f28-1)) + ) + ) + ) + (fac-robotank-turret-method-32 this s5-0) + ) + (none) + ) + +;; definition for method 31 of type fac-robotank-turret +;; INFO: Used lq/sq +(defmethod fac-robotank-turret-method-31 ((this fac-robotank-turret) (arg0 vector) (arg1 vector)) + (let ((s5-0 (new 'stack-no-clear 'collide-query)) + (f30-0 307200.0) + ) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (vector-float*! (-> s5-0 move-dist) arg1 f30-0) + (let ((v1-4 s5-0)) + (set! (-> v1-4 radius) 4096.0) + (set! (-> v1-4 collide-with) (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list)) + (set! (-> v1-4 ignore-process0) (ppointer->process (-> this parent))) + (set! (-> v1-4 ignore-process1) this) + (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 semi-solid)) + ) + (let ((f28-0 (fill-and-probe-using-line-sphere *collide-cache* s5-0)) + (s4-1 (-> this sight-pos)) + ) + (cond + ((>= f28-0 0.0) + (let ((f0-3 (vector-length (-> s5-0 move-dist)))) + (if (>= 20480.0 (* f0-3 f28-0)) + (set! f28-0 (/ 20480.0 f0-3)) + ) + ) + (vector+float*! s4-1 (-> s5-0 start-pos) (-> s5-0 move-dist) f28-0) + (let* ((s5-1 (-> s5-0 best-other-tri collide-ptr)) + (s3-0 (if (type? s5-1 collide-shape-prim) + s5-1 + ) + ) + (s5-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-2 quad) (-> s4-1 quad)) + (vector+float*! s5-2 s5-2 (-> (math-camera-matrix) fvec) -2048.0) + (if (and s3-0 + (logtest? (process-mask target enemy) (-> (the-as collide-shape-prim s3-0) cshape process mask)) + (>= 307200.0 (vector-vector-distance s5-2 arg0)) + ) + #f + (+ 12288.0 (* f30-0 f28-0)) + ) + ) + ) + (else + (vector+! s4-1 (-> s5-0 start-pos) (-> s5-0 move-dist)) + ) + ) + ) + ) + ) + +;; definition for method 21 of type fac-robotank-turret +;; WARN: Return type mismatch collide-prim-core vs vector. +(defmethod get-trans ((this fac-robotank-turret) (arg0 int)) + "Get the `trans` for this process." + (the-as vector (-> this root root-prim prim-core)) + ) + +;; definition for function turret-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior turret-post fac-robotank-turret () + (let* ((s5-0 *target*) + (gp-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + ((and (logtest? (-> self flags) (fac-robotank-turret-flag frt0)) gp-0) + (if (logtest? (-> self flags) (fac-robotank-turret-flag frt9)) + (format 0 "Fix Los control update~%") + ) + (if *target* + (look-at! (-> *target* neck) (the-as vector (-> self root root-prim prim-core)) 'attacking self) + ) + (set! (-> self aim-pos 0 quad) (-> self aim-pos 1 quad)) + (set! (-> self aim-pos 1 quad) (-> (get-trans gp-0 0) quad)) + (let ((s5-2 (-> self aim-pos 2)) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-joint-l 0)))) + ) + (let ((v1-24 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> self gun-joint-r 0))))) + (vector-! s5-2 (-> self aim-pos 1) (the-as vector (-> self aim-pos))) + (vector-float*! s5-2 s5-2 (* 0.8 (-> self clock frames-per-second))) + (set! (-> s5-2 y) 0.0) + (vector+! s5-2 (-> self aim-pos 1) s5-2) + (+! (-> s5-2 y) 8192.0) + (vector+! s4-0 s4-0 v1-24) + ) + (vector-float*! s4-0 s4-0 0.5) + (let ((gp-2 (vector-! (new 'stack-no-clear 'vector) s5-2 s4-0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (-> self firing-sight-pos) s4-0)) + (s5-3 (new 'stack-no-clear 'vector)) + ) + (let ((f30-0 (vector-length gp-2))) + (vector-normalize! gp-2 1.0) + (vector-normalize! s3-1 1.0) + (if (logtest? (-> self flags) (fac-robotank-turret-flag frt3)) + (set! (-> s5-3 quad) (-> s3-1 quad)) + (set! (-> s5-3 quad) (-> gp-2 quad)) + ) + (when (logtest? (-> self flags) (fac-robotank-turret-flag frt7)) + (let ((f0-6 (lerp-scale 1.0 0.2 f30-0 8192.0 327680.0))) + (seek! (-> self fov-mult) f0-6 (* 2.0 (seconds-per-frame))) + ) + (set-setting! 'fov 'rel (-> self fov-mult) 0) + ) + ) + (let* ((f30-1 (vector-y-angle s5-3)) + (f0-11 (quaternion-y-angle (-> self rotate-quat))) + (f0-12 (deg-diff f0-11 f30-1)) + ) + (* (-> self rotate-mult) f0-12) + (let ((f1-6 25486.223)) + (set! (-> self rotate-rate) (fmax (fmin (* 4.0 f0-12) f1-6) (- f1-6))) + ) + ) + (let ((f30-3 (fmax -16384.0 (fmin 16384.0 (- 16384.0 (acos (- (vector-dot s5-3 *y-vector*)))))))) + (let* ((f0-28 (fmax -16384.0 (fmin 16384.0 (- 16384.0 (acos (- (vector-dot gp-2 *y-vector*))))))) + (f2-1 (- (-> self gun-elev-cam) f0-28)) + (f1-12 (if (< f2-1 0.0) + (fmin 3640.889 (* (fabs (* 0.1 f2-1)) (-> self clock frames-per-second))) + 910.2222 + ) + ) + ) + (seek! (-> self gun-elev-cam) f0-28 (* f1-12 (seconds-per-frame))) + ) + (let* ((f28-2 (quaternion-y-angle (-> self rotate-quat))) + (f0-32 (quaternion-y-angle (-> self tank-quat))) + (f0-34 (* 2.0 (deg-diff f0-32 f28-2))) + (f0-35 (cos f0-34)) + ) + 0.0 + (if (< 0.0 f0-35) + (* 182.04445 (lerp 4.0 90.0 f0-35)) + (* 182.04445 (lerp 4.0 18.0 (- f0-35))) + ) + ) + (seek! (-> self gun-elev) f30-3 (* 16384.0 (seconds-per-frame))) + ) + ) + ) + (quaternion-axis-angle! (-> self gun-elev-jmod quat) 1.0 0.0 0.0 (-> self gun-elev)) + ) + (else + ) + ) + ) + (when (and (logtest? (-> self flags) (fac-robotank-turret-flag frt0)) + (not (logtest? (-> self flags) (fac-robotank-turret-flag frt3))) + ) + (let* ((a1-26 (-> self node-list data (-> self gun-joint-l 0))) + (s4-1 (-> self node-list data (-> self gun-joint-r 0))) + (gp-4 + (vector+! + (new 'stack-no-clear 'vector) + (vector<-cspace! (new 'stack-no-clear 'vector) a1-26) + (vector<-cspace! (new 'stack-no-clear 'vector) s4-1) + ) + ) + (a2-16 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self node-list data 11 bone transform fvec) 1.0) + ) + ) + (vector-float*! gp-4 gp-4 0.5) + (fac-robotank-turret-method-31 self gp-4 a2-16) + ) + ) + (cond + ((logtest? (-> self flags) (fac-robotank-turret-flag frt6)) + (sound-play "robotank-turret" :id (-> self turn-sound-id) :position (-> self root trans)) + (when (< (fabs (-> self rotate-rate)) 728.1778) + (logclear! (-> self flags) (fac-robotank-turret-flag frt6)) + (sound-stop (-> self turn-sound-id)) + (sound-play "robo-turret-end") + ) + ) + (else + (if (< 2184.5334 (fabs (-> self rotate-rate))) + (logior! (-> self flags) (fac-robotank-turret-flag frt6)) + ) + ) + ) + (quaternion-rotate-y! + (-> self rotate-quat) + (-> self rotate-quat) + (* (-> self rotate-rate) (seconds-per-frame)) + ) + (quaternion*! (-> self root quat) (-> self rotate-quat) (-> self tank-quat-vibe-only)) + (quaternion-normalize! (-> self root quat)) + (transform-post) + (none) + ) + +;; definition for function robotank-turret-handler +(defbehavior robotank-turret-handler fac-robotank-turret ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('fire-suppress) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt4))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (fac-robotank-turret-flag frt4))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('set-spread) + (set! (-> self gun-spread) (the-as float (-> arg3 param 0))) + ) + (('use-los) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt9))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (fac-robotank-turret-flag frt9))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('limit-reticle-elev) + (cond + ((-> arg3 param 0) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt10))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + (else + (set! v0-0 (logclear (-> self flags) (fac-robotank-turret-flag frt10))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + ) + ) + v0-0 + ) + (('pov-cam-on) + (let ((v1-14 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak player-list)) + ) + (set! v0-0 (logior (-> self flags) (fac-robotank-turret-flag frt7))) + (set! (-> self flags) (the-as fac-robotank-turret-flag v0-0)) + v0-0 + ) + (('pov-cam-off) + (let ((v1-19 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 3))) + (set! (-> v1-19 prim-core collide-as) (collide-spec)) + (set! (-> v1-19 prim-core collide-with) (collide-spec)) + ) + 0 + (logclear! (-> self flags) (fac-robotank-turret-flag frt7)) + (remove-setting! 'fov) + ) + (('get-rotate-quat) + (-> self rotate-quat) + ) + (('get-gun-elevation-cam) + (-> self gun-elev-cam) + ) + (('update) + (-> arg3 param 1) + (new 'stack-no-clear 'vector) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((s4-0 (the-as cspace (-> arg3 param 2)))) + (vector<-cspace+vector! (-> self root trans) s4-0 (-> self offset)) + (matrix->quaternion s5-0 (-> s4-0 bone transform)) + ) + (quaternion-copy! (-> self tank-quat) s5-0) + ) + (quaternion-copy! (-> self tank-quat-vibe-only) (the-as quaternion (-> arg3 param 3))) + ) + (('die) + (go-virtual die) + ) + ) + ) + +;; definition for method 34 of type fac-robotank-turret +;; INFO: Used lq/sq +(defmethod fac-robotank-turret-method-34 ((this fac-robotank-turret) (arg0 vector) (arg1 float)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) arg0 (-> this root trans))) + (s3-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> this root quat))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> s4-1 quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! s3-0 1.0) + (set! (-> s5-0 y) 0.0) + (vector-normalize! s5-0 1.0) + (>= (vector-dot s3-0 s5-0) (cos arg1)) + ) + ) + +;; failed to figure out what this is: +(defstate ready (fac-robotank-turret) + :virtual #t + :event robotank-turret-handler + :enter (behavior () + (logior! (-> self flags) (fac-robotank-turret-flag frt0)) + (set-time! (-> self gun-timer)) + ) + :trans (behavior () + (if (logtest? (-> self flags) (fac-robotank-turret-flag frt4)) + (set-time! (-> self gun-timer)) + ) + (let ((gp-0 *target*)) + (if (and (if (type? gp-0 process-focusable) + gp-0 + ) + (or (not (logtest? (-> self flags) (fac-robotank-turret-flag frt9))) (should-check-los? (-> self los) 0)) + (time-elapsed? (-> self gun-timer) (seconds 1)) + ) + (go-virtual fire) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! fac-robotank-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post turret-post + ) + +;; failed to figure out what this is: +(defstate fire (fac-robotank-turret) + :virtual #t + :event robotank-turret-handler + :enter (behavior () + (logior! (-> self flags) (fac-robotank-turret-flag frt8)) + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-1 + (set! (-> self aim-pos 0 quad) (-> (get-trans a0-1 0) quad)) + (set! (-> self aim-pos 1 quad) (-> self aim-pos 0 quad)) + (set! (-> self aim-pos 2 quad) (-> self aim-pos 0 quad)) + ) + ) + ) + :trans (behavior () + (let ((gp-0 *target*)) + (when (or (not (if (type? gp-0 process-focusable) + gp-0 + ) + ) + (and (logtest? (-> self flags) (fac-robotank-turret-flag frt9)) + (not (logtest? (-> self flags) (fac-robotank-turret-flag frt3))) + (los-control-method-11 (-> self los) 0) + ) + (logtest? (-> self flags) (fac-robotank-turret-flag frt4)) + ) + (logclear! (-> self flags) (fac-robotank-turret-flag frt8)) + (go-virtual ready) + ) + ) + ) + :code (behavior () + (local-vars (v1-2 symbol)) + (until #f + (until v1-2 + (suspend) + (set! v1-2 (and (fac-robotank-turret-method-34 self (-> self aim-pos 2) 2730.6667) + (logtest? (-> self draw status) (draw-control-status on-screen)) + ) + ) + ) + (logior! (-> self flags) (fac-robotank-turret-flag frt3)) + (set! (-> self firing-sight-pos quad) (-> self sight-pos quad)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.5)) + (suspend) + ) + ) + (let ((gp-2 (max 2 (min 3 (rand-vu-int-range 0 3))))) + 0 + (dotimes (s5-2 gp-2) + (let ((s4-1 (max 2 (min 4 (rand-vu-int-range 1 8))))) + (dotimes (s3-2 s4-1) + (ja-no-eval :group! fac-robotank-fire-start-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (fac-robotank-turret-method-33 self) + (ja-no-eval :group! fac-robotank-fire-end-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self gun-index) (- 1 (-> self gun-index))) + (suspend) + (if (< (vector-length (vector-! (new 'stack-no-clear 'vector) (-> self firing-sight-pos) (-> self root trans))) + 73728.0 + ) + (goto cfg-22) + ) + ) + ) + (let ((f30-0 (rand-vu-float-range 0.05 0.43)) + (s4-2 (current-time)) + ) + (until (time-elapsed? s4-2 (the int (* 300.0 f30-0))) + (suspend) + ) + ) + ) + ) + (label cfg-22) + (logclear! (-> self flags) (fac-robotank-turret-flag frt3)) + (until (fac-robotank-turret-method-34 self (-> self aim-pos 2) 2730.6667) + (suspend) + ) + (let ((f30-1 (rand-vu-float-range + (if (< 2730.6667 (-> self rotate-rate)) + 1.2 + 0.32 + ) + 2.11 + ) + ) + (gp-3 (current-time)) + ) + (until (time-elapsed? gp-3 (the int (* 300.0 f30-1))) + (suspend) + ) + ) + ) + #f + ) + :post turret-post + ) + +;; failed to figure out what this is: +(defstate die (fac-robotank-turret) + :virtual #t + :code (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (while (-> self child) + (suspend) + ) + ) + ) + +;; definition for method 10 of type fac-robotank-turret +(defmethod deactivate ((this fac-robotank-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (logclear! (-> this flags) (fac-robotank-turret-flag frt6)) + (sound-stop (-> this turn-sound-id)) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 7 of type fac-robotank-turret +;; WARN: Return type mismatch process-focusable vs fac-robotank-turret. +(defmethod relocate ((this fac-robotank-turret) (offset int)) + (if (nonzero? (-> this gun-elev-jmod)) + (&+! (-> this gun-elev-jmod) offset) + ) + (the-as fac-robotank-turret ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for function fac-robotank-turret-init-by-other +;; INFO: Used lq/sq +(defbehavior fac-robotank-turret-init-by-other fac-robotank-turret ((arg0 vector) (arg1 quaternion) (arg2 vector) (arg3 float)) + (let ((s2-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s2-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s2-0 reaction) cshape-reaction-default) + (set! (-> s2-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s1-0 (new 'process 'collide-shape-prim-group s2-0 (the-as uint 4) 0))) + (set! (-> s2-0 total-prims) (the-as uint 5)) + (set! (-> s1-0 prim-core collide-as) (collide-spec obstacle camera-blocker pusher)) + (set! (-> s1-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s1-0 prim-core action) (collide-action solid)) + (set-vector! (-> s1-0 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s2-0 root-prim) s1-0) + ) + (pusher-init s2-0) + (let ((v1-14 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 2) (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 16384.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 8) + (set-vector! (-> v1-16 local-sphere) 0.0 0.0 4096.0 6553.6) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 5) + (set-vector! (-> v1-18 local-sphere) 0.0 0.0 4096.0 6553.6) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 3) (the-as uint 0)))) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 20480.0 4096.0 31129.6) + ) + (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) + (let ((v1-23 (-> s2-0 root-prim))) + (set! (-> s2-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s2-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> self root) s2-0) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (set! (-> self offset quad) (-> arg2 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robotank-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self draw light-index) (the-as uint 10)) + (init-los! (-> self los) self (seconds 0.1) 327680.0 (collide-spec backgnd)) + (set! (-> self gun-elev-jmod) (new 'process 'joint-mod (joint-mod-mode joint-set*) self 4)) + (set! (-> self gun-elev) 0.0) + (set! (-> self gun-elev-cam) 0.0) + (set! (-> self gun-spread) 728.1778) + (quaternion-axis-angle! (-> self gun-elev-jmod quat) 1.0 0.0 0.0 (-> self gun-elev)) + (quaternion-zero! (-> self tank-quat)) + (quaternion-copy! (-> self rotate-quat) arg1) + (set! (-> self rotate-rate) 0.0) + (set! (-> self rotate-mult) arg3) + (set! (-> self aim-pos 0 quad) (-> self root trans quad)) + (set! (-> self aim-pos 1 quad) (-> self root trans quad)) + (set! (-> self aim-pos 2 quad) (-> self root trans quad)) + (set-time! (-> self gun-timer)) + (set! (-> self flags) (fac-robotank-turret-flag)) + (set! (-> self fov-mult) 1.0) + (set! (-> self shot-range) 204800.0) + (set! (-> self gun-joint-l 0) 10) + (set! (-> self gun-joint-r 0) 7) + (set! (-> self gun-joint-l 1) 9) + (set! (-> self gun-joint-r 1) 6) + (set! (-> self gun-index) 0) + (let ((v1-51 (new 'stack-no-clear 'vector))) + (set! (-> v1-51 quad) (-> self root trans quad)) + (+! (-> v1-51 z) 40960.0) + (+! (-> v1-51 y) 32768.0) + ) + (ja-no-eval :group! fac-robotank-idle-ja :num! zero) + (transform-post) + (set! (-> self turn-sound-id) (new-sound-id)) + (go-virtual ready) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc new file mode 100644 index 0000000000..33963db970 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/fac-robotank_REF.gc @@ -0,0 +1,1022 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-robotank-barrel-sparks + :id 783 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2927 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2927 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0 6.0) + (:x (meters -4) (meters 8)) + (:scale-x (meters 1)) + (:rot-x 4) + (:scale-y (meters 0.05) (meters 0.05)) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 64.0 64.0) + (:omega (degrees 0.03375)) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:fade-r -0.85333335) + (:fade-g -0.85333335) + (:accel-y (meters -0.0026666666) (meters -0.001)) + (:friction 0.875) + (:timer (seconds 0.085) (seconds 0.33)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.017) (seconds 0.98)) + (:next-launcher 2928) + (:conerot-x (degrees -45) (degrees 90)) + (:conerot-y (degrees -45) (degrees 90)) + (:conerot-z (degrees -45) (degrees 90)) + (:rotate-y (degrees 0)) + (:conerot-radius (meters 0) (meters 0.2)) + ) + ) + +;; failed to figure out what this is: +(defpart 2928 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.85333335 -1.7066667)) + ) + +;; definition of type fac-robotank-segment-event +(deftype fac-robotank-segment-event (structure) + ((source uint64) + (event-type symbol) + (actor string) + (pos-norm float) + (param basic) + (param-obj object :overlay-at param) + (param-func (function fort-robotank none) :overlay-at param) + (param-sym symbol :overlay-at param) + ) + ) + +;; definition for method 3 of type fac-robotank-segment-event +(defmethod inspect ((this fac-robotank-segment-event)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-robotank-segment-event) + (format #t "~1Tsource: ~D~%" (-> this source)) + (format #t "~1Tevent-type: ~A~%" (-> this event-type)) + (format #t "~1Tactor: ~A~%" (-> this actor)) + (format #t "~1Tpos-norm: ~f~%" (-> this pos-norm)) + (format #t "~1Tparam: ~A~%" (-> this param)) + (label cfg-4) + this + ) + +;; definition of type fac-robotank-segment +(deftype fac-robotank-segment (structure) + ((flags robotank-segment-flag) + (max-speed float) + (next-segment int32) + (next-segment-start float) + (event-count int32) + (event-tbl (inline-array fac-robotank-segment-event)) + ) + ) + +;; definition for method 3 of type fac-robotank-segment +(defmethod inspect ((this fac-robotank-segment)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-robotank-segment) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tnext-segment: ~D~%" (-> this next-segment)) + (format #t "~1Tnext-segment-start: ~f~%" (-> this next-segment-start)) + (format #t "~1Tevent-count: ~D~%" (-> this event-count)) + (format #t "~1Tevent-tbl: #x~X~%" (-> this event-tbl)) + (label cfg-4) + this + ) + +;; definition of type fac-robotank-path-info +(deftype fac-robotank-path-info (structure) + ((dir vector :inline) + (u float) + (du float) + (du-final float) + (prev-u float) + (max-speed float) + (dist float) + (dir-y-angle float) + (start-y-angle float) + ) + ) + +;; definition for method 3 of type fac-robotank-path-info +(defmethod inspect ((this fac-robotank-path-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-robotank-path-info) + (format #t "~1Tdir: #~%" (-> this dir)) + (format #t "~1Tu: ~f~%" (-> this u)) + (format #t "~1Tdu: ~f~%" (-> this du)) + (format #t "~1Tdu-final: ~f~%" (-> this du-final)) + (format #t "~1Tprev-u: ~f~%" (-> this prev-u)) + (format #t "~1Tmax-speed: ~f~%" (-> this max-speed)) + (format #t "~1Tdist: ~f~%" (-> this dist)) + (format #t "~1Tdir-y-angle: ~f~%" (-> this dir-y-angle)) + (format #t "~1Tstart-y-angle: ~f~%" (-> this start-y-angle)) + (label cfg-4) + this + ) + +;; definition of type fac-robotank-path-info-array +(deftype fac-robotank-path-info-array (inline-array-class) + ((data fac-robotank-path-info :inline :dynamic) + ) + ) + +;; definition for method 3 of type fac-robotank-path-info-array +(defmethod inspect ((this fac-robotank-path-info-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! (-> fac-robotank-path-info-array heap-base) (the-as uint 48)) + +;; definition of type fac-robotank-wheel-info +(deftype fac-robotank-wheel-info (structure) + ((jmod joint-mod-spinner) + (radius float) + ) + ) + +;; definition for method 3 of type fac-robotank-wheel-info +(defmethod inspect ((this fac-robotank-wheel-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-robotank-wheel-info) + (format #t "~1Tjmod: ~A~%" (-> this jmod)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (label cfg-4) + this + ) + +;; definition of type fac-robotank-tread-info +(deftype fac-robotank-tread-info (structure) + ((wheel fac-robotank-wheel-info 7 :inline) + (texture texture-anim) + (locator-joint int32) + (pos vector :inline) + ) + ) + +;; definition for method 3 of type fac-robotank-tread-info +(defmethod inspect ((this fac-robotank-tread-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'fac-robotank-tread-info) + (format #t "~1Twheel[7] @ #x~X~%" (-> this wheel)) + (format #t "~1Ttexture: #~%" (-> this texture)) + (format #t "~1Tlocator-joint: ~D~%" (-> this locator-joint)) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; definition of type fac-robotank +(deftype fac-robotank (process-focusable) + ((parent (pointer factory-manager) :override) + (self fac-robotank :override) + (ppointer (pointer fac-robotank) :override) + (barrel-part sparticle-launch-control) + (vibe-jmod joint-mod-blend-local :inline) + (tread fac-robotank-tread-info 2 :inline) + (path-info fac-robotank-path-info-array) + (flags robotank-flag) + (mgr handle) + (pov-cam-offset vector 2 :inline) + (explode-sg skeleton-group) + (turret handle) + (no-collision-timer time-frame) + (buzz-timer time-frame) + (engine-vibe-rate float) + (engine-vibe-amp float) + (attack-id uint32) + (path-index int32) + (path-count int32) + (continue-index int32) + (hit-points float) + (engine-sound sound-id) + (engine-sound-playing symbol) + (snd-cmd-time time-frame) + ) + (:state-methods + turning + moving + pause + die + ) + (:methods + (fac-robotank-method-32 (_type_) none) + (fac-robotank-method-33 (_type_) none) + (go-explode (_type_) (pointer joint-exploder)) + ) + ) + +;; definition for method 3 of type fac-robotank +(defmethod inspect ((this fac-robotank)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tbarrel-part: ~A~%" (-> this barrel-part)) + (format #t "~2Tvibe-jmod: #~%" (-> this vibe-jmod)) + (format #t "~2Ttread[2] @ #x~X~%" (-> this tread)) + (format #t "~2Tpath-info: ~A~%" (-> this path-info)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tmgr: ~D~%" (-> this mgr)) + (format #t "~2Tpov-cam-offset[2] @ #x~X~%" (-> this pov-cam-offset)) + (format #t "~2Texplode-sg: ~A~%" (-> this explode-sg)) + (format #t "~2Tturret: ~D~%" (-> this turret)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tbuzz-timer: ~D~%" (-> this buzz-timer)) + (format #t "~2Tengine-vibe-rate: ~f~%" (-> this engine-vibe-rate)) + (format #t "~2Tengine-vibe-amp: ~f~%" (-> this engine-vibe-amp)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tpath-index: ~D~%" (-> this path-index)) + (format #t "~2Tpath-count: ~D~%" (-> this path-count)) + (format #t "~2Tcontinue-index: ~D~%" (-> this continue-index)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tengine-sound: ~D~%" (-> this engine-sound)) + (format #t "~2Tengine-sound-playing: ~A~%" (-> this engine-sound-playing)) + (format #t "~2Tsnd-cmd-time: ~D~%" (-> this snd-cmd-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-robotank fac-robotank fac-robotank-lod0-jg fac-robotank-idle-ja + ((fac-robotank-lod0-mg (meters 20)) (fac-robotank-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-robotank-explode fac-robotank fac-robotank-explode-lod0-jg fac-robotank-explode-idle-ja + ((fac-robotank-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; definition for symbol *fac-robotank-exploder-params*, type joint-exploder-static-params +(define *fac-robotank-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition for method 32 of type fac-robotank +;; WARN: Return type mismatch event-message-block vs none. +(defmethod fac-robotank-method-32 ((this fac-robotank)) + (with-pp + (let ((v1-0 (-> this root))) + (when (< (-> *event-queue* length) (-> *event-queue* allocated-length)) + (let ((v0-1 (-> *event-queue* data (-> *event-queue* length)))) + (+! (-> *event-queue* length) 1) + (set! (-> v0-1 from-handle) (process->handle pp)) + (set! (-> v0-1 to-handle) (process->handle (handle->process (-> this turret)))) + (set! (-> v0-1 num-params) 4) + (set! (-> v0-1 message) 'update) + (set! (-> v0-1 param 0) (the-as uint (-> v1-0 trans))) + (set! (-> v0-1 param 1) (the-as uint (-> v1-0 quat))) + (set! (-> v0-1 param 2) (the-as uint (-> this node-list data 3))) + (set! (-> v0-1 param 3) (the-as uint (-> this vibe-jmod transform quat))) + ) + ) + ) + (none) + ) + ) + +;; definition for function fac-robotank-post +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defbehavior fac-robotank-post fac-robotank () + (when (and (nonzero? (-> self no-collision-timer)) + (time-elapsed? (-> self no-collision-timer) (-> *TARGET-bank* hit-invulnerable-timeout)) + ) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-7 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set! (-> self no-collision-timer) 0) + 0 + ) + (fac-robotank-method-32 self) + (dotimes (gp-0 2) + (let* ((s5-0 (-> self tread gp-0)) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data (-> s5-0 locator-joint)))) + ) + (let ((s3-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (-> s5-0 pos)))) + (let ((s2-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (if (= gp-0 1) + (vector-float*! s2-0 s2-0 -1.0) + ) + (let ((s1-0 (get-field-spec-by-id (-> *part-id-table* 2924) (sp-field-id spt-num))) + (f30-0 (vector-length s3-1)) + (f28-0 (* 12288.0 (seconds-per-frame))) + ) + (set! (-> s1-0 initial-valuef) (lerp-scale 0.0 0.5 f30-0 0.0 f28-0)) + (set! (-> s1-0 random-rangef) (lerp-scale 0.0 1.0 f30-0 0.0 f28-0)) + ) + (let ((a1-8 (forward-up-nopitch->inv-matrix (new 'stack-no-clear 'matrix) s2-0 *up-vector*))) + (set! (-> a1-8 trans quad) (-> s4-0 quad)) + (+! (-> a1-8 trans y) -2498.56) + (spawn-from-mat (-> self part) a1-8) + ) + ) + (vector-inv-orient-by-quat! s3-1 s3-1 (-> self root quat)) + (let ((f30-1 (fabs (-> s3-1 z)))) + (dotimes (s3-2 7) + (let ((s2-1 (-> s5-0 wheel s3-2))) + (set! (-> s2-1 jmod spin-rate) (* (atan f30-1 (-> s2-1 radius)) (-> self clock frames-per-second))) + ) + ) + ) + ) + (set! (-> s5-0 pos quad) (-> s4-0 quad)) + ) + ) + (let ((v1-48 (-> self path-info data (-> self path-index)))) + (cond + ((and (logtest? (-> self flags) (robotank-flag r2)) (!= (-> v1-48 u) (-> v1-48 prev-u))) + (seek! (-> self engine-vibe-rate) 3.0 (seconds-per-frame)) + (seek! (-> self engine-vibe-amp) 1.0 (seconds-per-frame)) + ) + (else + (seek! (-> self engine-vibe-rate) 1.0 (seconds-per-frame)) + (seek! (-> self engine-vibe-amp) 0.4 (seconds-per-frame)) + ) + ) + ) + (let* ((f0-23 30.0) + (f1-4 65536.0) + (f2-1 (the float (current-time))) + (f0-24 (/ (* f1-4 (- f2-1 (* (the float (the int (/ f2-1 f0-23))) f0-23))) f0-23)) + (f30-2 (sin f0-24)) + (f28-1 (* 300.0 (/ 1.0 (-> self engine-vibe-rate)))) + (f0-27 (the float (current-time))) + (f26-0 (/ (- f0-27 (* (the float (the int (/ f0-27 f28-1))) f28-1)) f28-1)) + (f30-3 (* f30-2 (sin (* 65536.0 f26-0)))) + ) + (let* ((f0-32 (sin 7281.778)) + (f1-13 (- 1.0 f0-32)) + ) + 0.0 + (when (and (or (< f0-32 f26-0) (< f26-0 f1-13)) (time-elapsed? (-> self buzz-timer) (the int (* 0.5 f28-1)))) + (let* ((gp-1 *target*) + (a0-37 (if (type? gp-1 process-focusable) + gp-1 + ) + ) + ) + (if a0-37 + (lerp-scale 1.0 0.0 (vector-vector-distance (-> self root trans) (get-trans a0-37 0)) 81920.0 327680.0) + ) + ) + (set-time! (-> self buzz-timer)) + ) + ) + (quaternion-axis-angle! + (-> self vibe-jmod transform quat) + 0.0 + 0.0 + 1.0 + (* 182.04445 (* (-> self engine-vibe-amp) f30-3)) + ) + ) + (when (logtest? (-> self flags) (robotank-flag r7)) + (let ((gp-3 (quaternion-inverse! (new 'stack-no-clear 'quaternion) (-> self root quat))) + (a1-21 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-21 from) (process->ppointer self)) + (set! (-> a1-21 num-params) 0) + (set! (-> a1-21 message) 'get-rotate-quat) + (let ((s5-2 (send-event-function (handle->process (-> self turret)) a1-21)) + (s4-2 (new 'stack-no-clear 'quaternion)) + (s2-3 (-> (the-as fac-robotank-turret (handle->process (-> self turret))) root trans)) + (s1-1 (-> self root trans)) + (s3-4 (new 'stack-no-clear 'vector)) + ) + (let ((a1-23 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-23 from) (process->ppointer self)) + (set! (-> a1-23 num-params) 0) + (set! (-> a1-23 message) 'get-gun-elevation-cam) + (let ((f30-4 (the-as float (send-event-function (handle->process (-> self turret)) a1-23)))) + (vector-! s3-4 s2-3 s1-1) + (vector-orient-by-quat! s3-4 s3-4 gp-3) + (quaternion*! s4-2 (the-as quaternion s5-2) gp-3) + (quaternion-normalize! s4-2) + (quaternion-rotate-local-x! s4-2 s4-2 f30-4) + ) + ) + (vector-orient-by-quat! (the-as vector (-> self pov-cam-offset)) (-> self pov-cam-offset 1) s4-2) + (vector+! (the-as vector (-> self pov-cam-offset)) (the-as vector (-> self pov-cam-offset)) s3-4) + ) + ) + ) + (pusher-post) + (none) + ) + +;; definition for function fac-robotank-handler +(defbehavior fac-robotank-handler fac-robotank ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (when (and *target* (< (-> self continue-index) (the-as int (-> arg3 param 0)))) + (if (< (-> self continue-index) 0) + (add-process *gui-control* self (gui-channel alert) (gui-action play) "cityv107" -99.0 0) + ) + (logior! (-> self flags) (robotank-flag r5)) + (let ((v0-0 (the-as object (-> arg3 param 0)))) + (set! (-> self continue-index) (the-as int v0-0)) + v0-0 + ) + ) + ) + (('trans) + (-> self root trans) + ) + (('die) + (go-virtual die) + ) + (('fire-suppress-on) + (send-event (handle->process (-> self turret)) 'fire-suppress #t) + ) + (('fire-suppress-off) + (send-event (handle->process (-> self turret)) 'fire-suppress #f) + ) + (('attack) + (let ((v1-26 (the-as attack-info (-> arg3 param 1)))) + 0.0 + (let ((f1-0 (if (logtest? (attack-mask damage) (-> v1-26 mask)) + (-> v1-26 damage) + 0.0 + ) + ) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f1-0))) + ) + ) + (when (>= 0.0 (-> self hit-points)) + (go-explode self) + (go-virtual die) + ) + ) + (('stop-music) + (remove-setting! 'music) + (remove-setting! 'music-volume) + (remove-setting! 'sound-mode) + ) + ) + ) + +;; failed to figure out what this is: +(defstate turning (fac-robotank) + :virtual #t + :event fac-robotank-handler + :enter (behavior () + (set! (-> self path-info data (-> self path-index) start-y-angle) (quaternion-y-angle (-> self root quat))) + ) + :trans (behavior () + (let* ((gp-0 (-> self path-info data (-> self path-index))) + (s5-0 (-> self root)) + (f30-0 (quaternion-y-angle (-> s5-0 quat))) + (f28-0 (fabs (deg-diff f30-0 (-> gp-0 start-y-angle)))) + (f30-1 (fabs (deg-diff f30-0 (vector-y-angle (-> gp-0 dir))))) + ) + (let* ((f0-3 (fmin f28-0 f30-1)) + (f0-6 (fmax 728.1778 (fmin 10012.444 (* 4.0 f0-3)))) + ) + (seek-toward-heading-vec! s5-0 (-> gp-0 dir) f0-6 (seconds 0.02)) + ) + (if (< f30-1 36.40889) + (go-virtual pause) + ) + ) + ) + :code sleep-code + :post (behavior () + (fac-robotank-post) + ) + ) + +;; definition for method 21 of type fac-robotank +(defmethod get-trans ((this fac-robotank) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +;; failed to figure out what this is: +(defstate moving (fac-robotank) + :virtual #t + :event fac-robotank-handler + :enter (behavior () + (let ((v1-3 (-> self path-info data (-> self path-index)))) + (set! (-> v1-3 u) 0.0) + (set! (-> v1-3 prev-u) -1.0) + (set! (-> v1-3 du) 0.0) + (set! (-> v1-3 du-final) 0.01) + ) + (sound-play "tank-engine" :id (-> self engine-sound) :position (-> self root trans)) + (set! (-> self engine-sound-playing) #t) + (set-time! (-> self snd-cmd-time)) + ) + :exit (behavior () + (logclear! (-> self flags) (robotank-flag r2)) + ) + :trans (behavior () + (if (not *target*) + (go-virtual die) + ) + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (when a0-1 + (if (< (-> (get-trans a0-1 0) y) (+ -18432.0 (-> self root trans y))) + (go-virtual die) + ) + ) + ) + (let ((v1-14 (-> self path-index))) + (when (= (-> self path-info data v1-14 u) 1.0) + ) + ) + ) + :code (behavior () + (logclear! (-> self flags) (robotank-flag r2)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 0.1)) + (suspend) + ) + ) + (logior! (-> self flags) (robotank-flag r2)) + (sleep-code) + ) + :post (behavior () + (when (logtest? (-> self flags) (robotank-flag r2)) + (let* ((gp-0 *target*) + (a0-1 (if (type? gp-0 process-focusable) + gp-0 + ) + ) + ) + (cond + (a0-1 + (get-trans a0-1 0) + ) + (else + ) + ) + ) + (let ((gp-1 (-> self path-info data (-> self path-index)))) + (let* ((s5-0 (the-as factory-manager (handle->process (-> self mgr)))) + (s2-0 (-> s5-0 tpath path (-> self path-index))) + (s1-0 (new 'stack-no-clear 'vector)) + (f28-0 (-> gp-1 u)) + (s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (-> self root)) + (f30-0 (seconds-per-frame)) + ) + (get-point-at-percent-along-path! s2-0 (-> s4-0 trans) f28-0 'interp) + (+! (-> s4-0 trans y) 1024.0) + (displacement-between-points-at-percent-normalized! s2-0 s3-0 f28-0) + (path-control-method-15 s2-0 s1-0 f28-0 (-> gp-1 du-final)) + (seek-toward-heading-vec! s4-0 s3-0 16384.0 (seconds 0.02)) + (set! (-> gp-1 prev-u) (-> gp-1 u)) + (set! (-> gp-1 u) + (path-control-method-26 (-> s5-0 tpath path (-> self path-index)) (-> gp-1 u) (* 40960.0 f30-0)) + ) + ) + (if (>= (-> gp-1 u) 1.0) + (go-virtual die) + ) + ) + 0 + ) + (when (time-elapsed? (-> self snd-cmd-time) (seconds 0.5)) + (sound-play "tank-engine" :id (-> self engine-sound) :vol 80 :position (-> self root trans)) + (set! (-> self engine-sound-playing) #t) + (set-time! (-> self snd-cmd-time)) + ) + (fac-robotank-post) + ) + ) + +;; failed to figure out what this is: +(defstate pause (fac-robotank) + :virtual #t + :event fac-robotank-handler + :enter (behavior () + '() + ) + :trans (behavior () + (when (logtest? (-> self flags) (robotank-flag r5)) + (logclear! (-> self flags) (robotank-flag r5)) + (go-virtual moving) + ) + ) + :code sleep-code + :post fac-robotank-post + ) + +;; definition for method 34 of type fac-robotank +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer joint-exploder). +(defmethod go-explode ((this fac-robotank)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (sound-play "tank-explode") + (cond + ((logtest? (-> *part-group-id-table* 732 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 732)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 732)) + ) + ) + (let ((s5-3 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((v1-34 (new 'stack-no-clear 'vector))) + (let ((a0-17 (-> s5-3 fountain-rand-transv-lo))) + (let ((a1-9 (-> this root trans))) + (let ((a2-12 *up-vector*)) + (let ((a3-6 2048.0)) + (.mov vf7 a3-6) + ) + (.lvf vf5 (&-> a2-12 quad)) + ) + (.lvf vf4 (&-> a1-9 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-17 quad) vf6) + ) + (vector-float*! v1-34 *up-vector* 81920.0) + (let ((a2-14 (-> s5-3 fountain-rand-transv-lo))) + (let ((a0-20 v1-34)) + (let ((a1-11 *identity-vector*)) + (let ((a3-8 -40960.0)) + (.mov vf7 a3-8) + ) + (.lvf vf5 (&-> a1-11 quad)) + ) + (.lvf vf4 (&-> a0-20 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-14 quad) vf6) + ) + (let ((a1-12 (-> s5-3 fountain-rand-transv-hi))) + (let ((a0-21 *identity-vector*)) + (let ((a2-16 40960.0)) + (.mov vf7 a2-16) + ) + (.lvf vf5 (&-> a0-21 quad)) + ) + (.lvf vf4 (&-> v1-34 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-12 quad) vf6) + ) + ) + (set! (-> s5-3 gravity) -122880.0) + (set! (-> s5-3 rot-speed) 16.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-robotank-explode" (the-as (pointer level) #f)) + 9 + s5-3 + *fac-robotank-exploder-params* + :name "joint-exploder" + :to this + :unk 0 + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (fac-robotank) + :virtual #t + :code (behavior () + (send-event (handle->process (-> self turret)) 'die) + (let ((v1-7 (-> self root root-prim))) + (set! (-> v1-7 prim-core collide-as) (collide-spec)) + (set! (-> v1-7 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + (while (-> self child) + (suspend) + ) + (let ((v1-20 (handle->process (-> self mgr)))) + (+! (-> v1-20 stack 2) -1) + ) + ) + ) + +;; definition for method 10 of type fac-robotank +(defmethod deactivate ((this fac-robotank)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this engine-sound-playing) + (sound-stop (-> this engine-sound)) + ) + (if (nonzero? (-> this barrel-part)) + (kill-particles (-> this barrel-part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 7 of type fac-robotank +(defmethod relocate ((this fac-robotank) (offset int)) + (if (nonzero? (-> this barrel-part)) + (&+! (-> this barrel-part) offset) + ) + (if (nonzero? (-> this path-info)) + (&+! (-> this path-info) offset) + ) + (dotimes (v1-8 2) + (dotimes (a0-1 7) + (if (nonzero? (-> (the-as fac-robotank (+ (&+ this (* 144 v1-8)) (* a0-1 16))) tread 0 wheel 0 jmod)) + (&+! (-> (the-as fac-robotank (+ (&+ this (* 144 v1-8)) (* a0-1 16))) tread 0 wheel 0 jmod) offset) + ) + ) + ) + (call-parent-method this offset) + ) + +;; definition for function fac-robotank-birth-path +(defbehavior fac-robotank-birth-path fac-robotank ((arg0 factory-manager)) + (local-vars (v0-0 int)) + 0 + (until (not (logtest? (-> arg0 tpath inout v0-0 flags) (factory-inout-flag fi0 fi2))) + (set! v0-0 (rand-vu-int-range 0 (+ (-> arg0 tpath npath) -1))) + ) + v0-0 + ) + +;; definition for function fac-robotank-init-by-other +(defbehavior fac-robotank-init-by-other fac-robotank () + (set! (-> self mgr) (ppointer->handle (-> self parent))) + (let ((gp-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> gp-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> gp-0 reaction) cshape-reaction-default) + (set! (-> gp-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s5-0 (new 'process 'collide-shape-prim-group gp-0 (the-as uint 1) 0))) + (set! (-> gp-0 total-prims) (the-as uint 2)) + (set! (-> s5-0 prim-core collide-as) (collide-spec enemy obstacle camera-blocker pusher)) + (set! (-> s5-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s5-0 prim-core action) (collide-action solid)) + (set-vector! (-> s5-0 local-sphere) 0.0 0.0 0.0 47104.0) + (set! (-> gp-0 root-prim) s5-0) + ) + (pusher-init gp-0) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere gp-0 (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 32768.0) + ) + (set! (-> gp-0 nav-radius) (* 0.75 (-> gp-0 root-prim local-sphere w))) + (let ((v1-20 (-> gp-0 root-prim))) + (set! (-> gp-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> gp-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> self root) gp-0) + ) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self level) (level-get *level* 'factoryb)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robotank" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self explode-sg) + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-robotank-explode" (the-as (pointer level) #f)) + ) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (set! (-> self draw light-index) (the-as uint 10)) + (set! (-> self fact) + (new 'process 'fact-info self (pickup-type eco-pill-random) (-> *FACT-bank* default-eco-pill-green-inc)) + ) + (set! (-> self flags) (robotank-flag)) + (set! (-> self no-collision-timer) 0) + (set! (-> self engine-vibe-rate) 1.0) + (set! (-> self buzz-timer) 0) + (let* ((v1-37 *game-info*) + (a0-24 (+ (-> v1-37 attack-id) 1)) + ) + (set! (-> v1-37 attack-id) a0-24) + (set! (-> self attack-id) a0-24) + ) + (set! (-> self hit-points) 1.0) + (let ((gp-2 (handle->process (-> self mgr)))) + (set! (-> self path-count) (-> (the-as factory-manager gp-2) tpath npath)) + (set! (-> self path-info) (new 'process 'fac-robotank-path-info-array (-> self path-count))) + (set! (-> self path-index) (fac-robotank-birth-path (the-as factory-manager (handle->process (-> self mgr))))) + (set! (-> self continue-index) -1) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (get-point-at-percent-along-path! + (-> (the-as factory-manager gp-2) tpath path 0) + (-> self root trans) + 0.0 + 'interp + ) + (+! (-> self root trans y) 1024.0) + (displacement-between-points-at-percent-normalized! (-> (the-as factory-manager gp-2) tpath path 0) s5-2 0.0) + (set-heading-vec! (-> self root) s5-2) + ) + ) + (ja-no-eval :group! fac-robotank-idle-ja :num! zero) + (transform-post) + (let ((gp-3 (new 'stack-no-clear 'vector))) + (set-vector! gp-3 0.0 12541.952 -6778.88 1.0) + (set! (-> self turret) (ppointer->handle (process-spawn + fac-robotank-turret + (-> self root trans) + (-> self root quat) + gp-3 + 32.0 + :name "fac-robotank-turret" + :to self + ) + ) + ) + ) + (init (-> self vibe-jmod) self (the-as uint 4) (joint-mod-base-flags attached)) + (set! (-> self vibe-jmod blend) 0.5) + (quaternion-axis-angle! (-> self vibe-jmod transform quat) 0.0 0.0 1.0 0.0) + (let ((gp-4 (-> self tread))) + (set! (-> gp-4 0 wheel 0 jmod) (new 'process 'joint-mod-spinner self 5 *x-vector* 0.0)) + (set! (-> gp-4 0 wheel 0 radius) 2048.0) + ) + (let ((gp-5 (the-as object (&-> self stack 240)))) + (set! (-> (the-as fac-robotank-tread-info gp-5) wheel 0 jmod) + (new 'process 'joint-mod-spinner self 6 *x-vector* 0.0) + ) + (set! (-> (the-as fac-robotank-tread-info gp-5) wheel 0 radius) 2048.0) + ) + (let ((gp-6 (the-as fac-robotank-tread-info (&-> self stack 256)))) + (set! (-> gp-6 wheel 0 jmod) (new 'process 'joint-mod-spinner self 7 *x-vector* 0.0)) + (set! (-> gp-6 wheel 0 radius) 2048.0) + ) + (let ((gp-7 (the-as fac-robotank-tread-info (&-> self stack 272)))) + (set! (-> gp-7 wheel 0 jmod) (new 'process 'joint-mod-spinner self 8 *x-vector* 0.0)) + (set! (-> gp-7 wheel 0 radius) 2048.0) + ) + (let ((gp-8 (the-as fac-robotank-tread-info (&-> self stack 288)))) + (set! (-> gp-8 wheel 0 jmod) (new 'process 'joint-mod-spinner self 9 *x-vector* 0.0)) + (set! (-> gp-8 wheel 0 radius) 2048.0) + ) + (let ((gp-9 (the-as fac-robotank-tread-info (&-> self stack 304)))) + (set! (-> gp-9 wheel 0 jmod) (new 'process 'joint-mod-spinner self 10 *x-vector* 0.0)) + (set! (-> gp-9 wheel 0 radius) 2048.0) + ) + (let ((gp-10 (the-as fac-robotank-tread-info (&-> self stack 320)))) + (set! (-> gp-10 wheel 0 jmod) (new 'process 'joint-mod-spinner self 11 *x-vector* 0.0)) + (set! (-> gp-10 wheel 0 radius) 2048.0) + ) + (let ((gp-11 (-> self tread 1))) + (set! (-> gp-11 wheel 0 jmod) (new 'process 'joint-mod-spinner self 12 *x-vector* 0.0)) + (set! (-> gp-11 wheel 0 radius) 2048.0) + ) + (let ((gp-12 (the-as fac-robotank-tread-info (&-> self stack 384)))) + (set! (-> gp-12 wheel 0 jmod) (new 'process 'joint-mod-spinner self 13 *x-vector* 0.0)) + (set! (-> gp-12 wheel 0 radius) 2048.0) + ) + (let ((gp-13 (the-as fac-robotank-tread-info (&-> self stack 400)))) + (set! (-> gp-13 wheel 0 jmod) (new 'process 'joint-mod-spinner self 14 *x-vector* 0.0)) + (set! (-> gp-13 wheel 0 radius) 2048.0) + ) + (let ((gp-14 (the-as fac-robotank-tread-info (&-> self stack 416)))) + (set! (-> gp-14 wheel 0 jmod) (new 'process 'joint-mod-spinner self 15 *x-vector* 0.0)) + (set! (-> gp-14 wheel 0 radius) 2048.0) + ) + (let ((gp-15 (the-as fac-robotank-tread-info (&-> self stack 432)))) + (set! (-> gp-15 wheel 0 jmod) (new 'process 'joint-mod-spinner self 16 *x-vector* 0.0)) + (set! (-> gp-15 wheel 0 radius) 2048.0) + ) + (let ((gp-16 (the-as fac-robotank-tread-info (&-> self stack 448)))) + (set! (-> gp-16 wheel 0 jmod) (new 'process 'joint-mod-spinner self 17 *x-vector* 0.0)) + (set! (-> gp-16 wheel 0 radius) 2048.0) + ) + (let ((gp-17 (the-as fac-robotank-tread-info (&-> self stack 464)))) + (set! (-> gp-17 wheel 0 jmod) (new 'process 'joint-mod-spinner self 18 *x-vector* 0.0)) + (set! (-> gp-17 wheel 0 radius) 2048.0) + ) + (let ((v1-105 8)) + (set! (-> self tread 0 locator-joint) v1-105) + (vector<-cspace! (-> self tread 0 pos) (-> self node-list data v1-105)) + ) + (let ((v1-109 15)) + (set! (-> self tread 1 locator-joint) v1-109) + (vector<-cspace! (-> self tread 1 pos) (-> self node-list data v1-109)) + ) + (set-vector! (-> self pov-cam-offset 0) 0.0 13516.8 -13516.8 1.0) + (set-vector! (-> self pov-cam-offset 1) 0.0 13516.8 -13516.8 1.0) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 782) self)) + (set! (-> self barrel-part) (create-launch-control (-> *part-group-id-table* 783) self)) + (set! (-> self engine-sound) (new-sound-id)) + (set! (-> self engine-sound-playing) #f) + (set-time! (-> self snd-cmd-time)) + (go-virtual moving) + ) + +;; definition for function fac-robotank-spawn +;; WARN: Return type mismatch process vs fac-robotank. +(defun fac-robotank-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn fac-robotank :name "fac-robotank" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as fac-robotank gp-0) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc new file mode 100644 index 0000000000..e6b4b39c56 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/fac-tower_REF.gc @@ -0,0 +1,1093 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *fac-tower-impact-pos*, type vector +(define *fac-tower-impact-pos* (new 'static 'vector :w 1.0)) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower-base fac-gun-tower-base fac-gun-tower-base-lod0-jg fac-gun-tower-base-idle-ja + ((fac-gun-tower-base-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower-base-broken-north fac-gun-tower-base fac-gun-tower-base-broken-north-lod0-jg fac-gun-tower-base-broken-north-idle-ja + ((fac-gun-tower-base-broken-north-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower-base-broken-south fac-gun-tower-base fac-gun-tower-base-broken-south-lod0-jg fac-gun-tower-base-broken-south-idle-ja + ((fac-gun-tower-base-broken-south-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower-base-broken-east fac-gun-tower-base fac-gun-tower-base-broken-east-lod0-jg fac-gun-tower-base-broken-east-idle-ja + ((fac-gun-tower-base-broken-east-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower-base-broken-west fac-gun-tower-base fac-gun-tower-base-broken-west-lod0-jg fac-gun-tower-base-broken-west-idle-ja + ((fac-gun-tower-base-broken-west-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 60) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower fac-gun-tower fac-gun-tower-lod0-jg fac-gun-tower-idle-ja + ((fac-gun-tower-lod0-mg (meters 20)) (fac-gun-tower-lod1-mg (meters 999999))) + :bounds (static-spherem 0 25 0 75) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-gun-tower-break fac-gun-tower fac-gun-tower-break-lod0-jg fac-gun-tower-break-idle-ja + ((fac-gun-tower-break-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 1000) + ) + +;; definition for symbol *fac-gun-tower-break-anim-idx*, type int +(define *fac-gun-tower-break-anim-idx* 0) + +;; definition for function fac-gun-tower-base-broken-init-by-other +;; INFO: Used lq/sq +(defbehavior fac-gun-tower-base-broken-init-by-other fac-gun-tower-base-broken ((arg0 vector) (arg1 quaternion)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 409600.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 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak bot player-list)) + (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 409600.0) + ) + (let ((v1-10 (new + 'process + 'collide-shape-prim-mesh + s4-0 + (the-as uint (if (zero? *fac-gun-tower-break-anim-idx*) + 0 + 1 + ) + ) + (the-as uint 0) + ) + ) + ) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 409600.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> self root) s4-0) + ) + (set! (-> self level) (level-get *level* 'factoryb)) + (cond + ((zero? *fac-gun-tower-break-anim-idx*) + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-north" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-north" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + ((= *fac-gun-tower-break-anim-idx* 1) + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-south" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-south" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + ((= *fac-gun-tower-break-anim-idx* 2) + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-east" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-east" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + (else + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-west" (the-as (pointer level) #f)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-fac-gun-tower-base-broken-west" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + ) + ) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (vector-identity! (-> self root scale)) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defstate idle (fac-gun-tower-base-broken) + :virtual #t + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post ja-post + ) + +;; definition for function fac-gun-tower-break-init-by-other +;; INFO: Used lq/sq +(defbehavior fac-gun-tower-break-init-by-other fac-gun-tower-break ((arg0 int) (arg1 vector) (arg2 quaternion)) + (let ((s3-1 (max 0 (+ (* *fac-gun-tower-break-anim-idx* 2) -1)))) + (cond + ((or (= arg0 3) (= arg0 1) (= arg0 2)) + (let ((s4-0 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-2 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-2 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-2 prim-core action) (collide-action solid)) + (set-vector! (-> s3-2 local-sphere) 0.0 0.0 0.0 0.0) + (set! (-> s4-0 root-prim) s3-2) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-13 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 0.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-16 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-16 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-16 prim-core collide-with)) + ) + (set! (-> self root) s4-0) + ) + ) + (else + (let ((s4-1 (new 'process 'collide-shape self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-1 penetrated-by) (penetrate)) + (let ((s2-0 (new 'process 'collide-shape-prim-group s4-1 (the-as uint 2) 0))) + (set! (-> s4-1 total-prims) (the-as uint 3)) + (set! (-> s2-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s2-0 prim-core action) (collide-action solid)) + (set-vector! (-> s2-0 local-sphere) 0.0 0.0 0.0 409600.0) + (set! (-> s4-1 root-prim) s2-0) + ) + (let ((v1-25 (new 'process 'collide-shape-prim-mesh s4-1 (the-as uint s3-1) (the-as uint 0)))) + (set! (-> v1-25 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-25 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-25 prim-core action) (collide-action solid)) + (set! (-> v1-25 transform-index) 0) + (set-vector! (-> v1-25 local-sphere) 0.0 0.0 0.0 409600.0) + ) + (let ((v1-27 (new + 'process + 'collide-shape-prim-mesh + s4-1 + (the-as uint (if (zero? s3-1) + 0 + (+ s3-1 1) + ) + ) + (the-as uint 0) + ) + ) + ) + (set! (-> v1-27 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-27 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-27 prim-core action) (collide-action solid)) + (set! (-> v1-27 transform-index) 0) + (set-vector! (-> v1-27 local-sphere) 0.0 0.0 0.0 409600.0) + ) + (set! (-> s4-1 nav-radius) (* 0.75 (-> s4-1 root-prim local-sphere w))) + (let ((v1-30 (-> s4-1 root-prim))) + (set! (-> s4-1 backup-collide-as) (-> v1-30 prim-core collide-as)) + (set! (-> s4-1 backup-collide-with) (-> v1-30 prim-core collide-with)) + ) + (set! (-> self root) s4-1) + ) + ) + ) + ) + (set! (-> self level) (level-get *level* 'factoryb)) + (let ((s4-2 (art-group-get-by-name *level* "skel-fac-gun-tower-break" (the-as (pointer level) #f)))) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower-break" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg1 quad)) + (quaternion-copy! (-> self root quat) arg2) + (vector-identity! (-> self root scale)) + (if s4-2 + (ja :group! (-> self draw art-group data 7) :num! min) + ) + ) + (go-virtual idle-stick) + ) + +;; failed to figure out what this is: +(defstate idle (fac-gun-tower-break) + :virtual #t + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate idle-stick (fac-gun-tower-break) + :virtual #t + :code (behavior () + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 2)) + (suspend) + ) + ) + ) + :post ja-post + ) + +;; definition for function start-destroyed-fac-gun-tower-base +(defun start-destroyed-fac-gun-tower-base ((arg0 vector) (arg1 quaternion) (arg2 process)) + (let ((s3-0 0)) + (if (< 819200.0 (-> arg0 x)) + (+! s3-0 1) + ) + (if (< 819200.0 (-> arg0 z)) + (+! s3-0 2) + ) + (format + #t + "destroyed xz pos ~M ~M - currently (task-node-close! (game-task-node factory-sky-battle-tower~d))~%" + (-> arg0 x) + (-> arg0 z) + (+ s3-0 1) + ) + (cond + ((zero? s3-0) + (task-node-close! (game-task-node factory-sky-battle-tower1) 'event) + ) + ((= s3-0 1) + (task-node-close! (game-task-node factory-sky-battle-tower2) 'event) + ) + ((= s3-0 2) + (task-node-close! (game-task-node factory-sky-battle-tower4) 'event) + ) + ((= s3-0 3) + (task-node-close! (game-task-node factory-sky-battle-tower3) 'event) + ) + ) + ) + (process-spawn fac-gun-tower-base-broken arg0 arg1 :name "fac-gun-tower-base-broken" :to arg2) + (let ((v0-8 (logand (+ *fac-gun-tower-break-anim-idx* 1) 3))) + (set! *fac-gun-tower-break-anim-idx* v0-8) + v0-8 + ) + ) + +;; definition for function start-destroyed-fac-gun-tower +;; WARN: Return type mismatch (pointer process) vs (pointer fac-gun-tower-break). +(defun start-destroyed-fac-gun-tower ((arg0 vector) (arg1 quaternion) (arg2 process)) + (process-spawn fac-gun-tower-break 3 arg0 arg1 :name "fac-gun-tower-break" :to arg2) + ) + +;; definition of type fac-gun-tower-base +(deftype fac-gun-tower-base (process-focusable) + () + (:state-methods + idle + explode + ) + ) + +;; definition for method 3 of type fac-gun-tower-base +(defmethod inspect ((this fac-gun-tower-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type fac-gun-tower-base +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this fac-gun-tower-base) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 102400.0 0.0 286720.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 163840.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 0) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 184320.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-12 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower-base" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw lod-set lod 0 dist) 14336000.0) + (set! (-> this draw lod-set lod 1 dist) 14336000.0) + (set! (-> this draw lod-set lod 2 dist) 14336000.0) + (logior! (-> this draw status) (draw-control-status no-draw)) + (quaternion-copy! (-> this root quat) (-> arg0 quat)) + (set! (-> this root trans quad) (-> arg0 extra trans quad)) + (go (method-of-object this idle)) + ) + +;; failed to figure out what this is: +(defstate explode (fac-gun-tower-base) + :virtual #t + :enter (behavior () + '() + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (fac-gun-tower-base) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (and (type? proc projectile) (not (type? proc warf-projectile))) + (let ((s4-0 (the-as projectile proc))) + (when (not (vector= *fac-tower-impact-pos* (-> s4-0 root trans))) + (set! (-> *fac-tower-impact-pos* quad) (-> s4-0 root trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (let ((s4-1 (the-as projectile (get-process *default-dead-pool* part-tracker-subsampler #x4000 0)))) + (when s4-1 + (let ((t9-4 (method-of-type part-tracker-subsampler activate))) + (t9-4 + (the-as part-tracker-subsampler s4-1) + *entity-pool* + "part-tracker-subsampler" + (the-as pointer #x70004000) + ) + ) + (let ((t9-5 run-function-in-process) + (a0-13 s4-1) + (a1-6 part-tracker-subsampler-init) + ) + (set! (-> *part-tracker-subsampler-params-default* group) (-> *part-group-id-table* 776)) + (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-13 a1-6 *part-tracker-subsampler-params-default*) + ) + (-> s4-1 ppointer) + ) + ) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> s4-0 root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ) + ) + (-> block param 1) + (when (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (and proc (= (-> proc type) fac-gun-tower)) + ) + (start-destroyed-fac-gun-tower-base (-> self root trans) (-> self root quat) (the-as process *entity-pool*)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-47 (-> self root root-prim))) + (set! (-> v1-47 prim-core collide-as) (collide-spec)) + (set! (-> v1-47 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((v0-0 (logior (-> self draw status) (draw-control-status no-draw)))) + (set! (-> self draw status) v0-0) + v0-0 + ) + ) + ) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! fac-gun-tower-base-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; definition of type gun-tower-base +(deftype gun-tower-base (fac-gun-tower-base) + () + ) + +;; definition for method 3 of type gun-tower-base +(defmethod inspect ((this gun-tower-base)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type fac-gun-tower-base inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type fac-gun-tower +(defmethod init-from-entity! ((this fac-gun-tower) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (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 enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 102400.0 0.0 245760.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 10) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 12288.0 16384.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set! (-> v1-9 transform-index) 3) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 245760.0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-11 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-11 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 8) + (set-vector! (-> v1-11 local-sphere) 0.0 0.0 0.0 40960.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-14 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-14 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-14 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-gun-tower" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw lod-set lod 0 dist) 14336000.0) + (set! (-> this draw lod-set lod 1 dist) 14336000.0) + (set! (-> this draw lod-set lod 2 dist) 14336000.0) + (set! (-> this yaw) 0.0) + (set! (-> this yawvel) 0.0) + (set! (-> this pitch) 16384.0) + (set! (-> this pitchvel) 0.0) + (set! (-> this dyaw) 0.0) + (set! (-> this dpitch) 0.0) + (set! (-> this invincable) #t) + (set! (-> this hit-points) 64.0) + (set-time! (-> this last-fire)) + (set! (-> this gun-idx) 0) + (let* ((v1-32 *game-info*) + (a0-29 (+ (-> v1-32 attack-id) 1)) + ) + (set! (-> v1-32 attack-id) a0-29) + (set! (-> this attack-id) (the-as int a0-29)) + ) + (set! (-> this gunrot) 8) + (set! (-> this muzzle) 9) + (set! (-> this blade-sound) (new-sound-id)) + (set! (-> this blade-sound-playing) #f) + (set! (-> this rotate-sound) (new-sound-id)) + (set! (-> this rotate-sound-playing) #f) + (set-time! (-> this snd-cmd-time)) + (set! (-> this gun-tilt-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this (-> this gunrot))) + (quaternion-identity! (-> this root quat)) + (go (method-of-object this idle)) + ) + +;; definition for method 10 of type fac-gun-tower +(defmethod deactivate ((this fac-gun-tower)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this rotate-sound-playing) + (sound-stop (-> this rotate-sound)) + ) + (if (-> this blade-sound-playing) + (sound-stop (-> this blade-sound)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 7 of type fac-gun-tower +(defmethod relocate ((this fac-gun-tower) (offset int)) + (if (nonzero? (-> this gun-tilt-jm)) + (&+! (-> this gun-tilt-jm) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 20 of type fac-gun-tower +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this fac-gun-tower)) + (let ((v0-0 0)) + (if (and (-> this next-state) (= (-> this next-state name) 'open)) + (set! v0-0 (logior v0-0 40)) + ) + (the-as search-info-flag v0-0) + ) + ) + +;; definition for method 21 of type fac-gun-tower +(defmethod get-trans ((this fac-gun-tower) (arg0 int)) + "Get the `trans` for this process." + (let ((v1-0 (-> this root))) + (cond + ((= arg0 3) + (let ((a2-1 (-> this node-list data 10 bone transform)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! gp-0 0.0 0.0 0.0 1.0) + (vector-matrix*! gp-0 gp-0 a2-1) + (set! (-> gp-0 w) 8192.0) + gp-0 + ) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + +;; definition for method 35 of type fac-gun-tower +;; INFO: Used lq/sq +(defmethod fire-shot ((this fac-gun-tower)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (let ((s2-0 (-> this node-list data 10 bone transform)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a2-0 (-> this node-list data (-> this gunrot) bone transform))) + (set-vector! s5-0 0.0 0.0 40960.0 1.0) + (vector-matrix*! s5-0 s5-0 a2-0) + ) + (set! (-> s3-0 quad) (-> s2-0 fvec quad)) + (set! (-> s3-0 y) 0.0) + (vector-normalize! (the-as vector s3-0) 1.0) + (vector-rotate-around-axis! (the-as vector s3-0) s3-0 (-> this pitch) (-> s2-0 rvec)) + (let ((a0-11 s4-0)) + (let ((v1-11 s5-0)) + (let ((a1-5 409600.0)) + (.mov vf7 a1-5) + ) + (.lvf vf5 (&-> s3-0 quad)) + (.lvf vf4 (&-> v1-11 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-11 quad) vf6) + ) + ) + (let ((s3-1 (new 'stack-no-clear 'vector)) + (a1-6 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-6 from) (process->ppointer pp)) + (set! (-> a1-6 num-params) 0) + (set! (-> a1-6 message) 'get-vehicle) + (let ((a0-14 (the-as vehicle (send-event-function *target* a1-6)))) + (when a0-14 + (vector-float*! s3-1 (-> a0-14 rbody lin-velocity) 0.0) + (vector+! s4-0 s4-0 s3-1) + ) + ) + ) + (spawn-fac-gun-tower-projectile this s5-0 s4-0 1638400.0) + ) + ) + ) + ) + ) + +;; definition for method 37 of type fac-gun-tower +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod send-attack ((this fac-gun-tower) (arg0 process-focusable)) + (let* ((a0-2 (get-trans arg0 3)) + (v1-2 (vector-! (new 'stack-no-clear 'vector) a0-2 (-> this root trans))) + ) + (if (< (vector-length v1-2) 409600.0) + (send-event + arg0 + 'attack + #f + (static-attack-info :mask (vehicle-impulse-factor) ((id (the-as uint (-> this attack-id))) + (damage 128.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'explode) + (attacker-velocity v1-2) + (penetrate-using (penetrate explode enemy-yellow-shot)) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 36 of type fac-gun-tower +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fac-gun-tower-method-36 ((this fac-gun-tower)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (set! (-> s5-0 w) 409600.0) + (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) + (let* ((s2-0 (-> s4-0 s3-0)) + (v1-5 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when v1-5 + (let* ((s1-0 (-> v1-5 process)) + (s2-1 (if (type? s1-0 process-focusable) + s1-0 + ) + ) + ) + (when s2-1 + (if (and (!= *target* s2-1) + (!= this s2-1) + (not (focus-test? (the-as process-focusable s2-1) disable dead inactive)) + (type? s2-1 fac-gun-tower-base) + ) + (send-attack this (the-as process-focusable s2-1)) + ) + ) + ) + ) + ) + ) + ) + (let* ((s3-1 *target*) + (s4-1 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) s5-0) (-> s5-0 w))) + (if (and (!= *target* s4-1) + (!= this s4-1) + (not (focus-test? s4-1 disable dead inactive)) + (type? s4-1 fac-gun-tower-base) + ) + (send-attack this s4-1) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function fac-gun-tower-standard-event-handler +;; INFO: Used lq/sq +(defbehavior fac-gun-tower-standard-event-handler fac-gun-tower ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (let ((gp-0 (the-as object (-> arg3 param 1))) + (a2-1 (the-as object (-> arg3 param 0))) + ) + 0.0 + (let ((f30-0 (if (logtest? (attack-mask damage) (-> (the-as attack-info gp-0) mask)) + (-> (the-as attack-info gp-0) damage) + 0.0 + ) + ) + ) + (when (and (the-as touching-shapes-entry a2-1) (not (-> self invincable))) + (let ((a0-3 (-> (the-as touching-shapes-entry a2-1) head))) + (when a0-3 + (let ((a0-4 (get-touched-prim a0-3 (-> self root) (the-as touching-shapes-entry a2-1)))) + 0 + (when a0-4 + (case (-> a0-4 prim-id) + ((1) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f30-0))) + (set-time! (-> self last-hit-time)) + ) + ) + ) + ) + ) + ) + ) + (when (and (>= f30-0 128.0) (not (-> self invincable))) + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (-> self node-list data 10 bone transform)) + ) + (set-vector! s5-0 0.0 0.0 -32768.0 1.0) + (vector-matrix*! s5-0 s5-0 s3-0) + (vector-! s4-0 (the-as vector (+ (the-as uint gp-0) 0)) s5-0) + (vector-normalize! s4-0 1.0) + (when (or (< 0.0 (vector-dot s4-0 (-> s3-0 fvec))) + (< (vector-vector-distance s5-0 (the-as vector (+ (the-as uint gp-0) 0))) 36864.0) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f30-0))) + (set-time! (-> self last-hit-time)) + ) + ) + ) + ) + ) + (when (>= 0.0 (-> self hit-points)) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (activate! *camera-smush-control* 3276.8 60 390 0.9 0.9 (-> self clock)) + (start-destroyed-fac-gun-tower (-> self root trans) (-> self root quat) (the-as process *entity-pool*)) + (cond + ((logtest? (-> *part-group-id-table* 731 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 731)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 731)) + ) + ) + (fac-gun-tower-method-36 self) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-78 (-> self root root-prim))) + (set! (-> v1-78 prim-core collide-as) (collide-spec)) + (set! (-> v1-78 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "tower-explode") + (cleanup-for-death self) + (go-virtual die-fast) + ) + ) + ) + ) + +;; definition for method 33 of type fac-gun-tower +;; WARN: Return type mismatch time-frame vs none. +(defmethod fac-gun-tower-method-33 ((this fac-gun-tower)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (+! (-> this yaw) (* (-> this yawvel) (seconds-per-frame))) + (if (< 65536.0 (-> this yaw)) + (+! (-> this yaw) -65536.0) + ) + (matrix-rotate-y! s5-0 (-> this yaw)) + (matrix->quaternion (-> this root quat) s5-0) + ) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this pitch)) + (when (time-elapsed? (-> this snd-cmd-time) (seconds 0.2)) + (sound-play-by-name + (static-sound-name "gtower-openloop") + (-> this rotate-sound) + 1024 + (the int (* 1524.0 (+ 1.0 (* 0.00001 (-> this yawvel))))) + 0 + (sound-group) + (-> this root trans) + ) + (sound-play-by-name + (static-sound-name "gtower-blade") + (-> this blade-sound) + (the int (* 1024.0 (fmax 0.0 (fmin 0.5 (* 0.00001 (-> this yawvel)))))) + (the int (* 1524.0 (+ 1.3 (* 0.00001 (-> this yawvel))))) + 0 + (sound-group) + (-> this root trans) + ) + (set-time! (-> this snd-cmd-time)) + ) + (none) + ) + +;; definition for function fac-deg-delta +(defun fac-deg-delta ((arg0 float) (arg1 float)) + (the float (sar (- (shl (the int arg0) 48) (shl (the int arg1) 48)) 48)) + ) + +;; definition for method 34 of type fac-gun-tower +;; INFO: Used lq/sq +;; WARN: Return type mismatch quaternion vs none. +(defmethod fac-gun-tower-method-34 ((this fac-gun-tower)) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'matrix)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + 0.0 + 0.0 + 0.0 + 0.0 + (let ((s3-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 8))) + (s2-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s2-0 quad) (-> (get-trans *target* 3) quad)) + (vector-! s4-0 s3-0 s2-0) + ) + (vector-negate! s4-0 s4-0) + (let ((f30-0 (vector-length s4-0))) + (let* ((f0-7 (atan (-> s4-0 x) (-> s4-0 z))) + (f0-9 (fac-deg-delta f0-7 (-> this yaw))) + (f1-1 (- f0-9 (-> this dyaw))) + ) + (set! (-> this dyaw) f0-9) + (let ((f1-3 (+ (* 160.0 f1-1) (* 10.0 f0-9)))) + (+! (-> this yawvel) (* f1-3 (seconds-per-frame))) + ) + ) + (let* ((f0-19 (- (atan (-> s4-0 y) (sqrtf (+ (* (-> s4-0 x) (-> s4-0 x)) (* (-> s4-0 z) (-> s4-0 z))))))) + (f0-21 (fac-deg-delta f0-19 (-> this pitch))) + (f1-9 (- f0-21 (-> this dpitch))) + ) + (set! (-> this dpitch) f0-21) + (let ((f1-11 (+ (* 160.0 f1-9) (* 10.0 f0-21)))) + (+! (-> this pitchvel) (* f1-11 (seconds-per-frame))) + ) + ) + (matrix-rotate-y! s5-0 (-> this yaw)) + (matrix->quaternion (-> this root quat) s5-0) + (when (and (time-elapsed? (-> this last-fire) (seconds 2)) + (and (< f30-0 409600.0) (< 204800.0 f30-0)) + (not (focus-test? *target* dead)) + (not (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + ) + ) + (set-time! (-> this last-fire)) + (fire-shot this) + ) + ) + ) + ) + (+! (-> this yaw) (* (-> this yawvel) (seconds-per-frame))) + (+! (-> this pitch) (* (-> this pitchvel) (seconds-per-frame))) + (set! (-> this pitch) (fmax -10922.667 (fmin 6371.5557 (-> this pitch)))) + (quaternion-axis-angle! (-> this gun-tilt-jm quat) 1.0 0.0 0.0 (-> this pitch)) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (fac-gun-tower) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (and (type? proc projectile) (not (type? proc warf-projectile))) + (when (not (vector= *fac-tower-impact-pos* (-> (the-as projectile proc) root trans))) + (set! (-> *fac-tower-impact-pos* quad) (-> (the-as projectile proc) root trans quad)) + (cond + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> (the-as projectile proc) root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ) + ) + (('trigger) + (if (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 1024000.0) + (< 716800.0 (vector-vector-xz-distance (target-pos 0) (-> self root trans))) + ) + (go-virtual open) + ) + ) + ) + ) + :enter (behavior () + (ja :group! fac-gun-tower-idle-ja :num! min) + (set-time! (-> self state-time)) + (set! (-> self pitch) 16384.0) + (quaternion-axis-angle! (-> self gun-tilt-jm quat) 1.0 0.0 0.0 (-> self pitch)) + (transform-post) + ) + :trans (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate open (fac-gun-tower) + :virtual #t + :event fac-gun-tower-standard-event-handler + :enter (behavior () + (ja :group! fac-gun-tower-dooropen-ja :num! min) + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 149) (the-as int #f) (the-as vector #t) 0)) + (sound-play "gtower-open") + (sound-play "gtower-openloop" :id (-> self rotate-sound) :position (-> self root trans)) + (set! (-> self rotate-sound-playing) #t) + (sound-play "gtower-blade" :id (-> self blade-sound) :position (-> self root trans)) + (set! (-> self blade-sound-playing) #t) + ) + :trans (behavior () + '() + ) + :code (behavior () + (while (< (-> self yawvel) 131072.0) + (seek! (-> self yawvel) 131072.0 (* 65536.0 (seconds-per-frame))) + (ja :num-func num-func-identity :frame-num 0.0) + (fac-gun-tower-method-33 self) + ) + (while (< 3276.8 (-> self yawvel)) + (seek! (-> self yawvel) 3276.8 (* 21845.334 (seconds-per-frame))) + (ja :num! (seek!)) + (seek! (-> self pitch) 0.0 (* 8192.0 (seconds-per-frame))) + (fac-gun-tower-method-33 self) + (suspend) + ) + (set! (-> self invincable) #f) + (when (-> self rotate-sound-playing) + (sound-stop (-> self rotate-sound)) + (set! (-> self rotate-sound-playing) #f) + ) + (when (-> self blade-sound-playing) + (sound-stop (-> self blade-sound)) + (set! (-> self blade-sound-playing) #f) + ) + (sound-play "gtower-open-end") + (until #f + (fac-gun-tower-method-34 self) + (ja :num! (seek!)) + (suspend) + ) + #f + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate die-fast (fac-gun-tower) + :virtual #t + :code nothing + ) + +;; failed to figure out what this is: +(defstate die (fac-gun-tower) + :virtual #t + :enter (behavior () + (ja :group! fac-gun-tower-dooropen-ja :num! max) + (set-time! (-> self state-time)) + ) + :trans (behavior () + '() + ) + :code (behavior () + (while (< (-> self yawvel) 131072.0) + (seek! (-> self yawvel) 131072.0 (* 65536.0 (seconds-per-frame))) + (ja :num-func num-func-identity :frame-num 0.0) + (fac-gun-tower-method-33 self) + ) + ) + :post transform-post + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-part_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-part_REF.gc new file mode 100644 index 0000000000..55258f9311 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-part_REF.gc @@ -0,0 +1,1318 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-shot-trail + :id 1359 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4530 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 4531 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 4531 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -0.8) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4530 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 32.0 32.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.2) + (:fade-g -1.6) + (:fade-b -3.2) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.135)) + (:next-launcher 4532) + ) + ) + +;; failed to figure out what this is: +(defpart 4532 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668 -0.42666668)) + ) + +;; failed to figure out what this is: +(defpart 4533 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1.2) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.2) + (:fade-g -1.6) + (:fade-b -3.2) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.135)) + (:next-launcher 4534) + ) + ) + +;; failed to figure out what this is: +(defpart 4534 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.42666668 -0.42666668)) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-shot-explosion + :id 1360 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4535 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4536 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4537 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4538 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4539 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 4537 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4535 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 4536 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4538 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4539 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.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-factory-boss-shot-explo-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-factory-boss-shot-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-factory-boss-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4539 init-specs 16 initial-valuef) + (the-as float *part-factory-boss-shot-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* color-start) + *range-factory-boss-shot-explo-color* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* alpha-start) + *range-factory-boss-shot-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-x-start) + *range-factory-boss-shot-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-y-start) + *range-factory-boss-shot-explo-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* a-scalar) + *curve-factory-boss-shot-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-x-scalar) + *curve-factory-boss-shot-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-shot-explosion-texture-curve-settings* scale-y-scalar) + *curve-factory-boss-shot-explo-scale-y* + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-damaged-high-smoke + :id 1361 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4540 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4540 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3) + (:x (meters 0) (meters 1.5)) + (:scale-x (meters 2) (meters 2)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0) (meters 0.0033333334)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64 0.64) + (:accel-y (meters 0.00033333333) (meters 0.00066666666)) + (:friction 0.95 0.03) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.335)) + (:next-launcher 4541) + (:conerot-x (degrees 80) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4541 + :init-specs ((:fade-a -0.256 -0.256)) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-damaged-low-smoke + :id 1362 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4542 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4542 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 0.3) + (:x (meters -1) (meters 2)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:scale-x (meters 1) (meters 1)) + (:scale-y :copy scale-x) + (:r 16.0 32.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:vel-y (meters 0.033333335)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a 1.28) + (:accel-y (meters 0.00016666666) (meters 0.00033333333)) + (:friction 0.97 0.01) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.335)) + (:next-launcher 4543) + (:conerot-x (degrees 60)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4543 + :init-specs ((:fade-a -0.11636364 -0.11636364)) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-ring1 + :id 1363 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4544 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4544 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.38)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-ring2 + :id 1364 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4545 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4545 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.38)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 1.0) + (:b 1.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-ring3 + :id 1365 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4546 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4546 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.45)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 128.0) + (:b 1.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-ring4 + :id 1366 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4547 :flags (is-3d sp6 sp7))) + ) + +;; failed to figure out what this is: +(defpart 4547 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:y (meters -0.1)) + (:z (meters 0.38)) + (:scale-x (meters 8)) + (:rot-x (degrees 90)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 1.0) + (:b 128.0) + (:a 64.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-machine-explosion + :id 1367 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4548 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4549 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4550 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4551 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4552 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 4550 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4548 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 4549 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4551 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4552 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.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-factory-boss-shot-explo-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-factory-boss-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-factory-boss-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-factory-boss-machine-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-factory-boss-machine-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4552 init-specs 16 initial-valuef) + (the-as float *part-factory-boss-machine-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* color-start) + *range-factory-boss-shot-explo-color* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* alpha-start) + *range-factory-boss-shot-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-x-start) + *range-factory-boss-shot-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-y-start) + *range-factory-boss-shot-explo-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* a-scalar) + *curve-factory-boss-shot-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-x-scalar) + *curve-factory-boss-shot-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-factory-boss-machine-explosion-texture-curve-settings* scale-y-scalar) + *curve-factory-boss-shot-explo-scale-y* + ) + +;; failed to figure out what this is: +(defpartgroup group-missile-bot-fizzle + :id 1368 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4553 :flags (sp7)) (sp-item 4553 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4554 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:x (meters -0.5) (meters 1.5)) + (:scale-x (meters 4) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 4) (meters 3)) + (:r 64.0) + (:g 128.0 64.0) + (:b 196.0 64.0) + (:a 16.0 32.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.08 -0.16) + (:friction 0.95 0.03) + (:timer (seconds 2.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-missile-bot-spark + :id 1369 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4555 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4556 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 0.05)) + (:rot-x (degrees 0.675)) + (:scale-y :copy scale-x) + (:r 64.0 32.0) + (:g 255.0) + (:b 0.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 1228.8) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4557 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 1) (meters 0.05)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 16.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-missile-bot-thruster + :id 1370 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4558 :fade-after (meters 120) :falloff-to (meters 120) :flags (is-3d sp7)) + (sp-item 4559 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + (sp-item 4560 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + (sp-item 4561 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7)) + (sp-item 4562 :fade-after (meters 80) :falloff-to (meters 80) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4558 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 1.0) + (:z (meters 0.5)) + (:scale-x (meters 0.5) (meters 0.1)) + (:scale-y (meters 1) (meters 0.1)) + (:r 96.0 32.0) + (:g 0.0 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4559 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 0.2)) + (:scale-x (meters 1) (meters 0.05)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 32.0 32.0) + (:b 0.0) + (:a 8.0 8.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4560 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.0 1.0) + (:y (meters 0) (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 1) (meters 0.6)) + (:r 255.0) + (:g 64.0) + (:b 0.0) + (:a 16.0 16.0) + (:vel-y (meters 0.06666667) (meters 0.016666668)) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:scalevel-y (meters 0.016666668) (meters 0.033333335)) + (:fade-r -1.28 -1.28) + (:fade-g 1.0) + (:fade-b 2.0) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.94) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:next-time (seconds 0.167)) + (:next-launcher 4563) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4563 + :init-specs ((:r 64.0 128.0) (:g :copy r) (:b :copy g) (:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.128 -0.256)) + ) + +;; failed to figure out what this is: +(defpart 4561 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1 0.1) + (:y (meters 0.25) (meters 0.5)) + (:scale-x (meters 0.05)) + (:scale-y (meters 0.5)) + (:r 192.0 64.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.026666667)) + (:scalevel-x (meters 0.001)) + (:scalevel-y (meters -0.017)) + (:fade-g 0.0) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters -0.00016666666) (meters -0.0005)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.1)) + (:next-launcher 4564) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4564 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0))) + ) + +;; failed to figure out what this is: +(defpart 4562 + :init-specs ((:num 0.6) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-y (meters 0.06666667) (meters 0.016666668)) + (:fade-r 32.768) + (:fade-g 26.623999) + (:fade-b 28.671999) + (:accel-x (meters 0) (meters 0.0016666667)) + (:friction 0.94) + (:timer (seconds 0.335)) + (:flags (distort)) + (:next-time (seconds 0.167)) + (:next-launcher 4565) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4565 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096)) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-bomb-reticle + :id 1371 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4566 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4566 + :init-specs ((:texture (errolbomb-target-reg-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-bomb-corner + :id 1372 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4567 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4567 + :init-specs ((:texture (errolbomb-target-reg-corner-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 1.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-bomb-dot + :id 1373 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4568 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4568 + :init-specs ((:texture (errolbomb-target-dot-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-bomb-arrow + :id 1374 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4569 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4569 + :init-specs ((:texture (errolbomb-target-indicator-arrow-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 1.2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-superbomb-reticle + :id 1375 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4570 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4570 + :init-specs ((:texture (errolbomb-target-supr-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-superbomb-ring + :id 1376 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 3) + :parts ((sp-item 4571 :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4571 + :init-specs ((:texture (errolbomb-target-supr-ring-01 factoryd-sprite)) + (:num 1.0) + (:y (meters 0.5)) + (:scale-x (meters 3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-boss-launch-critter + :id 1377 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4572 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4573 :flags (sp7) :period (seconds 2) :length (seconds 0.017)) + (sp-item 4574 :flags (sp6) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 4572 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 16.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.10666667)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4573 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 48.0) + (:scale-x (meters 1.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.10666667 -0.10666667) + (:friction 0.95) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:conerot-x (degrees 70) (degrees 40)) + (:conerot-y (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4574 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 45)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 100.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 9011.25)) + (:scalevel-x (meters 0.53333336)) + (:scalevel-y :copy scalevel-x) + (:fade-a -6.4) + (:timer (seconds 0.15)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-facboss-sparks + :id 1378 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 4555 :flags (sp7)) (sp-item 4553 :flags (sp7)) (sp-item 4553 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4555 + :init-specs ((:texture (middot level-default-sprite)) + (:num 0.0 1.0) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 255.0) + (:omega (degrees 0.0675)) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:fade-r -0.10666667) + (:fade-g -0.10666667) + (:fade-a -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.94 0.04) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z left-multiply-quat)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees 0) (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4553 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.1) + (:x (meters -2) (meters 4)) + (:y (meters -2) (meters 4)) + (:z (meters 1)) + (:scale-x (meters 1) (meters 3)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b 255.0) + (:a -512.0 5 128.0) + (:scalevel-x (meters -0.1)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 40960.0) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-scenes_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-scenes_REF.gc new file mode 100644 index 0000000000..0d3290f490 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-scenes_REF.gc @@ -0,0 +1,2204 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-fac-fma-breaking-bits fac-fma-breaking-bits fac-fma-breaking-bits-lod0-jg fac-fma-breaking-bits-idle-ja + ((fac-fma-breaking-bits-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 50) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-eco-crystal-light-fma eco-crystal-light eco-crystal-light-lod0-jg eco-crystal-light-idle-ja + ((eco-crystal-light-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-drop-plat-fma fac-drop-plat fac-drop-plat-lod0-jg fac-drop-plat-idle-ja + ((fac-drop-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 40) (new 'static 'lightning-spec + :name "warp-gate-lightning-shock-small" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x40 :g #x10 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x8f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8601.6 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-boss-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-204" + :art-group "scenecamera" + :anim "factory-boss-res" + :parts 11 + :command-list '((0 + (send-event "factory-boss-1" 'complete) + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryd) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (setting-reset borrow mode '((factorya 1 lfacrm2 special))) + (kill "fac-drop-plat-21") + (kill "fac-drop-plat-30") + (kill "fac-drop-plat-32") + (kill "fac-drop-plat-45") + (kill "fac-drop-plat-57") + (kill "fac-drop-plat-58") + (kill "fac-drop-plat-62") + (kill "fac-drop-plat-64") + (kill "fac-drop-plat-77") + (kill "fac-drop-plat-78") + (kill "fac-drop-plat-79") + (kill "fac-drop-plat-90") + (kill "fac-drop-plat-92") + (kill "fac-drop-plat-102") + (kill "fac-drop-plat-104") + (kill "fac-drop-plat-108") + (kill "fac-drop-plat-133") + (kill "fac-drop-plat-137") + (kill "fac-drop-plat-145") + (kill "fac-drop-plat-148") + (kill "fac-drop-plat-156") + (kill "fac-drop-plat-159") + (kill "fac-drop-plat-162") + (kill "fac-drop-plat-166") + (kill "fac-drop-plat-178") + (kill "fac-drop-plat-179") + (kill "fac-drop-plat-185") + (kill "fac-drop-plat-190") + (kill "fac-drop-plat-212") + (kill "fac-drop-plat-216") + (kill "fac-drop-plat-218") + (kill "fac-drop-plat-219") + (kill "fac-drop-plat-226") + (kill "fac-drop-plat-227") + (kill "fac-drop-plat-241") + (kill "fac-drop-plat-255") + (kill "fac-drop-plat-258") + ) + (81 (part-tracker + "group-fac-boss-missile-explosion" + entity + "particleman" + joint + "particleA" + track + #f + duration + (frame-range 81 111) + ) + ) + (132 (part-tracker + "group-placeholder-small" + entity + "light-eco-crystal" + joint + "main" + track + #t + duration + (frame-range 132 133) + ) + ) + (133 (part-tracker + "group-placeholder-small" + entity + "light-eco-crystal" + joint + "main" + track + #t + duration + (frame-range 133 134) + ) + ) + (143 (part-tracker + "group-placeholder-small" + entity + "light-eco-crystal" + joint + "main" + track + #t + duration + (frame-range 143 144) + ) + ) + (279 + (part-tracker + "group-enter-dark-warpgate" + entity + "particleman" + joint + "particleW" + track + #f + duration + (frame-range 279 295) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleT" + duration + (frame-range 279 300) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleU" + duration + (frame-range 279 320) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleV" + duration + (frame-range 279 305) + ) + ) + (304 (part-tracker + "group-factory-daxter-impact-dust" + entity + "sidekick-highres" + joint + "Rball" + track + #f + duration + (frame-range 304 305) + ) + ) + (388 + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 388 422) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleP" + track + #t + duration + (frame-range 388 422) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleQ" + track + #t + duration + (frame-range 388 422) + ) + ) + (399 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-time-30 10) + ) + ) + (400 + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "a" + track + #t + duration + (frame-range 400 655) + ) + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "b" + track + #t + duration + (frame-range 400 655) + ) + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "c" + track + #t + duration + (frame-range 400 655) + ) + (part-tracker + "group-factory-debris-trails" + entity + "fac-fma-breaking-bits" + joint + "d" + track + #t + duration + (frame-range 400 655) + ) + ) + (401 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleF" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleK" + track + #f + duration + (frame-time-30 10) + ) + ) + (402 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleH" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleI" + track + #f + duration + (frame-time-30 10) + ) + ) + (403 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleG" + track + #f + duration + (frame-time-30 10) + ) + ) + (438 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-time-30 10) + ) + ) + (440 + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 440 475) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleP" + track + #t + duration + (frame-range 388 422) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleQ" + track + #t + duration + (frame-range 388 422) + ) + ) + (446 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-time-30 10) + ) + ) + (448 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleK" + track + #f + duration + (frame-time-30 10) + ) + ) + (457 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-time-30 10) + ) + ) + (476 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleR" + track + #f + duration + (frame-time-30 10) + ) + ) + (487 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-time-30 10) + ) + ) + (489 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleG" + track + #f + duration + (frame-time-30 10) + ) + ) + (490 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleF" + track + #f + duration + (frame-time-30 10) + ) + ) + (514 (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleR" + track + #t + duration + (frame-range 514 534) + ) + ) + (520 + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleO" + track + #t + duration + (frame-range 520 547) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleP" + track + #t + duration + (frame-range 520 547) + ) + (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleQ" + track + #t + duration + (frame-range 520 547) + ) + ) + (526 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-range 526 527) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleH" + track + #f + duration + (frame-time-30 10) + ) + ) + (533 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleB" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleI" + track + #f + duration + (frame-time-30 10) + ) + ) + (534 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-time-30 10) + ) + ) + (550 (part-tracker + "group-factory-daxter-impact-dust" + entity + "jakc-highres" + joint + "Lball" + track + #f + duration + (frame-range 550 551) + ) + ) + (559 (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleS" + track + #t + duration + (frame-range 559 577) + ) + ) + (567 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleE" + track + #f + duration + (frame-time-30 10) + ) + ) + (568 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleC" + track + #f + duration + (frame-time-30 10) + ) + ) + (578 (part-tracker + "group-factory-debris-trails" + entity + "particleman" + joint + "particleS" + track + #t + duration + (frame-range 578 605) + ) + ) + (586 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleF" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleL" + track + #t + duration + (frame-range 586 587) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleM" + track + #t + duration + (frame-range 586 587) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleN" + track + #t + duration + (frame-range 586 587) + ) + ) + (587 (part-tracker + "group-factory-daxter-impact-dust" + entity + "jakc-highres" + joint + "Lball" + track + #f + duration + (frame-range 587 588) + ) + ) + (588 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleG" + track + #f + duration + (frame-time-30 10) + ) + ) + (589 (part-tracker + "group-factory-debris-impact" + entity + "light-eco-crystal" + joint + "main" + track + #f + duration + (frame-time-30 10) + ) + ) + (600 + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleD" + track + #f + duration + (frame-time-30 10) + ) + (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleJ" + track + #f + duration + (frame-time-30 10) + ) + ) + (601 (part-tracker + "group-factory-debris-impact" + entity + "particleman" + joint + "particleI" + track + #t + duration + (frame-time-30 10) + ) + ) + (648 + (part-tracker + "group-enter-dark-warpgate" + entity + "particleman" + joint + "particleW" + track + #f + duration + (frame-range 648 670) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleT" + duration + (frame-range 648 689) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleU" + duration + (frame-range 648 674) + ) + (lightning-tracker + "warp-gate-lightning-shock-small" + from-entity + "particleman" + to-entity + "particleman" + from-joint + "particleW" + to-joint + "particleV" + duration + (frame-range 648 692) + ) + ) + (send-event self 'user-data-set! (task-closed? "factory-boss-resolution")) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-boss-resolution") + ) + ) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'factorya + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '((239 243)) + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "errol" + :level 'factorya + :art-group "skel-errol" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-fma-breaking-bits" + :level 'factorya + :art-group "skel-fac-fma-breaking-bits" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "a-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "b-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "g-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "i-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "l-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "m-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "n-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "o-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "p-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "r-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "s-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "t-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "u-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "v-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "x-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "y-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "z-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "aa-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ab-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ac-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ad-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ae-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ai-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "ak-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "al-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "am-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "fac-drop-plat-fma" + :level 'factoryd + :art-group "skel-fac-drop-plat-fma" + :prefix "an-" + :draw-frames '((120 max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #x11 + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "eco-crystal-light-fma" + :level 'factoryd + :art-group "skel-eco-crystal-light-fma" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factoryd-res-fma" + :end-point "freehq-post-boss" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe7 + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete '(unless (send-event self 'user-data) (talker-spawn "powup026")) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-boss-missile-explosion + :id 1379 + :duration (seconds 5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4575 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4576 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4577 :period (seconds 30) :length (seconds 0.035)) + (sp-item 4578 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 4579 :period (seconds 30) :length (seconds 0.167)) + (sp-item 4580 :period (seconds 30) :length (seconds 0.5)) + ) + ) + +;; failed to figure out what this is: +(defpart 4575 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 40960.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4576 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 30.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4577 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 30.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 1.0) + (:g 1.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.05)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-13 sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 70.0 :y 70.0 :z 70.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + (new 'static 'vector :x 40.0 :y 40.0 :z 40.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 80.0 :y 64.0 :z 65.0 :w 66.0) + :one-over-x-deltas (new 'static 'vector :x -16.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 8.0 :y 10.0 :z 11.0 :w 12.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fbme-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.7 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.4285715 :y -3.3333333 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fbme-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fbme-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -1.0 :w -2.0) + :ys (new 'static 'vector :x 0.2 :y 0.8 :z 1.2 :w 2.2) + :one-over-x-deltas (new 'static 'vector :x 1.2 :y 0.8000001 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-boss-missile-explosion-dust-in-curve-settings*, type particle-curve-settings +(define *part-fac-boss-missile-explosion-dust-in-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1) + :lifetime-offset (seconds 2) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4577 init-specs 14 initial-valuef) + (the-as float *part-fac-boss-missile-explosion-dust-in-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* color-start) *range-fbme-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* alpha-start) *range-fbme-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-x-start) *range-fbme-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-y-start) *range-fbme-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* a-scalar) *curve-fbme-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-x-scalar) *curve-fbme-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-dust-in-curve-settings* scale-y-scalar) *curve-fbme-dust-scale-y*) + +;; failed to figure out what this is: +(defpart 4579 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 3) (meters 2)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4580 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 8.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.033333335)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fbme-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 3.0 :y 5.0 :z 6.0 :w 7.0) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fbme-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fbme-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fbme-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fac-boss-missile-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-fac-boss-missile-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 4580 init-specs 16 initial-valuef) + (the-as float *part-fac-boss-missile-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* color-start) *range-fbme-color*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* alpha-start) *range-fbme-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-x-start) *range-fbme-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-y-start) *range-fbme-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* a-scalar) *curve-fbme-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-x-scalar) *curve-fbme-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-fac-boss-missile-explosion-texture-curve-settings* scale-y-scalar) *curve-fbme-scale-y*) + +;; failed to figure out what this is: +(defpart 4578 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-enter-dark-warpgate + :id 1380 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 4581 :flags (sp3)) + (sp-item 4582 :flags (sp3)) + (sp-item 4583 :period (seconds 2) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 4581 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.16666667)) + (:scalevel-y (meters 0.26666668)) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4582 + :init-specs ((:texture (rainbow-halo level-default-sprite)) + (:num 1.0) + (:scale-x (meters 10)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters 0.06666667)) + (:scalevel-y (meters 0.13333334)) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 4583 + :init-specs ((:texture (middot level-default-sprite)) + (:num 10.0) + (:scale-x (meters 0.1) (meters 0.1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.01125)) + (:vel-z (meters 0.13333334) (meters 0.016666668)) + (:scalevel-x (meters -0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.42666668) + (:fade-g -0.21333334 -0.21333334) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -30) (degrees 60)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-errol-jetpack-l + :id 1381 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4584 :flags (is-3d sp7)) (sp-item 4585 :flags (sp6 sp7)) (sp-item 4586 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4584 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 6.0) + (:x (meters 0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-x (degrees 60)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 1) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 30.0 30.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4585 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters 0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 80.0 2.0) + (:fade-a -0.12) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4586 + :init-specs ((:num 1.0) + (:x (meters 0.2)) + (:rot-x 8) + (:r 4096.0) + (:g 2048.0) + (:b 1638.4) + (:vel-y (meters 0.33333334)) + (:fade-b 1.3653333) + (:accel-y (meters -0.00066666666)) + (:friction 0.8) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (distort)) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-errol-jetpack-r + :id 1382 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 4587 :flags (is-3d sp7)) (sp-item 4588 :flags (sp6 sp7)) (sp-item 4589 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4587 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:num 6.0) + (:x (meters -0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 0.4) (meters 0.2)) + (:rot-x (degrees 60)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 1) (meters 0.5)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 30.0 30.0) + (:fade-a -0.6) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4588 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:x (meters -0.2)) + (:y (meters 0.3)) + (:z (meters 0.5)) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 100.0) + (:b 0.0) + (:a 80.0 2.0) + (:fade-a -0.12) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4589 + :init-specs ((:num 1.0) + (:x (meters -0.2)) + (:rot-x 8) + (:r 4096.0) + (:g 2048.0) + (:b 1638.4) + (:vel-y (meters 0.33333334)) + (:fade-b 1.3653333) + (:accel-y (meters -0.00066666666)) + (:friction 0.8) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (distort)) + (:conerot-x (degrees 0) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-daxter-impact-dust + :id 1383 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4590)) + ) + +;; failed to figure out what this is: +(defpart 4590 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 8.0) + (:scale-x (meters 0.5) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 150.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0016666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-debris-trails + :id 1384 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4591)) + ) + +;; failed to figure out what this is: +(defpart 4591 + :init-specs ((:texture (ceiling-dust factoryd-sprite)) + (:birth-func 'spt-birth-func-part-factory-debris-trails) + (:num 2.0 2.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters -2) 2.0 (meters 4)) + (:rot-z (degrees 0)) + (:scale-y (meters 2) (meters 4)) + (:r 50.0 200.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters -0.00033333333) (meters -0.00033333333)) + (:friction 0.999) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata + :data (new 'static 'boxed-array :type int32 5 1 0 -1161820672 -1161820416 -1161820416 -1161820416 -1161820416) + ) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-factory-debris-trails +(defun spt-birth-func-part-factory-debris-trails ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group (the-as int arg0) arg1 arg2) + (birth-func-flip-based-on-scale + arg0 + arg1 + (the-as sprite-vec-data-3d arg2) + (the-as sparticle-launcher arg3) + (the-as sparticle-launch-state arg4) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-debris-impact + :id 1385 + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 4592) (sp-item 4593 :falloff-to (meters 20) :flags (is-3d sp7))) + ) + +;; failed to figure out what this is: +(defpart 4592 + :init-specs ((:texture (big-cloud level-default-sprite)) + (:num 8.0) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 100.0 150.0) + (:g :copy r) + (:b :copy r) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.042666666 -0.042666666) + (:accel-y (meters 0) (meters 0.000033333334)) + (:friction 0.95) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4593 + :init-specs ((:texture (glass-shard-01 factoryd-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 50.0 10.0) + (:scale-x (meters 0.1) (meters 0.3)) + (:rot-x (degrees 0) (degrees 3600)) + (:rot-y (degrees 0) (degrees 3600)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y (meters 0.1) (meters 0.3)) + (:r 0.0 2.0 64.0) + (:g 64.0 2.0 64.0) + (:b :copy g) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:rotvel-x (degrees -4) (degrees 8)) + (:rotvel-y (degrees -4) (degrees 8)) + (:rotvel-z (degrees -4) (degrees 8)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 5 0 0 -1161820160 -1161819904 -1161819648 -1161819392)) + (:func 'check-drop-group-center) + (:next-time (seconds 0.167)) + (:next-launcher 4594) + (:conerot-x (degrees 0) (degrees 45)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4594 + :init-specs ((:r 0.0 2.0 64.0) + (:g 64.0 2.0 64.0) + (:b :copy g) + (:a 128.0) + (:next-time (seconds 0.085) (seconds 0.165)) + (:next-launcher 4595) + ) + ) + +;; failed to figure out what this is: +(defpart 4595 + :init-specs ((:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:next-time (seconds 0.017) (seconds 0.015)) + (:next-launcher 4594) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc new file mode 100644 index 0000000000..ea6b141bba --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-setup_REF.gc @@ -0,0 +1,2490 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition (perm) for symbol *factory-boss-dead-pool*, type dead-pool +(define-perm *factory-boss-dead-pool* dead-pool #f) + +;; definition of type factory-boss-speech-instance +(deftype factory-boss-speech-instance (structure) + ((speech string) + (probability float) + (flags facboss-speech-instance-flag) + (play-count uint32) + ) + ) + +;; definition for method 3 of type factory-boss-speech-instance +(defmethod inspect ((this factory-boss-speech-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-speech-instance) + (format #t "~1Tspeech: ~A~%" (-> this speech)) + (format #t "~1Tprobability: ~f~%" (-> this probability)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tplay-count: ~D~%" (-> this play-count)) + (label cfg-4) + this + ) + +;; definition of type factory-boss-speech-info +(deftype factory-boss-speech-info (structure) + ((speeches (array factory-boss-speech-instance)) + (play-time time-frame) + (current-random time-frame) + (minimum-interval time-frame) + (random-interval time-frame) + (last-played int8) + (flags facboss-speech-info-flag) + ) + ) + +;; definition for method 3 of type factory-boss-speech-info +(defmethod inspect ((this factory-boss-speech-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-speech-info) + (format #t "~1Tspeeches: ~A~%" (-> this speeches)) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (format #t "~1Tcurrent-random: ~D~%" (-> this current-random)) + (format #t "~1Tminimum-interval: ~D~%" (-> this minimum-interval)) + (format #t "~1Trandom-interval: ~D~%" (-> this random-interval)) + (format #t "~1Tlast-played: ~D~%" (-> this last-played)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type factory-boss-speech-group +(deftype factory-boss-speech-group (structure) + ((play-time time-frame) + (info (array factory-boss-speech-info)) + ) + ) + +;; definition for method 3 of type factory-boss-speech-group +(defmethod inspect ((this factory-boss-speech-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-speech-group) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (label cfg-4) + this + ) + +;; definition for symbol *factory-boss-speech*, type factory-boss-speech-group +(define *factory-boss-speech* + (new 'static 'factory-boss-speech-group + :info (new 'static 'boxed-array :type factory-boss-speech-info + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol101" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero003" :probability 1.0) + (new 'static 'factory-boss-speech-instance + :speech "ero023" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance + :speech "ero024" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance :speech "ero037" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero038" :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol105" :probability 1.0) + (new 'static 'factory-boss-speech-instance + :speech "erol107" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance :speech "ero004" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero013" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero020" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero022" :probability 1.0) + ) + :minimum-interval (seconds 10) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "ero014" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero017" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero036" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero059" :probability 1.0) + ) + :minimum-interval (seconds 9) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol102" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol104" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol112" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol113" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol118" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero005" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero075" :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "erol114" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol115" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol116" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol117" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol118" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "erol119" :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "ero070" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero061" :probability 1.0) + ) + :minimum-interval (seconds 15) + :flags (facboss-speech-info-flag fsi0) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "ero078" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero079" :probability 1.0) + (new 'static 'factory-boss-speech-instance :speech "ero096" :probability 1.0) + ) + :minimum-interval (seconds 1) + ) + (new 'static 'factory-boss-speech-info + :speeches (new 'static 'boxed-array :type factory-boss-speech-instance + (new 'static 'factory-boss-speech-instance :speech "dax684" :probability 1.0) + (new 'static 'factory-boss-speech-instance + :speech "dax685" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + (new 'static 'factory-boss-speech-instance + :speech "dax686" + :probability 1.0 + :flags (facboss-speech-instance-flag fsi2) + ) + ) + :minimum-interval (seconds 5) + ) + ) + ) + ) + +;; definition for function reset-factory-boss-speeches +;; WARN: Return type mismatch symbol vs none. +(defun reset-factory-boss-speeches () + (set! (-> *factory-boss-speech* play-time) 0) + (dotimes (v1-1 (-> *factory-boss-speech* info length)) + (let ((a0-2 (-> *factory-boss-speech* info v1-1))) + (dotimes (a1-2 (-> a0-2 speeches length)) + (set! (-> a0-2 speeches a1-2 play-count) (the-as uint 0)) + ) + (set! (-> a0-2 play-time) 0) + (set! (-> a0-2 current-random) 0) + (set! (-> a0-2 last-played) -1) + ) + ) + (none) + ) + +;; definition for function factory-boss-play-speech +;; WARN: Return type mismatch int vs none. +;; WARN: Function factory-boss-play-speech has a return type of none, but the expression builder found a return statement. +(defun factory-boss-play-speech ((arg0 int) (arg1 factory-boss)) + (let ((gp-0 (-> *factory-boss-speech* info arg0))) + (if (zero? (-> gp-0 speeches length)) + (return 0) + ) + (if (logtest? (-> gp-0 flags) (facboss-speech-info-flag fsi0)) + (set! (-> gp-0 play-time) (-> *factory-boss-speech* play-time)) + ) + (if (not (time-elapsed? (-> gp-0 play-time) (+ (-> gp-0 minimum-interval) (-> gp-0 current-random)))) + (return 0) + ) + (let ((f30-0 0.0) + (s4-0 (-> gp-0 speeches 0 play-count)) + ) + (dotimes (v1-18 (-> gp-0 speeches length)) + (let ((a0-8 (-> gp-0 speeches v1-18))) + (cond + ((or (< s4-0 (-> a0-8 play-count)) + (and (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi1)) (nonzero? (-> gp-0 play-time))) + (and (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi2)) (zero? (-> gp-0 play-time))) + (and (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi0)) (> (-> a0-8 play-count) 0)) + (and (not (logtest? (-> a0-8 flags) (facboss-speech-instance-flag fsi3))) (= (-> gp-0 last-played) v1-18)) + ) + (logclear! (-> a0-8 flags) (facboss-speech-instance-flag fsi4)) + ) + ((= (-> a0-8 play-count) s4-0) + (+! f30-0 (-> a0-8 probability)) + (logior! (-> a0-8 flags) (facboss-speech-instance-flag fsi4)) + ) + (else + (set! s4-0 (-> a0-8 play-count)) + (set! f30-0 (-> a0-8 probability)) + (logior! (-> a0-8 flags) (facboss-speech-instance-flag fsi4)) + ) + ) + ) + ) + (let ((f0-2 (* f30-0 (rand-vu)))) + (dotimes (s3-0 (-> gp-0 speeches length)) + (let ((s2-0 (-> gp-0 speeches s3-0))) + (cond + ((or (not (logtest? (-> s2-0 flags) (facboss-speech-instance-flag fsi4))) (< s4-0 (-> s2-0 play-count))) + ) + ((or (>= (-> s2-0 probability) f0-2) (logtest? (-> s2-0 flags) (facboss-speech-instance-flag fsi1))) + (let ((a1-28 (add-process *gui-control* arg1 (gui-channel sig) (gui-action play) (-> s2-0 speech) 81920.0 0))) + (when (sound-params-set! *gui-control* a1-28 #f -1 -1 -1 (-> *setting-control* user-current talker-volume)) + (set! (-> s2-0 play-count) (+ s4-0 1)) + (set-time! (-> *factory-boss-speech* play-time)) + (set-time! (-> gp-0 play-time)) + (set! (-> gp-0 current-random) + (the-as time-frame (the int (* (rand-vu) (the float (-> gp-0 random-interval))))) + ) + (set! (-> gp-0 last-played) s3-0) + ) + ) + (return 0) + ) + (else + (set! f0-2 (- f0-2 (-> gp-0 speeches s3-0 probability))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type factory-boss-reticle-info +(deftype factory-boss-reticle-info (structure) + ((reticle sparticle-launch-control) + (reticle-corner-0 sparticle-launch-control) + (reticle-corner-1 sparticle-launch-control) + (reticle-corner-2 sparticle-launch-control) + (reticle-corner-3 sparticle-launch-control) + (reticle-dot sparticle-launch-control) + (reticle-arrow sparticle-launch-control) + (reticle-super sparticle-launch-control) + (reticle-super-ring sparticle-launch-control) + (lock-time time-frame) + ) + (:methods + (init! (_type_ process) none) + (factory-boss-reticle-info-method-10 (_type_ vector vector int int) none) + (factory-boss-reticle-info-method-11 (_type_) none) + ) + ) + +;; definition for method 3 of type factory-boss-reticle-info +(defmethod inspect ((this factory-boss-reticle-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-reticle-info) + (format #t "~1Treticle: ~A~%" (-> this reticle)) + (format #t "~1Treticle-corner-0: ~A~%" (-> this reticle-corner-0)) + (format #t "~1Treticle-corner-1: ~A~%" (-> this reticle-corner-1)) + (format #t "~1Treticle-corner-2: ~A~%" (-> this reticle-corner-2)) + (format #t "~1Treticle-corner-3: ~A~%" (-> this reticle-corner-3)) + (format #t "~1Treticle-dot: ~A~%" (-> this reticle-dot)) + (format #t "~1Treticle-arrow: ~A~%" (-> this reticle-arrow)) + (format #t "~1Treticle-super: ~A~%" (-> this reticle-super)) + (format #t "~1Treticle-super-ring: ~A~%" (-> this reticle-super-ring)) + (format #t "~1Tlock-time: ~D~%" (-> this lock-time)) + (label cfg-4) + this + ) + +;; definition for method 9 of type factory-boss-reticle-info +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this factory-boss-reticle-info) (arg0 process)) + (set! (-> this reticle) (create-launch-control (-> *part-group-id-table* 1371) arg0)) + (set! (-> this reticle-corner-0) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-corner-1) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-corner-2) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-corner-3) (create-launch-control (-> *part-group-id-table* 1372) arg0)) + (set! (-> this reticle-dot) (create-launch-control (-> *part-group-id-table* 1373) arg0)) + (set! (-> this reticle-arrow) (create-launch-control (-> *part-group-id-table* 1374) arg0)) + (set! (-> this reticle-super) (create-launch-control (-> *part-group-id-table* 1375) arg0)) + (set! (-> this reticle-super-ring) (create-launch-control (-> *part-group-id-table* 1376) arg0)) + (set! (-> this lock-time) 0) + 0 + (none) + ) + +;; definition for method 10 of type factory-boss-reticle-info +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod factory-boss-reticle-info-method-10 ((this factory-boss-reticle-info) (arg0 vector) (arg1 vector) (arg2 int) (arg3 int)) + (local-vars (sv-160 vector)) + (set! sv-160 arg0) + (let ((s4-0 arg1) + (s2-0 arg2) + (s1-0 arg3) + ) + (cond + ((zero? s2-0) + (if (zero? (-> this lock-time)) + (set-time! (-> this lock-time)) + ) + ) + (else + (set! (-> this lock-time) 0) + 0 + ) + ) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (let ((s0-0 (or (nonzero? (-> this lock-time)) (< 24 (mod s2-0 48)))) + (s3-0 #t) + ) + (let ((f28-0 0.0) + (f30-0 0.0) + ) + (matrix-identity! s5-0) + (set! (-> s5-0 trans quad) (-> sv-160 quad)) + (let ((v1-8 s1-0)) + (cond + ((zero? v1-8) + (if (zero? s2-0) + (set! f28-0 128.0) + (set! f30-0 128.0) + ) + ) + ((= v1-8 2) + (cond + ((zero? s2-0) + (set! f28-0 128.0) + ) + (else + (set! f28-0 128.0) + (set! f30-0 128.0) + ) + ) + ) + ((zero? s2-0) + (set! f28-0 128.0) + ) + (else + (set! f30-0 128.0) + ) + ) + ) + (set! (-> *part-id-table* 4568 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4568 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4569 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4569 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4566 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4566 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4567 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4567 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4570 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4570 init-specs 6 initial-valuef) f30-0) + (set! (-> *part-id-table* 4571 init-specs 5 initial-valuef) f28-0) + (set! (-> *part-id-table* 4571 init-specs 6 initial-valuef) f30-0) + ) + (cond + ((zero? s1-0) + (if s3-0 + (spawn-from-mat (-> this reticle) s5-0) + ) + (let ((s1-1 (new 'stack-no-clear 'matrix))) + (let* ((f0-2 (lerp-scale 1.0 0.1 (the float (mod s2-0 90)) 90.0 0.0)) + (f30-1 (* 3686.4 f0-2)) + ) + (let* ((a2-2 s1-1) + (a3-2 s5-0) + (v1-64 (-> a3-2 rvec quad)) + (a0-9 (-> a3-2 uvec quad)) + (a1-3 (-> a3-2 fvec quad)) + (a3-3 (-> a3-2 trans quad)) + ) + (set! (-> a2-2 rvec quad) v1-64) + (set! (-> a2-2 uvec quad) a0-9) + (set! (-> a2-2 fvec quad) a1-3) + (set! (-> a2-2 trans quad) a3-3) + ) + (vector+float*! (-> s1-1 trans) (-> s5-0 trans) (-> s5-0 rvec) (- f30-1)) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (- f30-1)) + (spawn-from-mat (-> this reticle-corner-0) s1-1) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* 2.0 f30-1)) + (set! (-> s1-1 rvec quad) (-> s5-0 fvec quad)) + (vector-negate! (-> s1-1 fvec) (-> s5-0 rvec)) + (spawn-from-mat (-> this reticle-corner-1) s1-1) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 fvec) (* 2.0 f30-1)) + (vector-negate! (-> s1-1 rvec) (-> s5-0 rvec)) + (vector-negate! (-> s1-1 fvec) (-> s5-0 fvec)) + (spawn-from-mat (-> this reticle-corner-2) s1-1) + (vector+float*! (-> s1-1 trans) (-> s1-1 trans) (-> s5-0 rvec) (* -2.0 f30-1)) + ) + (vector-negate! (-> s1-1 rvec) (-> s5-0 fvec)) + (set! (-> s1-1 fvec quad) (-> s5-0 rvec quad)) + (spawn-from-mat (-> this reticle-corner-3) s1-1) + ) + ) + ((= s1-0 2) + (if s3-0 + (spawn-from-mat (-> this reticle-super) s5-0) + ) + (if s0-0 + (spawn-from-mat (-> this reticle-super-ring) s5-0) + ) + ) + (else + (spawn-from-mat (-> this reticle-super-ring) s5-0) + ) + ) + (if s3-0 + (spawn-from-mat (-> this reticle-dot) s5-0) + ) + ) + (let ((a1-21 (new 'stack-no-clear 'vector))) + (vector-! a1-21 (-> s5-0 trans) s4-0) + (set! (-> a1-21 y) 0.0) + (vector-normalize-copy! (-> s5-0 fvec) a1-21 1.8) + ) + (vector-cross! (-> s5-0 rvec) (-> s5-0 uvec) (-> s5-0 fvec)) + (vector+float*! (-> s5-0 trans) (-> s5-0 trans) (-> s5-0 fvec) -4096.0) + (spawn-from-mat (-> this reticle-arrow) s5-0) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type factory-boss-reticle-info +;; WARN: Return type mismatch sparticle-launch-control vs factory-boss-reticle-info. +(defmethod relocate ((this factory-boss-reticle-info) (offset int)) + (if (nonzero? (-> this reticle)) + (&+! (-> this reticle) offset) + ) + (if (nonzero? (-> this reticle-corner-0)) + (&+! (-> this reticle-corner-0) offset) + ) + (if (nonzero? (-> this reticle-corner-1)) + (&+! (-> this reticle-corner-1) offset) + ) + (if (nonzero? (-> this reticle-corner-2)) + (&+! (-> this reticle-corner-2) offset) + ) + (if (nonzero? (-> this reticle-corner-3)) + (&+! (-> this reticle-corner-3) offset) + ) + (if (nonzero? (-> this reticle-dot)) + (&+! (-> this reticle-dot) offset) + ) + (if (nonzero? (-> this reticle-arrow)) + (&+! (-> this reticle-arrow) offset) + ) + (if (nonzero? (-> this reticle-super)) + (&+! (-> this reticle-super) offset) + ) + (the-as factory-boss-reticle-info (when (nonzero? (-> this reticle-super-ring)) + (let ((v0-0 (&+ (-> this reticle-super-ring) offset))) + (set! (-> this reticle-super-ring) v0-0) + v0-0 + ) + ) + ) + ) + +;; definition for method 11 of type factory-boss-reticle-info +;; WARN: Return type mismatch int vs none. +(defmethod factory-boss-reticle-info-method-11 ((this factory-boss-reticle-info)) + (if (nonzero? (-> this reticle)) + (kill-particles (-> this reticle)) + ) + (if (nonzero? (-> this reticle-corner-0)) + (kill-particles (-> this reticle-corner-0)) + ) + (if (nonzero? (-> this reticle-corner-1)) + (kill-particles (-> this reticle-corner-1)) + ) + (if (nonzero? (-> this reticle-corner-2)) + (kill-particles (-> this reticle-corner-2)) + ) + (if (nonzero? (-> this reticle-corner-3)) + (kill-particles (-> this reticle-corner-3)) + ) + (if (nonzero? (-> this reticle-dot)) + (kill-particles (-> this reticle-dot)) + ) + (if (nonzero? (-> this reticle-arrow)) + (kill-particles (-> this reticle-arrow)) + ) + (if (nonzero? (-> this reticle-super)) + (kill-particles (-> this reticle-super)) + ) + (if (nonzero? (-> this reticle-super-ring)) + (kill-particles (-> this reticle-super-ring)) + ) + 0 + (none) + ) + +;; definition of type factory-boss-shot +(deftype factory-boss-shot (projectile) + ((trail-part sparticle-launch-control) + (traj trajectory :inline) + (traj-time time-frame) + (shot-dest vector :inline) + (impact-played symbol) + (reticle-sound sound-id) + (reticle-sound-playing symbol) + ) + (:methods + (stop-reticle-sound (_type_) none) + ) + ) + +;; definition for method 3 of type factory-boss-shot +(defmethod inspect ((this factory-boss-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Ttrail-part: ~A~%" (-> this trail-part)) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Ttraj-time: ~D~%" (-> this traj-time)) + (format #t "~2Tshot-dest: #~%" (-> this shot-dest)) + (format #t "~2Timpact-played: ~A~%" (-> this impact-played)) + (format #t "~2Treticle-sound: ~D~%" (-> this reticle-sound)) + (format #t "~2Treticle-sound-playing: ~A~%" (-> this reticle-sound-playing)) + (label cfg-4) + this + ) + +;; definition for method 37 of type factory-boss-shot +(defmethod deal-damage! ((this factory-boss-shot) (arg0 process) (arg1 event-message-block)) + (let* ((t9-0 (method-of-type projectile deal-damage!)) + (s5-0 (t9-0 this arg0 arg1)) + ) + (if (and s5-0 (= arg0 *target*)) + (factory-boss-play-speech 2 (the-as factory-boss this)) + ) + s5-0 + ) + ) + +;; definition for method 41 of type factory-boss-shot +;; WARN: Return type mismatch int vs none. +(defmethod stop-reticle-sound ((this factory-boss-shot)) + (when (-> this reticle-sound-playing) + (sound-stop (-> this reticle-sound)) + (set! (-> this reticle-sound-playing) #f) + ) + 0 + (none) + ) + +;; definition for method 7 of type factory-boss-shot +(defmethod relocate ((this factory-boss-shot) (offset int)) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type factory-boss-shot +(defmethod deactivate ((this factory-boss-shot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (stop-reticle-sound this) + (call-parent-method this) + (none) + ) + +;; definition for method 25 of type factory-boss-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this factory-boss-shot)) + (if (nonzero? (-> this trail-part)) + (push-back (-> this trail-part) (-> this root trans)) + ) + 0 + (none) + ) + +;; definition for method 30 of type factory-boss-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this factory-boss-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-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 + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> 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 31 of type factory-boss-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this factory-boss-shot)) + (with-pp + (set! (-> this attack-mode) 'eco-dark) + (set! (-> this sound-id) (new-sound-id)) + (let ((t9-1 (method-of-type projectile init-proj-settings!))) + (t9-1 this) + ) + (set! (-> this shot-dest quad) (-> this root transv quad)) + (set-time! (-> this traj-time)) + (cond + ((type? this factory-boss-shockwave-bomb) + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4533) 8.0) + ) + ) + (setup-from-to-duration-and-height! (-> this traj) (-> this root trans) (-> this root transv) 300.0 8192.0) + ) + (else + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 4530) 10.0) + ) + ) + (setup-from-to-duration-and-height! (-> this traj) (-> this root trans) (-> this root transv) 225.0 8192.0) + ) + ) + (compute-transv-at-time (-> this traj) 0.0 (-> this root transv)) + (set! (-> this pre-move-transv quad) (-> this root transv quad)) + (vector-normalize-copy! (-> this starting-dir) (-> this root transv) 1.0) + (vector+float*! (-> this base-target-pos) (-> this root trans) (-> this starting-dir) 2048000.0) + (set! (-> this target-pos quad) (-> this base-target-pos quad)) + (set! (-> this impact-played) #f) + (set! (-> this reticle-sound) (new-sound-id)) + (sound-play "reticle-lock" :id (-> this reticle-sound) :position (-> this shot-dest)) + (set! (-> this reticle-sound-playing) #t) + 0 + (none) + ) + ) + +;; definition for method 28 of type factory-boss-shot +;; WARN: Return type mismatch symbol vs none. +(defmethod play-impact-sound ((this factory-boss-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + ) + ((= v1-0 (projectile-options po0)) + ) + ((= v1-0 (projectile-options po0 po1)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate moving (factory-boss-shot) + :virtual #t + :trans (behavior () + (local-vars (at-0 int)) + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (cond + ((time-elapsed? (-> self traj-time) (the int (-> self traj time))) + (go-virtual impact) + ) + ((and (not (-> self impact-played)) + (time-elapsed? (+ (-> self traj-time) (seconds -0.5)) (the int (-> self traj time))) + ) + (sound-play "erol-proj-incom" :position (-> self root trans)) + (set! (-> self impact-played) #t) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self traj-time)))) + gp-1 + ) + (vector-! (-> self pre-move-transv) gp-1 (-> self root trans)) + (let ((v1-22 (-> self pre-move-transv))) + (.lvf vf1 (&-> (-> self pre-move-transv) quad)) + (let ((f0-6 (-> self clock frames-per-second))) + (.mov at-0 f0-6) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> v1-22 quad) vf1) + ) + (set! (-> self root transv quad) (-> self pre-move-transv quad)) + (if (< 2191360.0 (-> gp-1 y)) + (integrate-and-collide! (-> self root) (-> self root transv)) + (projectile-move-fill-line-sphere self) + ) + ) + (if (logtest? (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + no-touch + blocked + on-water + impact-surface + touch-background + stuck + touch-ceiling-sticky + glance + probe-hit + ) + (-> self root status) + ) + (go-impact! self) + ) + (cond + ((type? self factory-boss-floorbuster-bomb) + (send-event (ppointer->process (-> self parent)) 'draw-reticle (-> self shot-dest) (-> self traj) 1) + ) + ((type? self factory-boss-shockwave-bomb) + (send-event (ppointer->process (-> self parent)) 'draw-reticle (-> self shot-dest) (-> self traj) 2) + ) + (else + (send-event (ppointer->process (-> self parent)) 'draw-reticle (-> self shot-dest) (-> self traj) 0) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate impact (factory-boss-shot) + :virtual #t + :enter (behavior () + (stop-reticle-sound self) + (sound-play "erol-proj-expl" :position (-> self root trans)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1360)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (ppointer->process (-> self parent))) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 10)) (not (-> self child))) + (deactivate self) + (go empty-state) + ) + ) + :code sleep-code + ) + +;; definition of type factory-boss-shockwave-bomb +(deftype factory-boss-shockwave-bomb (factory-boss-shot) + () + ) + +;; definition for method 3 of type factory-boss-shockwave-bomb +(defmethod inspect ((this factory-boss-shockwave-bomb)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type factory-boss-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type shockwave-bomb-explosion +(deftype shockwave-bomb-explosion (explosion) + () + ) + +;; definition for method 3 of type shockwave-bomb-explosion +(defmethod inspect ((this shockwave-bomb-explosion)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type explosion inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate impact (factory-boss-shockwave-bomb) + :virtual #t + :enter (behavior () + (local-vars (sv-272 entity-actor)) + (stop-reticle-sound self) + (sound-play "erol-proj-expls" :position (-> self root trans)) + (let ((v1-4 (-> self root root-prim))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1360)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn-legacy-version (ppointer->process (-> self parent)) shockwave-bomb-explosion gp-1) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + (let ((s5-1 (new 'stack-no-clear 'vector))) + (set! (-> s5-1 quad) (-> self root trans quad)) + (let ((gp-2 (new 'stack-no-clear 'quaternion))) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (+! (-> s5-1 y) 409.6) + (quaternion-set! gp-2 0.0 0.0 0.0 1.0) + (matrix-identity! s4-0) + (set! (-> s4-0 trans quad) (-> s5-1 quad)) + ) + (let* ((s3-0 (get-process *default-dead-pool* manipy #x20000 1)) + (s4-1 (when s3-0 + (let ((t9-9 (method-of-type manipy activate))) + (t9-9 (the-as manipy s3-0) self "manipy" (the-as pointer #x70004000)) + ) + (let ((s4-2 run-function-in-process) + (s2-0 s3-0) + (s1-0 manipy-init) + (s0-0 s5-1) + ) + (set! sv-272 (-> self entity)) + (let ((t0-2 (art-group-get-by-name *level* "skel-bomb-blast" (the-as (pointer level) #f))) + (t1-1 #f) + (t2-1 0) + ) + ((the-as (function object object object object object object object none) s4-2) + s2-0 + s1-0 + s0-0 + sv-272 + t0-2 + t1-1 + t2-1 + ) + ) + ) + (-> s3-0 ppointer) + ) + ) + ) + (when s4-1 + (send-event (ppointer->process s4-1) 'rot-quat gp-2) + (send-event (ppointer->process s4-1) 'anim-mode 'play1) + (send-event (ppointer->process s4-1) 'anim "idle") + (set-vector! (-> (the-as (pointer manipy) s4-1) 0 root scale) 1.0 1.0 1.0 1.0) + (let ((v1-60 (lambda :behavior manipy + () + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (cond + ((>= 10.0 (ja-aframe-num 0)) + (let ((v0-1 (the-as vector (-> self draw color-emissive)))) + (set! (-> (the-as rgbaf v0-1) x) 1.0) + (set! (-> (the-as rgbaf v0-1) y) 1.0) + (set! (-> (the-as rgbaf v0-1) z) 1.0) + (set! (-> (the-as rgbaf v0-1) w) 1.0) + v0-1 + ) + ) + ((>= 20.0 (ja-aframe-num 0)) + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 10.0 20.0) + ) + ) + (else + (vector-lerp! + (-> self draw color-emissive) + (new 'static 'vector :x 0.5 :z 1.0 :w 1.0) + (new 'static 'vector :w 1.0) + (lerp-scale 0.0 1.0 (ja-aframe-num 0) 20.0 30.0) + ) + ) + ) + ) + ) + ) + (send-event (ppointer->process s4-1) 'trans-hook v1-60) + ) + ) + ) + (let ((s4-3 (process-spawn + manipy + :init manipy-init + s5-1 + (-> 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 s4-3 + (send-event (ppointer->process s4-3) 'rot-quat gp-2) + (send-event (ppointer->process s4-3) 'anim-mode 'play1) + (send-event (ppointer->process s4-3) 'anim "idle") + (set-vector! (-> (the-as (pointer manipy) s4-3) 0 root scale) 1.0 1.0 1.0 1.0) + ) + ) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type factory-boss-shot impact) trans))) + (if t9-0 + (t9-0) + ) + ) + (let ((f30-1 (* 2048.0 (pow (the float (- (current-time) (-> self state-time))) 0.85))) + (f28-1 (* 2048.0 (pow (the float (+ (- (seconds -0.05) (-> self state-time)) (current-time))) 0.85))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self root trans quad)) + (+! (-> s5-0 y) 409.6) + (when *target* + (let* ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) s5-0)) + (v1-16 gp-1) + (f0-12 (sqrtf (+ (* (-> v1-16 x) (-> v1-16 x)) (* (-> v1-16 z) (-> v1-16 z))))) + ) + (if (and (< f0-12 (+ 4096.0 f30-1)) (< (+ -4096.0 f28-1) f0-12) (< (-> gp-1 y) 1638.4) (< -8192.0 (-> gp-1 y))) + (deal-damage! self *target* (the-as event-message-block #f)) + ) + ) + ) + ) + ) + ) + +;; definition of type factory-boss-floorbuster-bomb +(deftype factory-boss-floorbuster-bomb (factory-boss-shot) + ((targetted-group int8) + ) + ) + +;; definition for method 3 of type factory-boss-floorbuster-bomb +(defmethod inspect ((this factory-boss-floorbuster-bomb)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type factory-boss-shot inspect))) + (t9-0 this) + ) + (format #t "~2Ttargetted-group: ~D~%" (-> this targetted-group)) + (label cfg-4) + this + ) + +;; definition of type floorbuster-bomb-explosion +(deftype floorbuster-bomb-explosion (explosion) + ((targetted-group int8) + ) + ) + +;; definition for method 3 of type floorbuster-bomb-explosion +(defmethod inspect ((this floorbuster-bomb-explosion)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type explosion inspect))) + (t9-0 this) + ) + (format #t "~2Ttargetted-group: ~D~%" (-> this targetted-group)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate impact (factory-boss-floorbuster-bomb) + :virtual #t + :enter (behavior () + (stop-reticle-sound self) + (sound-play "erol-proj-expl" :position (-> self root trans)) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 1360)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 2.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 1.0) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (let ((v1-22 + (ppointer->process + (explosion-spawn-legacy-version (ppointer->process (-> self parent)) floorbuster-bomb-explosion gp-1) + ) + ) + ) + (if v1-22 + (set! (-> (the-as floorbuster-bomb-explosion v1-22) targetted-group) (-> self targetted-group)) + ) + ) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 10)) (not (-> self child))) + (deactivate self) + (go empty-state) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-drop-plat fac-drop-plat fac-drop-plat-lod0-jg fac-drop-plat-idle-ja + ((fac-drop-plat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition of type fac-drop-plat-nocollide +(deftype fac-drop-plat-nocollide (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-drop-plat-nocollide +(defmethod inspect ((this fac-drop-plat-nocollide)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (fac-drop-plat-nocollide) + :virtual #t + :enter (behavior () + (ja-post) + ) + :trans (behavior () + (if (< (vector-vector-distance (-> self draw origin) (math-camera-pos)) (-> self draw origin w)) + (logclear! (-> self draw status) (draw-control-status force-vu1)) + (logior! (-> self draw status) (draw-control-status force-vu1)) + ) + ) + :code sleep-code + ) + +;; definition for function fac-drop-plat-nocollide-init-by-other +(defbehavior fac-drop-plat-nocollide-init-by-other fac-drop-plat-nocollide ((arg0 entity-actor)) + (stack-size-set! (-> self main-thread) 16) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (set! (-> self level) (level-get *level* 'factoryd)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-drop-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self draw light-index) (the-as uint 17)) + (set! (-> self entity) arg0) + (logclear! (-> self mask) (process-mask enemy)) + (go-virtual idle) + ) + +;; definition of type fac-drop-plat +(deftype fac-drop-plat (process-drawable) + ((root collide-shape :override) + (x-rotation-speed float) + (y-rotation-speed float) + (boss entity-actor) + ) + (:state-methods + idle + fall-away + done-falling + ) + ) + +;; definition for method 3 of type fac-drop-plat +(defmethod inspect ((this fac-drop-plat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tx-rotation-speed: ~f~%" (-> this x-rotation-speed)) + (format #t "~2Ty-rotation-speed: ~f~%" (-> this y-rotation-speed)) + (format #t "~2Tboss: ~A~%" (-> this boss)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (fac-drop-plat) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((gp-0 -1)) + (cond + ((type? proc factory-boss-floorbuster-bomb) + (set! gp-0 (-> (the-as factory-boss-floorbuster-bomb proc) targetted-group)) + ) + ((type? proc floorbuster-bomb-explosion) + (set! gp-0 (-> (the-as floorbuster-bomb-explosion proc) targetted-group)) + ) + ) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer self)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'fall?) + (set! (-> a1-3 param 0) (the-as uint (-> self entity))) + (set! (-> a1-3 param 1) (the-as uint gp-0)) + (let ((t9-2 send-event-function) + (v1-9 (-> self boss)) + ) + (when (t9-2 + (if v1-9 + (-> v1-9 extra process) + ) + a1-3 + ) + (sound-play "break-grate" :position (-> self root trans)) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual fall-away) + ) + ) + ) + ) + ) + (('fall!) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual fall-away) + ) + ) + ) + :enter (behavior () + (transform-post) + ) + :code sleep-code + ) + +;; definition for function fac-drop-plat-setup-rots +;; WARN: Return type mismatch float vs object. +(defbehavior fac-drop-plat-setup-rots fac-drop-plat () + (set! (-> self x-rotation-speed) (rand-vu-float-range 546.13336 3094.7556)) + (if (< 1820.4445 (-> self x-rotation-speed)) + (+! (-> self x-rotation-speed) -3640.889) + ) + (set! (-> self y-rotation-speed) (rand-vu-float-range 546.13336 3094.7556)) + (if (< 1820.4445 (-> self y-rotation-speed)) + (set! (-> self y-rotation-speed) (+ -3640.889 (-> self y-rotation-speed))) + ) + ) + +;; definition for function fac-drop-plat-rot-once +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 48 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 64 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch quaternion vs object. +(defbehavior fac-drop-plat-rot-once fac-drop-plat ((arg0 degrees)) + (local-vars (sv-48 float) (sv-64 float)) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((s3-0 quaternion-set!) + (s2-0 gp-0) + (s1-0 (sin (* arg0 (-> self x-rotation-speed)))) + (s0-0 0.0) + ) + (set! sv-48 (the-as float 0.0)) + (let ((t0-0 (cos (* arg0 (-> self x-rotation-speed))))) + (s3-0 s2-0 s1-0 s0-0 sv-48 t0-0) + ) + ) + (let ((s3-1 quaternion-set!) + (s2-1 s5-0) + (s1-1 0.0) + (s0-1 (sin (* arg0 (-> self y-rotation-speed)))) + ) + (set! sv-64 (the-as float 0.0)) + (let ((t0-1 (cos (* arg0 (-> self y-rotation-speed))))) + (s3-1 s2-1 s1-1 s0-1 sv-64 t0-1) + ) + ) + (quaternion-normalize! (quaternion*! gp-0 gp-0 s5-0)) + ) + (quaternion-normalize! (quaternion*! (-> self root quat) gp-0 (-> self root quat))) + ) + ) + +;; failed to figure out what this is: +(defstate fall-away (fac-drop-plat) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (fac-drop-plat-setup-rots) + (fac-drop-plat-rot-once (the-as degrees #x3f800000)) + (fac-drop-plat-setup-rots) + (set-time! (-> self state-time)) + (set! (-> self x-rotation-speed) (rand-vu-float-range 546.13336 1820.4445)) + (set! (-> self y-rotation-speed) (rand-vu-float-range 546.13336 1820.4445)) + (logclear! (-> self mask) (process-mask actor-pause)) + (if (-> self entity) + (toggle-status (-> self entity) (entity-perm-status subtask-complete) #t) + ) + ) + :code sleep-code + :post (behavior () + (if (time-elapsed? (-> self state-time) (seconds 2.5)) + (go-virtual done-falling) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.5)) + (let ((f0-2 (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 150.0 300.0))) + (set! (-> self root trans y) (- (-> self root trans y) (* 2048.0 f0-2))) + (fac-drop-plat-rot-once f0-2) + ) + (vector-float*! (-> self root scale) (-> self root scale) 0.98) + ) + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate done-falling (fac-drop-plat) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (ja-post) + (logior! (-> self mask) (process-mask actor-pause)) + ) + :code sleep-code + ) + +;; definition for method 10 of type fac-drop-plat +(defmethod deactivate ((this fac-drop-plat)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type fac-drop-plat +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this fac-drop-plat) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (with-pp + (stack-size-set! (-> this main-thread) 32) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-4 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-4 prim-core collide-as) (collide-spec obstacle impenetrable-obj)) + (set! (-> v1-4 prim-core collide-with) (collide-spec jak bot enemy hit-by-others-list player-list projectile)) + (set! (-> v1-4 prim-core action) (collide-action solid)) + (set! (-> v1-4 transform-index) 3) + (set-vector! (-> v1-4 local-sphere) 0.4096 0.0 -0.4096 12460.032) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-4) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-7 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-7 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-7 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (set! (-> pp level) (level-get *level* 'factoryd)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-drop-plat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this draw light-index) (the-as uint 17)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-16 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-16 (nonzero? (-> sv-16 elt-count)) (nonzero? (-> v1-16 0 length))) + (set! (-> this boss) (-> v1-16 0 data 0 actor)) + ) + (else + (format 0 "ERROR: ~S: entity missing actor-group!~%" (-> this name)) + (set! (-> this boss) #f) + ) + ) + ) + (if (and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this done-falling)) + (go (method-of-object this idle)) + ) + ) + ) + +;; definition for function fac-drop-plat-init-by-other +;; WARN: Return type mismatch entity-actor vs object. +(defbehavior fac-drop-plat-init-by-other fac-drop-plat ((arg0 entity-actor)) + (init-from-entity! self arg0) + (set! (-> self entity) arg0) + arg0 + ) + +;; failed to figure out what this is: +(defskelgroup skel-factory-boss errol-lowres errol-lowres-lod0-jg errol-lowres-idle30-ja + ((errol-lowres-lod0-mg (meters 20)) (errol-lowres-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition of type factory-boss-critter-tracker +(deftype factory-boss-critter-tracker (structure) + ((handle handle) + (flags facboss-critter-tracker-flag) + (dest vector :inline) + ) + ) + +;; definition for method 3 of type factory-boss-critter-tracker +(defmethod inspect ((this factory-boss-critter-tracker)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-critter-tracker) + (format #t "~1Thandle: ~D~%" (-> this handle)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tdest: #~%" (-> this dest)) + (label cfg-4) + this + ) + +;; definition of type factory-boss-machine-state +(deftype factory-boss-machine-state (structure) + ((damaged-low-smoke-part sparticle-launch-control) + (damaged-high-smoke-part sparticle-launch-control) + (damaged-left-spark-part sparticle-launch-control) + (damaged-right-spark-part sparticle-launch-control) + (ring-part sparticle-launch-control) + (lightning lightning-control) + (machine-sound sound-id) + (state int8) + (flags facboss-machine-state-flag) + (left-spark-timer time-frame) + (right-spark-timer time-frame) + (ring-timer time-frame) + ) + ) + +;; definition for method 3 of type factory-boss-machine-state +(defmethod inspect ((this factory-boss-machine-state)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-machine-state) + (format #t "~1Tdamaged-low-smoke-part: ~A~%" (-> this damaged-low-smoke-part)) + (format #t "~1Tdamaged-high-smoke-part: ~A~%" (-> this damaged-high-smoke-part)) + (format #t "~1Tdamaged-left-spark-part: ~A~%" (-> this damaged-left-spark-part)) + (format #t "~1Tdamaged-right-spark-part: ~A~%" (-> this damaged-right-spark-part)) + (format #t "~1Tring-part: ~A~%" (-> this ring-part)) + (format #t "~1Tlightning: ~A~%" (-> this lightning)) + (format #t "~1Tmachine-sound: ~D~%" (-> this machine-sound)) + (format #t "~1Tstate: ~D~%" (-> this state)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tleft-spark-timer: ~D~%" (-> this left-spark-timer)) + (format #t "~1Tright-spark-timer: ~D~%" (-> this right-spark-timer)) + (format #t "~1Tring-timer: ~D~%" (-> this ring-timer)) + (label cfg-4) + this + ) + +;; definition of type factory-boss-lightning-gate +(deftype factory-boss-lightning-gate (structure) + ((center vector :inline) + (x-off float) + (z-off float) + (blocking-plane handle) + (lightning lightning-control 4) + ) + (:methods + (init! (_type_ int) none) + (disable (_type_) none) + (factory-boss-lightning-gate-method-11 (_type_ vector float float process) none) + ) + ) + +;; definition for method 3 of type factory-boss-lightning-gate +(defmethod inspect ((this factory-boss-lightning-gate)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-lightning-gate) + (format #t "~1Tcenter: #~%" (-> this center)) + (format #t "~1Tx-off: ~f~%" (-> this x-off)) + (format #t "~1Tz-off: ~f~%" (-> this z-off)) + (format #t "~1Tblocking-plane: ~D~%" (-> this blocking-plane)) + (format #t "~1Tlightning[4] @ #x~X~%" (-> this lightning)) + (label cfg-4) + this + ) + +;; definition for method 9 of type factory-boss-lightning-gate +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this factory-boss-lightning-gate) (arg0 int)) + (set-factoryd-light! 1.0) + (let ((v1-0 (new 'stack-no-clear 'vector)) + (a0-2 (new 'stack-no-clear 'vector)) + ) + (set! (-> v1-0 quad) (-> this center quad)) + (+! (-> v1-0 x) (-> this x-off)) + (+! (-> v1-0 z) (-> this z-off)) + (+! (-> v1-0 y) 9175.04) + (set! (-> a0-2 quad) (-> this center quad)) + (set! (-> a0-2 x) (- (-> a0-2 x) (-> this x-off))) + (set! (-> a0-2 z) (- (-> a0-2 z) (-> this z-off))) + (+! (-> a0-2 y) 9011.2) + (dotimes (a1-5 4) + (let ((a2-7 (-> this lightning a1-5 state mode))) + (when (or (zero? a2-7) (= a2-7 3)) + (let ((a3-2 (-> this lightning a1-5)) + (a2-11 v1-0) + ) + (set! (-> a3-2 state meet data 0 quad) (-> a2-11 quad)) + ) + (let ((a3-5 (-> this lightning a1-5)) + (a2-15 a0-2) + ) + (set! (-> a3-5 state meet data (+ (-> a3-5 state points-to-draw) -1) quad) (-> a2-15 quad)) + ) + (let ((a2-19 (-> this lightning a1-5)) + (a3-8 1) + ) + (let ((t0-5 (!= a3-8 (-> a2-19 state mode)))) + (case a3-8 + ((3) + (if t0-5 + (set! (-> a2-19 state counter) 0.0) + ) + ) + ((1) + (set! (-> a2-19 state start-color) (-> a2-19 spec start-color)) + (set! (-> a2-19 state end-color) (-> a2-19 spec end-color)) + ) + ) + ) + (set! (-> a2-19 state mode) (the-as uint a3-8)) + ) + ) + ) + (+! (-> v1-0 y) 9830.4) + (+! (-> a0-2 y) 9830.4) + ) + ) + (let ((s4-0 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (set! (-> s4-0 0 quad) (-> this center quad)) + (+! (-> s4-0 0 x) (-> this x-off)) + (+! (-> s4-0 0 z) (-> this z-off)) + (set! (-> s4-0 1 quad) (-> s4-0 0 quad)) + (set! (-> s4-0 1 x) (- (-> s4-0 1 x) (* 2.0 (-> this x-off)))) + (set! (-> s4-0 1 z) (- (-> s4-0 1 z) (* 2.0 (-> this z-off)))) + (when (not (handle->process (-> this blocking-plane))) + (set! (-> this blocking-plane) + (ppointer->handle + (process-spawn blocking-plane s4-0 45056.0 :name "blocking-plane" :to (the-as process-tree arg0)) + ) + ) + (send-event (handle->process (-> this blocking-plane)) 'collide-as #x4000000) + (send-event (handle->process (-> this blocking-plane)) 'attack-mode 'shock) + ) + ) + 0 + (none) + ) + +;; definition for method 10 of type factory-boss-lightning-gate +;; WARN: Return type mismatch int vs none. +(defmethod disable ((this factory-boss-lightning-gate)) + (set-factoryd-light! 0.0) + (dotimes (s5-0 4) + (let ((v1-3 (-> this lightning s5-0 state mode))) + (cond + ((or (zero? v1-3) (= v1-3 3)) + ) + (else + (let ((v1-7 (-> this lightning s5-0)) + (a0-4 3) + ) + (let ((a1-1 (!= a0-4 (-> v1-7 state mode)))) + (case a0-4 + ((3) + (if a1-1 + (set! (-> v1-7 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-7 state start-color) (-> v1-7 spec start-color)) + (set! (-> v1-7 state end-color) (-> v1-7 spec end-color)) + ) + ) + ) + (set! (-> v1-7 state mode) (the-as uint a0-4)) + ) + ) + ) + ) + (let ((a0-6 (handle->process (-> this blocking-plane)))) + (if a0-6 + (deactivate a0-6) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 11 of type factory-boss-lightning-gate +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod factory-boss-lightning-gate-method-11 ((this factory-boss-lightning-gate) (arg0 vector) (arg1 float) (arg2 float) (arg3 process)) + (set-factoryd-light! 0.0) + (set! (-> this center quad) (-> arg0 quad)) + (set! (-> this x-off) arg1) + (set! (-> this z-off) arg2) + (set! (-> this blocking-plane) (the-as handle #f)) + (dotimes (s4-1 4) + (set! (-> this lightning s4-1) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration -1.0 + :sound #f + ) + arg3 + 0.0 + ) + ) + (let ((v1-6 (-> this lightning s4-1)) + (a0-4 0) + ) + (let ((a1-3 (!= a0-4 (-> v1-6 state mode)))) + (case a0-4 + ((3) + (if a1-3 + (set! (-> v1-6 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-6 state start-color) (-> v1-6 spec start-color)) + (set! (-> v1-6 state end-color) (-> v1-6 spec end-color)) + ) + ) + ) + (set! (-> v1-6 state mode) (the-as uint a0-4)) + ) + ) + 0 + (none) + ) + +;; definition for method 7 of type factory-boss-lightning-gate +(defmethod relocate ((this factory-boss-lightning-gate) (offset int)) + (dotimes (v1-0 4) + (if (nonzero? (-> this lightning v1-0)) + (&+! (-> this lightning v1-0) offset) + ) + ) + (call-parent-method this offset) + ) + +;; definition of type factory-boss +(deftype factory-boss (process-drawable) + ((child (pointer process-drawable) :override) + (self factory-boss :override) + (center vector :inline) + (shot-timer time-frame) + (critter factory-boss-critter-tracker 8 :inline) + (ammo handle 10) + (catwalk-angle float) + (catwalk-vel float) + (bombs-to-drop int8) + (bomb-type facboss-bomb-type) + (root-angle float) + (machine-state factory-boss-machine-state 4 :inline) + (chosen-machine int8) + (command-index int8) + (command-timer time-frame) + (current-round int32) + (hits-taken int8) + (camera-timer time-frame) + (reticle-info factory-boss-reticle-info :inline) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (launching-group sparticle-launch-group) + (floor-targets int8 7) + (num-floor-targets int8) + (reticle-sound sound-id) + (reticle-sound-playing symbol) + (warp-blocker factory-boss-lightning-gate :inline) + (entry-blocker factory-boss-lightning-gate :inline) + ) + (:state-methods + beaten + run-to-machine + get-hit + launch-critters + drop-bombs + hidden + ) + (:methods + (factory-boss-method-26 (_type_ int vector vector symbol) symbol) + (factory-boss-method-27 (_type_ vector) symbol) + (next-catwalk-angle (_type_ int) float) + (factory-boss-method-29 (_type_ float vector) none) + (factory-boss-method-30 (_type_) none) + ) + ) + +;; definition for method 3 of type factory-boss +(defmethod inspect ((this factory-boss)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcenter: #~%" (-> this center)) + (format #t "~2Tshot-timer: ~D~%" (-> this shot-timer)) + (format #t "~2Tcritter[8] @ #x~X~%" (-> this critter)) + (format #t "~2Tammo[10] @ #x~X~%" (-> this ammo)) + (format #t "~2Tcatwalk-angle: ~f~%" (-> this catwalk-angle)) + (format #t "~2Tcatwalk-vel: ~f~%" (-> this catwalk-vel)) + (format #t "~2Tbombs-to-drop: ~D~%" (-> this bombs-to-drop)) + (format #t "~2Tbomb-type: ~D~%" (-> this bomb-type)) + (format #t "~2Troot-angle: ~f~%" (-> this root-angle)) + (format #t "~2Tmachine-state[4] @ #x~X~%" (-> this machine-state)) + (format #t "~2Tchosen-machine: ~D~%" (-> this chosen-machine)) + (format #t "~2Tcommand-index: ~D~%" (-> this command-index)) + (format #t "~2Tcommand-timer: ~D~%" (-> this command-timer)) + (format #t "~2Tcurrent-round: ~D~%" (-> this current-round)) + (format #t "~2Thits-taken: ~D~%" (-> this hits-taken)) + (format #t "~2Tcamera-timer: ~D~%" (-> this camera-timer)) + (format #t "~2Treticle-info: #~%" (-> this reticle-info)) + (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 "~2Tlaunching-group: ~A~%" (-> this launching-group)) + (format #t "~2Tfloor-targets[7] @ #x~X~%" (-> this floor-targets)) + (format #t "~2Tnum-floor-targets: ~D~%" (-> this num-floor-targets)) + (format #t "~2Treticle-sound: ~D~%" (-> this reticle-sound)) + (format #t "~2Treticle-sound-playing: ~A~%" (-> this reticle-sound-playing)) + (format #t "~2Twarp-blocker: #~%" (-> this warp-blocker)) + (format #t "~2Tentry-blocker: #~%" (-> this entry-blocker)) + (label cfg-7) + this + ) + +;; definition for method 30 of type factory-boss +;; WARN: Return type mismatch int vs none. +(defmethod factory-boss-method-30 ((this factory-boss)) + (when (-> this reticle-sound-playing) + (sound-stop (-> this reticle-sound)) + (set! (-> this reticle-sound-playing) #f) + ) + 0 + (none) + ) + +;; definition for method 27 of type factory-boss +;; INFO: Used lq/sq +(defmethod factory-boss-method-27 ((this factory-boss) (arg0 vector)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (set! (-> v1-0 quad) (-> arg0 quad)) + (set! (-> v1-0 w) 16384.0) + (add-root-sphere-to-hash! (-> this nav) v1-0 255) + ) + ) + +;; definition for method 26 of type factory-boss +(defmethod factory-boss-method-26 ((this factory-boss) (arg0 int) (arg1 vector) (arg2 vector) (arg3 symbol)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (when arg3 + (let* ((v1-2 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-3 (the-as number (logior #x3f800000 v1-2))) + (f0-2 (+ -1.0 (the-as float v1-3))) + ) + (cond + ((< f0-2 0.25) + (+! arg0 -1) + ) + ((< f0-2 0.5) + (+! arg0 1) + ) + ) + ) + (if (>= arg0 4) + (+! arg0 -4) + ) + (if (< arg0 0) + (+! arg0 4) + ) + ) + (cond + ((zero? arg0) + (set-vector! s3-0 1.0 0.0 1.0 1.0) + (set-vector! s4-0 -1.0 0.0 1.0 1.0) + ) + ((= arg0 1) + (set-vector! s3-0 1.0 0.0 -1.0 1.0) + (set-vector! s4-0 1.0 0.0 1.0 1.0) + ) + ((= arg0 2) + (set-vector! s3-0 -1.0 0.0 -1.0 1.0) + (set-vector! s4-0 1.0 0.0 -1.0 1.0) + ) + (else + (set-vector! s3-0 -1.0 0.0 1.0 1.0) + (set-vector! s4-0 -1.0 0.0 -1.0 1.0) + ) + ) + (vector+float*! arg1 (-> this center) s3-0 98304.0) + (+! (-> arg1 y) 4096.0) + (if (factory-boss-method-27 this arg1) + (return #f) + ) + (vector+float*! arg2 (-> this center) s3-0 73728.0) + ) + (+! (-> arg2 y) 1679.36) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 16384.0) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 -32768.0) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 49152.0) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + (vector+float*! arg2 arg2 s4-0 -65536.0) + ) + (if (not (factory-boss-method-27 this arg2)) + (return #t) + ) + #f + ) + +;; definition for method 7 of type factory-boss +(defmethod relocate ((this factory-boss) (offset int)) + (relocate (-> this reticle-info) offset) + (relocate (-> this warp-blocker) offset) + (relocate (-> this entry-blocker) offset) + (dotimes (v1-6 4) + (let ((a0-6 (-> this machine-state v1-6))) + (if (nonzero? (-> a0-6 damaged-low-smoke-part)) + (&+! (-> a0-6 damaged-low-smoke-part) offset) + ) + (if (nonzero? (-> a0-6 damaged-high-smoke-part)) + (&+! (-> a0-6 damaged-high-smoke-part) offset) + ) + (if (nonzero? (-> a0-6 damaged-left-spark-part)) + (&+! (-> a0-6 damaged-left-spark-part) offset) + ) + (if (nonzero? (-> a0-6 damaged-right-spark-part)) + (&+! (-> a0-6 damaged-right-spark-part) offset) + ) + (if (nonzero? (-> a0-6 ring-part)) + (&+! (-> a0-6 ring-part) offset) + ) + (if (nonzero? (-> a0-6 lightning)) + (&+! (-> a0-6 lightning) offset) + ) + ) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type factory-boss +(defmethod deactivate ((this factory-boss)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (factory-boss-reticle-info-method-11 (-> this reticle-info)) + (factory-boss-method-30 this) + (dotimes (s5-0 4) + (let ((s4-0 (-> this machine-state s5-0))) + (if (nonzero? (-> s4-0 damaged-low-smoke-part)) + (kill-particles (-> s4-0 damaged-low-smoke-part)) + ) + (if (nonzero? (-> s4-0 damaged-high-smoke-part)) + (kill-particles (-> s4-0 damaged-high-smoke-part)) + ) + (if (nonzero? (-> s4-0 damaged-left-spark-part)) + (kill-particles (-> s4-0 damaged-left-spark-part)) + ) + (if (nonzero? (-> s4-0 damaged-right-spark-part)) + (kill-particles (-> s4-0 damaged-right-spark-part)) + ) + (if (nonzero? (-> s4-0 ring-part)) + (kill-particles (-> s4-0 ring-part)) + ) + (when (logtest? (-> s4-0 flags) (facboss-machine-state-flag fms0)) + (sound-stop (-> s4-0 machine-sound)) + (logclear! (-> s4-0 flags) (facboss-machine-state-flag fms0)) + ) + ) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type factory-boss +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this factory-boss) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((v1-2 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-2 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot hit-by-others-list player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 4096.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-factory-boss" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logior! (-> this skel status) (joint-control-status eye-anim)) + (logior! (-> this mask) (process-mask enemy)) + (set-vector! (-> this root scale) 1.6 1.6 1.6 1.0) + (set! (-> this center quad) (-> this root trans quad)) + (+! (-> this center z) 83992.98) + (+! (-> this center y) -65536.0) + (+! (-> this center x) -83992.98) + (+! (-> this root trans y) -6492.16) + (dotimes (v1-24 8) + (set! (-> this critter v1-24 handle) (the-as handle #f)) + ) + (dotimes (v1-27 10) + (set! (-> this ammo v1-27) (the-as handle #f)) + ) + (init! (-> this reticle-info) this) + (dotimes (s4-2 4) + (let ((s3-1 (-> this machine-state s4-2))) + (set! (-> s3-1 state) 0) + (set! (-> s3-1 damaged-low-smoke-part) (create-launch-control (-> *part-group-id-table* 1362) this)) + (set! (-> s3-1 damaged-high-smoke-part) (create-launch-control (-> *part-group-id-table* 1361) this)) + (set! (-> s3-1 damaged-left-spark-part) (create-launch-control (-> *part-group-id-table* 1378) this)) + (set! (-> s3-1 damaged-right-spark-part) (create-launch-control (-> *part-group-id-table* 1378) this)) + (set! (-> s3-1 machine-sound) (new-sound-id)) + (set! (-> s3-1 flags) (facboss-machine-state-flag fms1)) + (set! (-> s3-1 left-spark-timer) 0) + (set! (-> s3-1 right-spark-timer) 0) + (set! (-> s3-1 ring-timer) 0) + (let ((v1-47 s4-2)) + (cond + ((zero? v1-47) + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1363) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + ((= v1-47 1) + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1364) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + ((= v1-47 2) + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1365) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3b :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + (else + (set! (-> s3-1 ring-part) (create-launch-control (-> *part-group-id-table* 1366) this)) + (set! (-> s3-1 lightning) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #xff :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.72 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + ) + ) + ) + (let ((v1-68 (-> s3-1 lightning)) + (a0-41 0) + ) + (let ((a1-21 (!= a0-41 (-> v1-68 state mode)))) + (case a0-41 + ((3) + (if a1-21 + (set! (-> v1-68 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-68 state start-color) (-> v1-68 spec start-color)) + (set! (-> v1-68 state end-color) (-> v1-68 spec end-color)) + ) + ) + ) + (set! (-> v1-68 state mode) (the-as uint a0-41)) + ) + ) + ) + (set! (-> this chosen-machine) 0) + (let ((a0-43 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) + (if a0-43 + (change-to a0-43 this) + ) + ) + (set! (-> this catwalk-angle) 0.0) + (set! (-> this catwalk-vel) 0.0) + (set! (-> this bombs-to-drop) 0) + (set! (-> this root-angle) (+ 32768.0 (-> this catwalk-angle))) + (set! (-> this hits-taken) 0) + (set! (-> this camera-timer) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-76 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-76 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-76)) + ) + (else + (format 0 "ERROR: ~S: entity missing actor-groups!~%" (-> this name)) + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this num-floor-targets) 0) + (when (> (-> this actor-group-count) 0) + (let ((s5-1 (-> this actor-group (+ (-> this actor-group-count) -1)))) + (dotimes (s4-3 (-> s5-1 length)) + (process-spawn + fac-drop-plat-nocollide + (-> s5-1 data s4-3 actor) + :name "fac-drop-plat-nocollide" + :from *factory-boss-dead-pool* + :to this + ) + ) + ) + ) + (set! (-> this reticle-sound) (new-sound-id)) + (set! (-> this reticle-sound-playing) #f) + (let ((s5-2 (new 'stack-no-clear 'vector))) + (set! (-> s5-2 quad) (-> this center quad)) + (+! (-> s5-2 z) 141312.0) + (factory-boss-lightning-gate-method-11 (-> this warp-blocker) s5-2 28672.0 0.0 this) + (set! (-> s5-2 quad) (-> this center quad)) + (+! (-> s5-2 z) -141312.0) + (factory-boss-lightning-gate-method-11 (-> this entry-blocker) s5-2 28672.0 0.0 this) + ) + (set! (-> this draw force-lod) 1) + (go (method-of-object this hidden)) + ) + +;; definition of type hud-factory-boss +(deftype hud-factory-boss (hud) + () + ) + +;; definition for method 3 of type hud-factory-boss +(defmethod inspect ((this hud-factory-boss)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-factory-boss +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-factory-boss)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 472.0 (* 130.0 (-> this offset)))) + 160 + ) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) 0 0) + (let ((f30-0 (* 25.0 (the float (- 4 (-> this values 0 current)))))) + (set-as-offset-from! (-> this sprites 5) (the-as vector4w (-> this sprites)) 8 67) + (set! (-> this sprites 5 scale-x) (* 0.164 f30-0)) + (cond + ((< 50.0 f30-0) + (set! (-> this sprites 5 color x) (the int (lerp-scale 0.0 128.0 f30-0 100.0 50.0))) + (set! (-> this sprites 5 color y) (the int (lerp-scale 255.0 128.0 f30-0 100.0 50.0))) + (set! (-> this sprites 5 color z) 0) + 0 + ) + ((< 20.0 f30-0) + (set! (-> this sprites 5 color x) (the int (lerp-scale 128.0 255.0 f30-0 50.0 20.0))) + (set! (-> this sprites 5 color y) (the int (lerp-scale 128.0 0.0 f30-0 50.0 20.0))) + (set! (-> this sprites 5 color z) 0) + 0 + ) + (else + (set! (-> this sprites 5 color x) 255) + (set! (-> this sprites 5 color y) 0) + (set! (-> this sprites 5 color z) 0) + 0 + ) + ) + ) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 9 66) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) -51 66) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) 4 66) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-factory-boss +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-factory-boss)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-factory-boss +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-factory-boss)) + (set! (-> this level) (level-get *level* 'factoryd)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xab0))) + ) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 1 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x1 :page #xab0))) + ) + (set! (-> this sprites 1 scale-x) 1.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 5 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x3 :page #xab0))) + ) + (set! (-> this sprites 5 scale-x) 1.0) + (set! (-> this sprites 5 scale-y) 1.3) + (set! (-> this sprites 5 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 4 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xab0))) + ) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 1.0) + (set! (-> this sprites 4 flags) (hud-sprite-flags hsf0 hsf2)) + (set! (-> this sprites 3 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x4 :page #xab0))) + ) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 2 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :index #x5 :page #xab0))) + ) + (set! (-> this sprites 2 scale-x) 14.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set! (-> this sprites 2 flags) (hud-sprite-flags hsf2)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags shadow kerning right large)) + 0 + (none) + ) + +;; definition of type task-manager-factory-boss +(deftype task-manager-factory-boss (task-manager) + ((button-up symbol) + ) + (:methods + (task-manager-factory-boss-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-factory-boss +(defmethod inspect ((this task-manager-factory-boss)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tbutton-up: ~A~%" (-> this button-up)) + (label cfg-4) + this + ) + +;; definition for method 26 of type task-manager-factory-boss +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-factory-boss)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (if (>= (-> *game-info* counter) 3.0) + (set-setting! 'extra-bank '((factory7 factor10)) 0.0 0) + (remove-setting! 'extra-bank) + ) + (if (>= (-> *game-info* counter) 3.0) + (script-eval '(want-anim "factory-boss-res")) + ) + (if (= (-> *game-info* counter) 4.0) + (send-event this 'complete) + ) + (none) + ) + +;; definition for method 25 of type task-manager-factory-boss +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-factory-boss)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (none) + ) + +;; definition for method 21 of type task-manager-factory-boss +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-factory-boss)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-factory-boss :init hud-init-by-other :name "hud-factory-boss" :to this)) + ) + (set! (-> *game-info* counter) 0.0) + (set! (-> this button-up) #f) + (set-setting! 'string-min-height 'abs (meters 1) 0) + (set-setting! 'string-max-height 'abs (meters 1.5) 0) + (set-setting! 'fov 'abs (degrees 80.0) 0) + (set-setting! 'music 'factboss 0.0 0) + (none) + ) + +;; definition for function factoryd-login +(defun factoryd-login ((arg0 level)) + (set! *factory-boss-dead-pool* (new 'loading-level 'dead-pool 222 1560 "*factory-boss-dead-pool*")) + (set! (-> *factory-boss-dead-pool* clock) (-> *display* entity-clock)) + (set! *nav-network* (new 'loading-level 'nav-network)) + (alloc-nav-network-for-level! *nav-network* 64 10) + (none) + ) + +;; definition for function factoryd-logout +;; WARN: Return type mismatch int vs none. +(defun factoryd-logout ((arg0 level)) + (set! *factory-boss-dead-pool* #f) + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-warp-effect fac-warp-effect fac-warp-effect-lod0-jg fac-warp-effect-idle-ja + ((fac-warp-effect-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition of type fac-warp-effect +(deftype fac-warp-effect (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-warp-effect +(defmethod inspect ((this fac-warp-effect)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (fac-warp-effect) + :virtual #t + :code sleep-code + :post (behavior () + (ja :num! (loop!)) + (ja-post) + ) + ) + +;; definition for method 11 of type fac-warp-effect +(defmethod init-from-entity! ((this fac-warp-effect) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-warp-effect" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc new file mode 100644 index 0000000000..918f32805b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-boss-states_REF.gc @@ -0,0 +1,1866 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function factory-boss-angle-sub +;; WARN: Return type mismatch float vs degrees. +(defbehavior factory-boss-angle-sub factory-boss ((arg0 degrees) (arg1 degrees)) + (let* ((v1-1 (+ 65536.0 arg0)) + (v1-4 (- v1-1 (* (the float (the int (/ v1-1 65536.0))) 65536.0))) + (a0-2 (+ 65536.0 arg1)) + (a0-5 (- a0-2 (* (the float (the int (/ a0-2 65536.0))) 65536.0))) + (v0-0 (- v1-4 a0-5)) + ) + (cond + ((>= -32768.0 v0-0) + (set! v0-0 (+ 65536.0 v0-0)) + ) + ((< 32768.0 v0-0) + (set! v0-0 (+ -65536.0 v0-0)) + ) + ) + (the-as degrees v0-0) + ) + ) + +;; definition for function factory-boss-target-pos +;; INFO: Used lq/sq +(defbehavior factory-boss-target-pos factory-boss ((arg0 vector) (arg1 int) (arg2 int)) + (set! (-> arg0 quad) (-> (target-pos 0) quad)) + (set! (-> arg0 y) (-> self center y)) + (when (= arg1 1) + (let ((a0-3 (- (the-as int (- (current-time) (-> self shot-timer))))) + (v1-7 (vector-reset! (new 'stack-no-clear 'vector))) + ) + (let ((a1-3 (-> self actor-group (-> self floor-targets arg2)))) + (dotimes (a2-4 (-> a1-3 length)) + (vector+! v1-7 v1-7 (-> a1-3 data a2-4 actor extra trans)) + ) + (vector-float*! v1-7 v1-7 (/ 1.0 (the float (-> a1-3 length)))) + ) + (set! (-> v1-7 y) (-> self center y)) + (vector-! arg0 arg0 v1-7) + (vector+float*! arg0 v1-7 arg0 (fmax 0.0 (fmin 1.0 (* 0.008888889 (the float a0-3))))) + ) + ) + arg0 + ) + +;; definition for method 29 of type factory-boss +;; WARN: Return type mismatch vector vs none. +(defmethod factory-boss-method-29 ((this factory-boss) (arg0 float) (arg1 vector)) + (set! (-> arg1 x) (+ (-> this center x) (* 118784.0 (sin arg0)))) + (set! (-> arg1 y) (-> this root trans y)) + (set! (-> arg1 z) (+ (-> this center z) (* 118784.0 (cos arg0)))) + (none) + ) + +;; definition for function factory-boss-move +;; WARN: Return type mismatch quaternion vs none. +(defbehavior factory-boss-move factory-boss () + (+! (-> self catwalk-angle) (* (-> self catwalk-vel) (-> self clock time-adjust-ratio))) + (cond + ((>= (-> self catwalk-angle) 65536.0) + (+! (-> self catwalk-angle) -65536.0) + (+! (-> self root-angle) -65536.0) + ) + ((< (-> self catwalk-angle) 0.0) + (+! (-> self catwalk-angle) 65536.0) + (+! (-> self root-angle) 65536.0) + ) + ) + (factory-boss-method-29 self (-> self catwalk-angle) (-> self root trans)) + (cond + ((< (-> self catwalk-vel) 0.0) + (seek! + (-> self root-angle) + (+ 48969.957 (-> self catwalk-angle)) + (* 1820.4445 (-> self clock time-adjust-ratio)) + ) + ) + ((< 0.0 (-> self catwalk-vel)) + (seek! + (-> self root-angle) + (+ 16566.045 (-> self catwalk-angle)) + (* 1820.4445 (-> self clock time-adjust-ratio)) + ) + ) + (else + (seek! + (-> self root-angle) + (+ 32768.0 (-> self catwalk-angle)) + (* 1820.4445 (-> self clock time-adjust-ratio)) + ) + ) + ) + (quaternion-set! + (-> self root quat) + 0.0 + (sin (* 0.5 (-> self root-angle))) + 0.0 + (cos (* 0.5 (-> self root-angle))) + ) + (none) + ) + +;; definition for function factory-boss-pick-machine +;; WARN: Return type mismatch int vs none. +;; WARN: Function factory-boss-pick-machine has a return type of none, but the expression builder found a return statement. +(defbehavior factory-boss-pick-machine factory-boss () + (let ((gp-0 10000) + (a0-0 0) + ) + (dotimes (v1-0 4) + (cond + ((< (-> self machine-state v1-0 state) gp-0) + (set! gp-0 (-> self machine-state v1-0 state)) + (set! a0-0 1) + ) + ((= (-> self machine-state v1-0 state) gp-0) + (+! a0-0 1) + ) + ) + ) + (let ((v1-3 (rand-vu-int-count a0-0))) + (dotimes (a0-3 4) + (when (>= gp-0 (-> self machine-state a0-3 state)) + (when (<= v1-3 0) + (set! (-> self chosen-machine) a0-3) + (return 0) + ) + (+! v1-3 -1) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function factory-boss-pick-camera +;; WARN: Return type mismatch connection vs none. +(defbehavior factory-boss-pick-camera factory-boss () + (let ((v1-0 (-> self chosen-machine))) + (cond + ((zero? v1-0) + (set-setting! 'entity-name "camera-385" 0.0 0) + ) + ((= v1-0 1) + (set-setting! 'entity-name "camera-384" 0.0 0) + ) + ((= v1-0 2) + (set-setting! 'entity-name "camera-387" 0.0 0) + ) + ((= v1-0 3) + (set-setting! 'entity-name "camera-386" 0.0 0) + ) + ) + ) + (none) + ) + +;; definition for function factory-boss-pick-pers-camera +(defbehavior factory-boss-pick-pers-camera factory-boss () + (let ((v1-0 (-> self chosen-machine))) + (cond + ((zero? v1-0) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-385") + 0.0 + 0 + ) + ) + ((= v1-0 1) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-384") + 0.0 + 0 + ) + ) + ((= v1-0 2) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-387") + 0.0 + 0 + ) + ) + ((= v1-0 3) + (persist-with-delay + *setting-control* + 'entity-name + (seconds 3) + 'entity-name + (the-as symbol "camera-386") + 0.0 + 0 + ) + ) + ) + ) + (none) + ) + +;; definition for function factory-boss-machine-angle +(defbehavior factory-boss-machine-angle factory-boss () + (+ 8192.0 (* 16384.0 (the float (-> self chosen-machine)))) + ) + +;; definition for function factory-boss-approaching? +(defbehavior factory-boss-approaching? factory-boss ((arg0 degrees)) + (let ((f0-1 (factory-boss-angle-sub arg0 (-> self catwalk-angle)))) + (or (and (< (-> self catwalk-vel) 0.0) (>= 0.0 f0-1)) (and (< 0.0 (-> self catwalk-vel)) (>= f0-1 0.0))) + ) + ) + +;; definition for function factory-boss-move-to-dest-angle +(defbehavior factory-boss-move-to-dest-angle factory-boss ((arg0 float) (arg1 float)) + (if (= (-> self catwalk-angle) arg0) + (return #t) + ) + (cond + ((!= (-> self catwalk-vel) 0.0) + ) + ((< (factory-boss-angle-sub arg0 (-> self catwalk-angle)) 0.0) + (set! (-> self catwalk-vel) (- arg1)) + ) + (else + (set! (-> self catwalk-vel) arg1) + ) + ) + (let ((s5-1 (factory-boss-approaching? arg0))) + (factory-boss-move) + (when (and s5-1 (not (factory-boss-approaching? arg0))) + (set! (-> self catwalk-vel) 0.0) + (set! (-> self catwalk-angle) arg0) + (return #t) + ) + ) + #f + ) + +;; definition for method 28 of type factory-boss +(defmethod next-catwalk-angle ((this factory-boss) (arg0 int)) + (+ (-> this catwalk-angle) (* 0.2 (the float arg0) (-> this catwalk-vel))) + ) + +;; definition for function factory-boss-time-until-angle +;; WARN: Return type mismatch int vs time-frame. +(defbehavior factory-boss-time-until-angle factory-boss ((arg0 degrees)) + (the-as time-frame (cond + ((= (-> self catwalk-angle) arg0) + 0 + ) + ((= (-> self catwalk-vel) 0.0) + #x7530 + ) + (else + (let ((f0-3 (factory-boss-angle-sub arg0 (-> self catwalk-angle)))) + (the int (* 5.0 (/ f0-3 (-> self catwalk-vel)))) + ) + ) + ) + ) + ) + +;; definition for function factory-boss-get-particle-spawn-points +;; WARN: Return type mismatch int vs none. +(defbehavior factory-boss-get-particle-spawn-points factory-boss ((arg0 int) (arg1 vector) (arg2 vector) (arg3 matrix)) + (factory-boss-method-26 self arg0 arg1 arg2 #f) + (vector-! (-> arg3 fvec) (-> self center) arg1) + (set! (-> arg3 fvec y) 0.0) + (vector-normalize! (-> arg3 fvec) 1.0) + (set! (-> arg3 fvec w) 0.0) + (set-vector! (-> arg3 rvec) (-> arg3 fvec z) 0.0 (- (-> arg3 fvec x)) 0.0) + (set-vector! (-> arg3 uvec) 0.0 1.0 0.0 0.0) + (vector+float*! arg2 arg1 (-> arg3 fvec) 0.0) + (+! (-> arg2 y) 106496.0) + 0 + (none) + ) + +;; definition for function factory-boss-drop-bomb +;; INFO: Used lq/sq +(defbehavior factory-boss-drop-bomb factory-boss ((arg0 int)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (vector<-cspace! s3-0 (joint-node errol-lowres-lod0-jg Lhand)) + (factory-boss-target-pos s4-0 arg0 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) (-> s3-0 quad)) + (set! (-> gp-0 vel quad) (-> s4-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 handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-11 *game-info*) + (a0-11 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-11) + (set! (-> gp-0 attack-id) a0-11) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (factory-boss-play-speech 1 self) + (cond + ((= arg0 1) + (+! (-> self bombs-to-drop) -1) + (let ((v1-16 (ppointer->process (spawn-projectile factory-boss-floorbuster-bomb gp-0 self *default-dead-pool*)))) + (when v1-16 + (set! (-> (the-as factory-boss-floorbuster-bomb v1-16) targetted-group) (-> self floor-targets 0)) + (+! (-> self num-floor-targets) -1) + (dotimes (v1-20 (-> self num-floor-targets)) + (set! (-> self floor-targets v1-20) (-> self floor-targets (+ v1-20 1))) + ) + (the-as (pointer process) #f) + ) + ) + ) + ((= arg0 2) + (+! (-> self bombs-to-drop) -1) + (spawn-projectile factory-boss-shockwave-bomb gp-0 self *default-dead-pool*) + ) + (else + (+! (-> self bombs-to-drop) -1) + (spawn-projectile factory-boss-shot gp-0 self *default-dead-pool*) + ) + ) + ) + ) + +;; definition for function factory-boss-check-bomb-timer +(defbehavior factory-boss-check-bomb-timer factory-boss ((arg0 int)) + (let ((s5-0 (>= (- (current-time) (+ (-> self shot-timer) (seconds -0.75))) 0))) + (let ((v1-5 (ja-group))) + (cond + ((and v1-5 (or (= v1-5 errol-lowres-run-cw-ja) + (= v1-5 errol-lowres-run-ccw-ja) + (= v1-5 errol-lowres-idle-to-run-cw-ja) + (= v1-5 errol-lowres-idle-to-run-ccw-ja) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-run-to-idle-ja :num! min) + (set! s5-0 #f) + ) + ((let ((v1-16 (ja-group))) + (and v1-16 (= v1-16 errol-lowres-run-to-idle-ja)) + ) + (set! s5-0 #f) + (ja :num! (seek!)) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle30-ja :num! min) + (set! (-> self shot-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 4.0))))) + ) + ) + ((let ((v1-39 (ja-group))) + (and v1-39 (= v1-39 errol-lowres-idle-throw-ja)) + ) + (let ((f30-1 (ja-aframe-num 0))) + (ja :num! (seek!)) + (when (>= (ja-aframe-num 0) 59.0) + (if (or (zero? (-> self bombs-to-drop)) (!= arg0 1)) + (set! s5-0 #f) + ) + (if (or (< f30-1 59.0) (and (> (-> self bombs-to-drop) 0) (= arg0 1))) + (factory-boss-drop-bomb arg0) + ) + ) + ) + (when (ja-done? 0) + (ja-channel-push! 1 (seconds 0.1)) + (if (or (zero? (-> self bombs-to-drop)) (nonzero? arg0)) + (ja :group! errol-lowres-idle30-ja :num! min) + (ja :group! errol-lowres-idle-throw-ja :num! min) + ) + (cond + ((= arg0 2) + (set! (-> self shot-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.5 3.5))))) + ) + (else + (set! (-> self shot-timer) 0) + 0 + ) + ) + (return #t) + ) + ) + ((and (>= (- (current-time) (+ (-> self shot-timer) (seconds -1))) 0) (nonzero? (-> self bombs-to-drop))) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-throw-ja :num! min) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + (cond + (s5-0 + (let ((s5-4 0)) + (while (let ((v1-107 arg0)) + (< s5-4 (if (= v1-107 1) + (-> self bombs-to-drop) + 1 + ) + ) + ) + (let ((s4-3 (factory-boss-target-pos (new 'stack-no-clear 'vector) arg0 s5-4))) + (factory-boss-reticle-info-method-10 + (-> self reticle-info) + s4-3 + (-> self root trans) + (max 1 (- (the-as int (- (current-time) (-> self shot-timer))))) + arg0 + ) + (when (zero? s5-4) + (sound-play "reticle-track" :id (-> self reticle-sound) :position s4-3) + (set! (-> self reticle-sound-playing) #t) + ) + ) + (+! s5-4 1) + ) + ) + ) + (else + (factory-boss-method-30 self) + ) + ) + ) + #f + ) + +;; definition for function factory-boss-end-cutscene +;; WARN: Return type mismatch int vs none. +(defbehavior factory-boss-end-cutscene factory-boss () + (if (not (movie?)) + (process-release? *target*) + ) + (remove-setting! 'entity-name) + (set! (-> self camera-timer) 0) + (set! (-> self draw force-lod) 1) + (none) + ) + +;; definition for function factory-boss-spawn-ring +;; INFO: Used lq/sq +(defbehavior factory-boss-spawn-ring factory-boss ((arg0 matrix) (arg1 vector) (arg2 factory-boss-machine-state)) + (let ((v1-0 (new 'stack-no-clear 'vector))) + (vector+float*! v1-0 arg1 (-> arg0 uvec) 14336.0) + (vector+float*! v1-0 v1-0 (-> arg0 fvec) 7168.0) + (set! (-> arg0 trans quad) (-> v1-0 quad)) + ) + (spawn-from-mat (-> arg2 ring-part) arg0) + (none) + ) + +;; definition for function factory-boss-always +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 352 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 368 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 384 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 400 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 272 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 288 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 320 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 336 mismatch: defined as size 4, got size 16 +;; WARN: Return type mismatch symbol vs none. +(defbehavior factory-boss-always factory-boss () + (local-vars + (sv-256 (function float float float float float float)) + (sv-272 float) + (sv-288 float) + (sv-304 (function float float float float float float)) + (sv-320 float) + (sv-336 float) + (sv-352 float) + (sv-368 float) + (sv-384 float) + (sv-400 float) + ) + (factory-boss-play-speech 0 self) + (if (and (nonzero? (-> self camera-timer)) (time-elapsed? (-> self camera-timer) (seconds 3))) + (factory-boss-end-cutscene) + ) + (cond + ((and (-> self next-state) (let ((v1-9 (-> self next-state name))) + (or (= v1-9 'run-to-machine) + (= v1-9 'get-hit) + (= v1-9 'launch-critters) + (= v1-9 'drop-bombs) + (= v1-9 'beaten) + ) + ) + ) + (init! (-> self warp-blocker) (the-as int self)) + (init! (-> self entry-blocker) (the-as int self)) + ) + (else + (disable (-> self warp-blocker)) + (disable (-> self entry-blocker)) + ) + ) + (dotimes (gp-0 4) + (let ((s5-0 (-> self machine-state gp-0)) + (s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'matrix)) + ) + (factory-boss-get-particle-spawn-points gp-0 s4-0 s0-0 s2-0) + (let ((f1-0 2.5)) + (when (zero? (-> s5-0 state)) + (let ((f0-1 (* 0.0033333334 (the float (current-time))))) + (set! f1-0 (the float (the int (* 5.9999 (- f0-1 (the float (the int f0-1))))))) + ) + ) + (let ((f0-6 (+ 14745.6 (* 2048.0 f1-0)))) + (let ((f1-5 (+ 6553.6 (* 2048.0 f1-0)))) + (vector+float*! s1-0 s0-0 (-> s2-0 rvec) f0-6) + (vector+float*! s1-0 s1-0 (-> s2-0 uvec) f1-5) + ) + (vector+float*! s1-0 s1-0 (-> s2-0 fvec) -4096.0) + (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (vector+float*! s3-0 s1-0 (-> s2-0 rvec) (* -2.0 f0-6)) + ) + ) + (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (if (logtest? (-> s5-0 flags) (facboss-machine-state-flag fms1)) + (factory-boss-spawn-ring s2-0 s4-0 s5-0) + ) + (cond + ((zero? (-> s5-0 state)) + (let ((v1-45 (-> s5-0 lightning state mode))) + (when (or (zero? v1-45) (= v1-45 3)) + (let ((v1-47 (-> s5-0 lightning)) + (a0-23 1) + ) + (let ((a1-14 (!= a0-23 (-> v1-47 state mode)))) + (case a0-23 + ((3) + (if a1-14 + (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-23)) + ) + ) + ) + (set! (-> s5-0 lightning state meet data 0 quad) (-> s1-0 quad)) + (let ((v1-51 (-> s5-0 lightning))) + (set! (-> v1-51 state meet data (+ (-> v1-51 state points-to-draw) -1) quad) (-> s3-0 quad)) + ) + ) + (else + (let ((v1-55 (-> s5-0 lightning state mode))) + (cond + ((or (zero? v1-55) (= v1-55 3)) + ) + (else + (let ((v1-57 (-> s5-0 lightning)) + (a0-32 3) + ) + (let ((a1-24 (!= a0-32 (-> v1-57 state mode)))) + (case a0-32 + ((3) + (if a1-24 + (set! (-> v1-57 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-57 state start-color) (-> v1-57 spec start-color)) + (set! (-> v1-57 state end-color) (-> v1-57 spec end-color)) + ) + ) + ) + (set! (-> v1-57 state mode) (the-as uint a0-32)) + ) + ) + ) + ) + (set! (-> s2-0 trans quad) (-> s4-0 quad)) + (spawn-from-mat (-> s5-0 damaged-low-smoke-part) s2-0) + (set! (-> s2-0 trans quad) (-> s0-0 quad)) + (spawn-from-mat (-> s5-0 damaged-high-smoke-part) s2-0) + (cond + ((< (- (current-time) (-> s5-0 ring-timer)) 0) + ) + ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms1)) + (let ((s0-1 (current-time)) + (f30-0 300.0) + ) + (set! sv-256 lerp-scale) + (set! sv-272 (the-as float 0.05)) + (set! sv-288 (the-as float 0.15)) + (let* ((v1-73 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-74 (the-as number (logior #x3f800000 v1-73))) + (a2-6 (+ -1.0 (the-as float v1-74))) + (a3-5 0.0) + (t0-0 1.0) + ) + (set! (-> s5-0 ring-timer) (+ s0-1 (the int (* f30-0 (sv-256 sv-272 sv-288 a2-6 a3-5 t0-0))))) + ) + ) + (logclear! (-> s5-0 flags) (facboss-machine-state-flag fms1)) + ) + (else + (let ((s0-2 (current-time)) + (f30-1 300.0) + ) + (set! sv-304 lerp-scale) + (set! sv-320 (the-as float 0.01)) + (set! sv-336 (the-as float 0.2)) + (let* ((v1-84 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-85 (the-as number (logior #x3f800000 v1-84))) + (a2-7 (+ -1.0 (the-as float v1-85))) + (a3-6 0.0) + (t0-1 1.0) + ) + (set! (-> s5-0 ring-timer) (+ s0-2 (the int (* f30-1 (sv-304 sv-320 sv-336 a2-7 a3-6 t0-1))))) + ) + ) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms1)) + ) + ) + (cond + ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms2)) + (set! (-> s2-0 trans quad) (-> s1-0 quad)) + (spawn-from-mat (-> s5-0 damaged-left-spark-part) s2-0) + (when (>= (- (current-time) (-> s5-0 left-spark-timer)) 0) + (let ((s1-1 (current-time)) + (f30-2 300.0) + (s0-3 lerp-scale) + ) + (set! sv-352 (the-as float 0.3)) + (set! sv-368 (the-as float 0.7)) + (let* ((v1-103 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-104 (the-as number (logior #x3f800000 v1-103))) + (a2-8 (+ -1.0 (the-as float v1-104))) + (a3-7 0.0) + (t0-2 1.0) + ) + (set! (-> s5-0 left-spark-timer) (+ s1-1 (the int (* f30-2 (s0-3 sv-352 sv-368 a2-8 a3-7 t0-2))))) + ) + ) + (logclear! (-> s5-0 flags) (facboss-machine-state-flag fms2)) + ) + ) + ((>= (- (current-time) (-> s5-0 left-spark-timer)) 0) + (let ((s1-2 (current-time)) + (f30-3 300.0) + (s0-4 lerp-scale) + ) + (set! sv-384 (the-as float 0.2)) + (set! sv-400 (the-as float 0.4)) + (let* ((v1-117 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-118 (the-as number (logior #x3f800000 v1-117))) + (a2-9 (+ -1.0 (the-as float v1-118))) + (a3-8 0.0) + (t0-3 1.0) + ) + (set! (-> s5-0 left-spark-timer) (+ s1-2 (the int (* f30-3 (s0-4 sv-384 sv-400 a2-9 a3-8 t0-3))))) + ) + ) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms2)) + ) + ) + (cond + ((logtest? (-> s5-0 flags) (facboss-machine-state-flag fms3)) + (set! (-> s2-0 trans quad) (-> s3-0 quad)) + (spawn-from-mat (-> s5-0 damaged-right-spark-part) s2-0) + (when (>= (- (current-time) (-> s5-0 right-spark-timer)) 0) + (let* ((s3-1 (current-time)) + (f30-4 300.0) + (s2-1 lerp-scale) + (s1-3 0.3) + (s0-5 0.7) + (v1-134 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-135 (the-as number (logior #x3f800000 v1-134))) + ) + (set! (-> s5-0 right-spark-timer) + (+ s3-1 (the int (* f30-4 (s2-1 s1-3 s0-5 (+ -1.0 (the-as float v1-135)) 0.0 1.0)))) + ) + ) + (logclear! (-> s5-0 flags) (facboss-machine-state-flag fms3)) + ) + ) + ((>= (- (current-time) (-> s5-0 right-spark-timer)) 0) + (let* ((s3-2 (current-time)) + (f30-5 300.0) + (s2-2 lerp-scale) + (s1-4 0.2) + (s0-6 0.4) + (v1-146 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-147 (the-as number (logior #x3f800000 v1-146))) + ) + (set! (-> s5-0 right-spark-timer) + (+ s3-2 (the int (* f30-5 (s2-2 s1-4 s0-6 (+ -1.0 (the-as float v1-147)) 0.0 1.0)))) + ) + ) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms3)) + ) + ) + (sound-play "steam-vent" :id (-> s5-0 machine-sound) :position s4-0) + (logior! (-> s5-0 flags) (facboss-machine-state-flag fms0)) + ) + ) + ) + ) + (dotimes (gp-1 8) + (let* ((s5-1 (-> self critter gp-1)) + (s4-1 (handle->process (-> s5-1 handle))) + ) + (when s4-1 + (when (not (logtest? (-> s5-1 flags) (facboss-critter-tracker-flag fct1))) + (send-event s4-1 'change-nav-mesh (-> self hits-taken)) + (if (send-event s4-1 'jump 2 (-> s5-1 dest)) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct1)) + ) + ) + (when (not (logtest? (-> s5-1 flags) (facboss-critter-tracker-flag fct2))) + (if (send-event s4-1 'enable-envmap #f) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct2)) + ) + ) + (when (and (not (logtest? (-> s5-1 flags) (facboss-critter-tracker-flag fct0))) + (and (-> s4-1 next-state) + (let ((v1-193 (-> s4-1 next-state name))) + (or (= v1-193 'die) (= v1-193 'die-falling) (= v1-193 'lift-off) (= v1-193 'explode)) + ) + ) + (< (vector-vector-xz-distance (-> (the-as process-drawable s4-1) root trans) (-> self center)) 122880.0) + ) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct0)) + (dotimes (s3-3 10) + (when (not (handle->process (-> self ammo s3-3))) + (let ((s2-3 (new 'static 'fact-info))) + (set! (-> (new 'stack-no-clear 'vector) quad) (-> (the-as process-drawable s4-1) root trans quad)) + (set-vector! (new 'stack-no-clear 'vector) 0.0 57001.605 0.0 1.0) + (set! (-> s2-3 options) (actor-option fade-out fall no-distance-check-fadeout)) + (set! (-> s2-3 fade-time) (seconds 10)) + (set! (-> s2-3 pickup-spawn-amount) 1.0) + (let* ((v1-210 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-211 (the-as number (logior #x3f800000 v1-210))) + ) + (cond + ((< (+ -1.0 (the-as float v1-211)) 0.9) + (set! (-> s2-3 pickup-type) (pickup-type ammo-random)) + (set! (-> s2-3 pickup-amount) 10.0) + ) + (else + (set! (-> s2-3 pickup-amount) (-> *FACT-bank* health-small-inc)) + (set! (-> s2-3 pickup-type) (pickup-type health)) + ) + ) + ) + (set! (-> s2-3 process) s4-1) + (set! (-> self ammo s3-3) (ppointer->handle (drop-pickup s2-3 #t *entity-pool* (the-as fact-info #f) 0 #t))) + ) + 0 + (goto cfg-122) + ) + ) + ) + (label cfg-122) + (when (< (-> (the-as process-drawable s4-1) root trans y) (+ -81920.0 (-> self center y))) + (logior! (-> s5-1 flags) (facboss-critter-tracker-flag fct0)) + (send-event s4-1 'die-fast) + ) + ) + ) + ) + (none) + ) + +;; definition for function factory-boss-always-handler +(defbehavior factory-boss-always-handler factory-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('complete) + (go-virtual beaten) + ) + (('in-cutscene?) + (and *target* (nonzero? (-> self camera-timer))) + ) + (('round?) + (and (and (-> self next-state) (= (-> self next-state name) 'launch-critters)) + (>= (-> self current-round) (the-as int (+ (-> arg3 param 0) -1))) + ) + ) + ) + ) + +;; definition for function factory-boss-handler +;; WARN: disable def twice: 10. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defbehavior factory-boss-handler factory-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-1 object)) + (case arg2 + (('child-jumped) + (let* ((gp-0 arg0) + (v1-1 (if (type? gp-0 nav-enemy) + gp-0 + ) + ) + ) + (when v1-1 + (set! v0-1 (logclear (-> (the-as nav-enemy v1-1) enemy-flags) (enemy-flag directed))) + (set! (-> (the-as nav-enemy v1-1) enemy-flags) (the-as enemy-flag v0-1)) + v0-1 + ) + ) + ) + (('fall?) + (let ((v1-2 (-> arg3 param 0)) + (a0-3 (-> arg3 param 1)) + ) + (set! v0-1 #f) + (when (and (>= (the-as int a0-3) 0) (< (the-as int a0-3) (+ (-> self actor-group-count) -1))) + (let ((gp-1 (-> self actor-group a0-3))) + (dotimes (a0-6 (-> gp-1 length)) + (when (= (-> gp-1 data a0-6 actor) v1-2) + (dotimes (s5-0 (-> gp-1 length)) + (let ((a1-12 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-12 from) (process->ppointer self)) + (set! (-> a1-12 num-params) 0) + (set! (-> a1-12 message) 'fall!) + (let ((t9-1 send-event-function) + (v1-7 (-> gp-1 data s5-0 actor)) + ) + (t9-1 + (if v1-7 + (-> v1-7 extra process) + ) + a1-12 + ) + ) + ) + ) + (set! v0-1 #t) + 0 + (goto cfg-25) + ) + ) + ) + ) + ) + (label cfg-25) + v0-1 + ) + (('draw-reticle) + (factory-boss-reticle-info-method-10 + (-> self reticle-info) + (the-as vector (-> arg3 param 0)) + (the-as vector (-> arg3 param 1)) + 0 + (the-as int (-> arg3 param 2)) + ) + ) + (else + (factory-boss-always-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition of type factory-boss-command +(deftype factory-boss-command (structure) + ((action facboss-cmd) + (suck float) + (random float) + (round int8) + ) + ) + +;; definition for method 3 of type factory-boss-command +(defmethod inspect ((this factory-boss-command)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-boss-command) + (format #t "~1Taction: ~D~%" (-> this action)) + (format #t "~1Tsuck: ~f~%" (-> this suck)) + (format #t "~1Trandom: ~f~%" (-> this random)) + (format #t "~1Tround: ~D~%" (-> this round)) + (label cfg-4) + this + ) + +;; definition for symbol *factory-boss-swarm-0*, type (array factory-boss-command) +(define *factory-boss-swarm-0* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd8) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +;; definition for symbol *factory-boss-swarm-1*, type (array factory-boss-command) +(define *factory-boss-swarm-1* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.3 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.6 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +;; definition for symbol *factory-boss-swarm-2*, type (array factory-boss-command) +(define *factory-boss-swarm-2* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd9) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.25 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.75 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +;; definition for symbol *factory-boss-swarm-3*, type (array factory-boss-command) +(define *factory-boss-swarm-3* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd8) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.75 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd1) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.3 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.6 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd4) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd3) :suck 0.5 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.25 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.75 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +;; definition for symbol *factory-boss-swarm-4*, type (array factory-boss-command) +(define *factory-boss-swarm-4* + (new 'static 'boxed-array :type factory-boss-command + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd8) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd5) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd19) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd5) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd9) :suck 0.25 :random 1.0 :round 1) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd9) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd6) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 1.0 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.25 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.5 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd2) :suck 0.75 :random 1.0) + (new 'static 'factory-boss-command :action (facboss-cmd cmd7) :suck 1.0 :random 1.0) + ) + ) + +;; definition for function factory-boss-launch-critter-handler +;; INFO: Used lq/sq +(defbehavior factory-boss-launch-critter-handler factory-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('gonna-getcha) + (format *stdebug* "gonna-getcha~%") + (cond + ((= (-> *game-info* counter) 3.0) + (send-event self 'gotcha) + ) + ((zero? (-> self camera-timer)) + (set-time! (-> self camera-timer)) + (process-grab? *target* #f) + (set! (-> self draw force-lod) 0) + (let ((v1-10 (-> self chosen-machine))) + (cond + ((zero? v1-10) + (set-setting! 'entity-name "camera-414" 0.0 0) + ) + ((= v1-10 1) + (set-setting! 'entity-name "camera-415" 0.0 0) + ) + ((= v1-10 2) + (set-setting! 'entity-name "camera-417" 0.0 0) + ) + ((= v1-10 3) + (set-setting! 'entity-name "camera-416" 0.0 0) + ) + ) + ) + ) + ) + ) + (('gotcha) + (let ((v1-18 (-> self machine-state (-> self chosen-machine)))) + (+! (-> v1-18 state) 1) + (when (>= (-> v1-18 state) 2) + (let ((a1-8 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (factory-boss-get-particle-spawn-points (-> self chosen-machine) a1-8 s5-0 gp-0) + (set! (-> gp-0 trans quad) (-> s5-0 quad)) + (if (logtest? (-> *part-group-id-table* 1367 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1367) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 1367) :mat-joint gp-0) + ) + ) + ) + ) + (let ((gp-1 (the-as (pointer process-tree) (-> self child)))) + (while gp-1 + (send-event (ppointer->process gp-1) 'lift-off) + (set! gp-1 (-> gp-1 0 brother)) + ) + ) + (+! (-> self hits-taken) 1) + (set! (-> *game-info* counter) (the float (-> self hits-taken))) + (if (= (-> *game-info* counter) 4.0) + (go-virtual beaten) + (go-virtual get-hit) + ) + #t + ) + (else + (factory-boss-handler arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for function factory-boss-advance-launch-script +;; WARN: Return type mismatch time-frame vs none. +(defbehavior factory-boss-advance-launch-script factory-boss () + (+! (-> self command-index) 1) + (set-time! (-> self command-timer)) + (none) + ) + +;; definition for function factory-boss-check-launch-script +(defbehavior factory-boss-check-launch-script factory-boss () + (local-vars (v1-20 facboss-cmd)) + (let ((v1-0 *factory-boss-swarm-4*)) + (let ((a0-0 (-> self hits-taken))) + (cond + ((zero? a0-0) + (set! v1-0 *factory-boss-swarm-0*) + ) + ((= a0-0 1) + (set! v1-0 *factory-boss-swarm-1*) + ) + ((= a0-0 2) + (set! v1-0 *factory-boss-swarm-2*) + ) + ) + ) + (when (>= (-> self command-index) (-> v1-0 length)) + (set! (-> self command-index) 0) + (+! (-> self current-round) 1) + ) + (let ((gp-0 (-> v1-0 (-> self command-index)))) + (cond + ((or (and (>= (-> gp-0 suck) 0.0) (< (-> gp-0 suck) (you-suck-scale *game-info* #f 0))) + (and (< (-> gp-0 suck) 0.0) (>= (- (-> gp-0 suck)) (you-suck-scale *game-info* #f 0))) + ) + (factory-boss-advance-launch-script) + 7 + ) + ((or (and (> (-> gp-0 round) 0) (>= (-> self current-round) (-> gp-0 round))) + (and (<= (-> gp-0 round) 0) (< (-> self current-round) (- (-> gp-0 round)))) + ) + (factory-boss-advance-launch-script) + 7 + ) + (else + (let* ((f30-2 (-> gp-0 random)) + (v1-17 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-18 (the-as number (logior #x3f800000 v1-17))) + ) + (cond + ((< f30-2 (+ -1.0 (the-as float v1-18))) + (factory-boss-advance-launch-script) + 7 + ) + ((begin (set! v1-20 (-> gp-0 action)) (or (= v1-20 (facboss-cmd cmd7)) + (= v1-20 (facboss-cmd cmd8)) + (= v1-20 (facboss-cmd cmd9)) + (= v1-20 (facboss-cmd cmd10)) + (= v1-20 (facboss-cmd cmd11)) + (= v1-20 (facboss-cmd cmd12)) + (= v1-20 (facboss-cmd cmd13)) + (= v1-20 (facboss-cmd cmd14)) + (= v1-20 (facboss-cmd cmd15)) + (= v1-20 (facboss-cmd cmd16)) + (= v1-20 (facboss-cmd cmd17)) + ) + ) + (let ((v1-21 0)) + (dotimes (a0-32 8) + (if (handle->process (-> self critter a0-32 handle)) + (+! v1-21 1) + ) + ) + (when (>= (the-as int (+ (-> gp-0 action) -7)) v1-21) + (case (-> gp-0 action) + (((facboss-cmd cmd7)) + (factory-boss-play-speech 5 self) + ) + ) + (factory-boss-advance-launch-script) + ) + ) + 7 + ) + ((or (= v1-20 (facboss-cmd cmd18)) + (= v1-20 (facboss-cmd cmd19)) + (= v1-20 (facboss-cmd cmd20)) + (= v1-20 (facboss-cmd cmd21)) + ) + (let* ((v1-29 (+ (-> gp-0 action) -18)) + (a0-44 (shl 1 (the-as int v1-29))) + ) + (if (time-elapsed? (-> self command-timer) (the int (* 300.0 (the float a0-44)))) + (factory-boss-advance-launch-script) + ) + ) + 7 + ) + (else + (the-as int (-> gp-0 action)) + ) + ) + ) + ) + ) + ) + ) + ) + +;; definition for function factory-boss-launch-critter +;; INFO: Used lq/sq +(defbehavior factory-boss-launch-critter factory-boss ((arg0 int)) + (case arg0 + ((7) + ) + (else + (dotimes (s2-0 8) + (let ((s5-0 (-> self critter s2-0))) + (when (not (handle->process (-> s5-0 handle))) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'enemy-init-by-other-params)) + ) + (when (factory-boss-method-26 + self + (-> self chosen-machine) + gp-0 + (-> s5-0 dest) + (the-as symbol (-> self launching-group)) + ) + (set! (-> s5-0 flags) (facboss-critter-tracker-flag)) + (set! (-> s4-0 trans quad) (-> gp-0 quad)) + (quaternion-copy! (-> s4-0 quat) (-> self root quat)) + (set! (-> s4-0 entity) (-> self entity)) + (set! (-> s4-0 directed?) #t) + (set! (-> s4-0 no-initial-move-to-ground?) #t) + (set! (-> s4-0 art-level) #f) + (let ((v1-16 arg0)) + (cond + ((= v1-16 1) + (let ((s3-1 (get-process *default-dead-pool* roboguard #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-1 + (let ((t9-3 (method-of-type process activate))) + (t9-3 s3-1 self "roboguard" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-1 enemy-init-by-other self s4-0) + (-> s3-1 ppointer) + ) + ) + ) + ) + ) + ((zero? v1-16) + (let ((s3-2 (get-process *default-dead-pool* spydroid-orig #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-2 + (let ((t9-6 (method-of-type process activate))) + (t9-6 s3-2 self "spydroid-orig" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-2 enemy-init-by-other self s4-0) + (-> s3-2 ppointer) + ) + ) + ) + ) + ) + ((= v1-16 2) + (let ((s3-3 (get-process *default-dead-pool* missile-bot #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-3 + (let ((t9-9 (method-of-type process activate))) + (t9-9 s3-3 self "missile-bot" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-3 enemy-init-by-other self s4-0) + (-> s3-3 ppointer) + ) + ) + ) + ) + (let ((s4-1 (handle->process (-> s5-0 handle)))) + (when s4-1 + (factory-boss-pick-pers-camera) + (send-event s4-1 'change-nav-mesh (-> self hits-taken)) + (if (send-event s4-1 'jump 2 (-> s5-0 dest)) + (logior! (-> s5-0 flags) (facboss-critter-tracker-flag fct1)) + ) + ) + ) + ) + ((= v1-16 3) + (let ((s3-4 (get-process *default-dead-pool* kg-grunt #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-4 + (let ((t9-15 (method-of-type process activate))) + (t9-15 s3-4 self "kg-grunt" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-4 enemy-init-by-other self s4-0) + (-> s3-4 ppointer) + ) + ) + ) + ) + ) + ((= v1-16 4) + (set! (-> s4-0 directed?) #f) + (let ((s3-5 (get-process *default-dead-pool* robo-hover #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-5 + (let ((t9-18 (method-of-type process activate))) + (t9-18 s3-5 self "robo-hover" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-5 enemy-init-by-other self s4-0) + (-> s3-5 ppointer) + ) + ) + ) + ) + (logior! (-> s5-0 flags) (facboss-critter-tracker-flag fct1)) + ) + ((= v1-16 5) + (set! (-> s4-0 directed?) #f) + (let ((s3-6 (get-process *default-dead-pool* neo-wasp #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-6 + (let ((t9-21 (method-of-type process activate))) + (t9-21 s3-6 self "neo-wasp" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-6 enemy-init-by-other self s4-0) + (-> s3-6 ppointer) + ) + ) + ) + ) + (logior! (-> s5-0 flags) (facboss-critter-tracker-flag fct1)) + ) + ((= v1-16 6) + (let ((s3-7 (get-process *default-dead-pool* dp-bipedal #x4000 1))) + (set! (-> s5-0 handle) (ppointer->handle (when s3-7 + (let ((t9-24 (method-of-type process activate))) + (t9-24 s3-7 self "dp-bipedal" (the-as pointer #x70004000)) + ) + (run-now-in-process s3-7 enemy-init-by-other self s4-0) + (-> s3-7 ppointer) + ) + ) + ) + ) + ) + (else + (format 0 "~A can't launch unknown critter type ~D~%" (-> self name) arg0) + (return #t) + ) + ) + ) + (cond + ((handle->process (-> s5-0 handle)) + (let ((s4-2 (new 'stack-no-clear 'matrix))) + (vector-! (-> s4-2 uvec) (-> s5-0 dest) gp-0) + (set! (-> s4-2 uvec y) 0.0) + (vector-normalize! (-> s4-2 uvec) 1.0) + (set! (-> s4-2 uvec w) 0.0) + (set-vector! (-> s4-2 fvec) 0.0 1.0 0.0 0.0) + (vector-cross! (-> s4-2 rvec) (-> s4-2 uvec) (-> s4-2 fvec)) + (set! (-> s4-2 rvec w) 0.0) + (set! (-> s4-2 trans quad) (-> gp-0 quad)) + (+! (-> s4-2 trans y) 8192.0) + (set! (-> s4-2 trans w) 1.0) + (if (logtest? (-> *part-group-id-table* 1377 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 1377) + :duration (seconds 1) + :mat-joint s4-2 + ) + (part-tracker-spawn + part-tracker + :to *entity-pool* + :group (-> *part-group-id-table* 1377) + :duration (seconds 1) + :mat-joint s4-2 + ) + ) + ) + (return #t) + ) + (else + (return #f) + ) + ) + (the-as none 0) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate beaten (factory-boss) + :virtual #t + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (dotimes (gp-0 8) + (let* ((s5-0 (handle->process (-> self critter gp-0 handle))) + (a0-5 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (if a0-5 + (send-event a0-5 'die-fast) + ) + ) + ) + (let ((gp-1 (the-as (pointer process-tree) (-> self child)))) + (while gp-1 + (let ((a0-6 (-> (the-as (pointer process) gp-1) 0 entity)) + (s5-1 gp-1) + ) + (set! gp-1 (-> gp-1 0 brother)) + (if (and a0-6 (nonzero? (res-lump-value a0-6 'drop-from-movie uint128 :time -1000000000.0))) + (deactivate (-> s5-1 0)) + ) + ) + ) + ) + (disable (-> self warp-blocker)) + (disable (-> self entry-blocker)) + (factory-boss-end-cutscene) + (ja-post) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate run-to-machine (factory-boss) + :virtual #t + :event factory-boss-handler + :enter (behavior () + (factory-boss-pick-machine) + ) + :trans (behavior () + (factory-boss-always) + (if (factory-boss-move-to-dest-angle (factory-boss-machine-angle) 145.63556) + (go-virtual drop-bombs) + ) + (let ((v1-6 (ja-group))) + (cond + ((and v1-6 (or (= v1-6 errol-lowres-run-cw-ja) (= v1-6 errol-lowres-run-ccw-ja))) + (ja :num! (loop!)) + ) + ((let ((v1-14 (ja-group))) + (and v1-14 (= v1-14 errol-lowres-idle-to-run-ccw-ja)) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! errol-lowres-run-ccw-ja :num! min) + ) + ) + ((let ((v1-31 (ja-group))) + (and v1-31 (= v1-31 errol-lowres-idle-to-run-cw-ja)) + ) + (ja :num! (seek!)) + (if (ja-done? 0) + (ja :group! errol-lowres-run-cw-ja :num! min) + ) + ) + ((< 0.0 (-> self catwalk-vel)) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-to-run-ccw-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-to-run-cw-ja :num! min) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate get-hit (factory-boss) + :virtual #t + :event factory-boss-handler + :enter (behavior () + (factory-boss-play-speech 6 self) + ) + :exit (behavior () + (factory-boss-end-cutscene) + ) + :trans (behavior () + (factory-boss-always) + (let ((v1-2 (ja-group))) + (cond + ((and v1-2 (= v1-2 errol-lowres-idle-knocked-ja)) + (ja :num! (seek!)) + (if (ja-done? 0) + (go-virtual run-to-machine) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.05)) + (ja :group! errol-lowres-idle-knocked-ja :num! min) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; definition for function factory-boss-launch-critter-pick-anim +;; WARN: Return type mismatch object vs none. +(defbehavior factory-boss-launch-critter-pick-anim factory-boss ((arg0 int)) + (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-2 (the-as number (logior #x3f800000 v1-1))) + (f0-2 (+ -1.0 (the-as float v1-2))) + ) + (cond + ((!= arg0 7) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-hit-console-2-ja :num! min) + (let ((v1-10 (-> self hits-taken))) + (if (or (zero? v1-10) (= v1-10 1) (= v1-10 2) (= v1-10 3)) + (factory-boss-play-speech 3 self) + (factory-boss-play-speech 4 self) + ) + ) + ) + ((and (< f0-2 0.4) (let ((v1-17 (ja-group))) + (not (and v1-17 (= v1-17 errol-lowres-idle30-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle30-ja :num! min) + ) + ((and (or (< f0-2 0.8) (let ((v1-29 (ja-group))) + (and v1-29 (or (= v1-29 errol-lowres-idle-yell-ja) (= v1-29 errol-lowres-idle-yell-1-ja))) + ) + ) + (let ((v1-35 (ja-group))) + (not (and v1-35 (= v1-35 errol-lowres-idle60-ja))) + ) + ) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle60-ja :num! min) + ) + ((< f0-2 0.9) + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-yell-ja :num! min) + ) + (else + (ja-channel-push! 1 (seconds 0.1)) + (ja :group! errol-lowres-idle-yell-1-ja :num! min) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate launch-critters (factory-boss) + :virtual #t + :event factory-boss-launch-critter-handler + :enter (behavior () + (set! (-> self command-index) 0) + (set! (-> self command-timer) 0) + (set! (-> self current-round) 0) + (set! (-> self launching-group) #f) + (let ((a0-1 (nav-mesh-from-res-tag (-> self entity) 'nav-mesh-actor (-> self hits-taken)))) + (if a0-1 + (change-to a0-1 self) + ) + ) + ) + :exit (behavior () + (if (zero? (-> self camera-timer)) + (factory-boss-end-cutscene) + ) + ) + :trans (behavior () + (let ((gp-0 (factory-boss-check-launch-script)) + (v1-2 (ja-group)) + ) + (cond + ((and v1-2 (or (= v1-2 errol-lowres-idle-hit-console-ja) (= v1-2 errol-lowres-idle-hit-console-2-ja))) + (let ((f30-0 (ja-aframe-num 0)) + (f28-0 60.0) + ) + (let ((v1-8 (ja-group))) + (if (and v1-8 (= v1-8 errol-lowres-idle-hit-console-2-ja)) + (set! f28-0 17.0) + ) + ) + (ja :num! (seek!)) + (when (and (or (-> self launching-group) (and (>= (ja-aframe-num 0) f28-0) (< f30-0 f28-0))) + (factory-boss-launch-critter gp-0) + ) + (set! (-> self launching-group) (the-as sparticle-launch-group #t)) + (factory-boss-advance-launch-script) + ) + ) + (if (ja-done? 0) + (factory-boss-launch-critter-pick-anim gp-0) + ) + ) + ((or (!= gp-0 7) (let ((v1-35 (ja-group))) + (not (and v1-35 (or (= v1-35 errol-lowres-idle30-ja) (= v1-35 errol-lowres-idle60-ja)))) + ) + ) + (ja :num! (seek!)) + (when (ja-done? 0) + (set! (-> self launching-group) #f) + (factory-boss-launch-critter-pick-anim gp-0) + ) + ) + (else + (ja :num! (loop!)) + ) + ) + ) + (factory-boss-always) + ) + :code sleep-code + :post ja-post + ) + +;; definition for function factory-boss-pick-floor-targets +;; WARN: Return type mismatch int vs none. +(defbehavior factory-boss-pick-floor-targets factory-boss ((arg0 int) (arg1 int)) + (let ((v1-1 (min 7 arg1))) + (set! (-> self num-floor-targets) 0) + (dotimes (a1-1 (+ (-> self actor-group-count) -1)) + (let ((a3-1 (-> self actor-group a1-1))) + (when (and (nonzero? v1-1) + (>= arg0 a1-1) + (not (logtest? (-> a3-1 data 0 actor extra perm status) (entity-perm-status subtask-complete))) + ) + (set! (-> self floor-targets (-> self num-floor-targets)) a1-1) + (+! (-> self num-floor-targets) 1) + (+! v1-1 -1) + ) + ) + ) + ) + (set! (-> self bombs-to-drop) (-> self num-floor-targets)) + (set! (-> self bomb-type) (facboss-bomb-type bomb1)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate drop-bombs (factory-boss) + :virtual #t + :event factory-boss-handler + :enter (behavior () + (let ((v1-0 (-> self hits-taken))) + (cond + ((zero? v1-0) + (set! (-> self shot-timer) (+ (current-time) (seconds 3))) + (set! (-> self bombs-to-drop) 4) + (set! (-> self bomb-type) (facboss-bomb-type bomb0)) + 0 + ) + ((= v1-0 1) + (set! (-> self shot-timer) 0) + (set! (-> self bombs-to-drop) 3) + (set! (-> self bomb-type) (facboss-bomb-type bomb2)) + ) + (else + (set! (-> self shot-timer) 0) + (set! (-> self bombs-to-drop) 4) + (set! (-> self bomb-type) (facboss-bomb-type bomb2)) + ) + ) + ) + (factory-boss-pick-camera) + ) + :exit (behavior () + (factory-boss-end-cutscene) + (factory-boss-method-30 self) + ) + :trans (behavior () + (when (and (<= (-> self bombs-to-drop) 0) (let ((v1-4 (ja-group))) + (not (and v1-4 (= v1-4 errol-lowres-idle-throw-ja))) + ) + ) + (let ((a1-0 0) + (a0-5 0) + (gp-0 0) + ) + (let ((v1-8 (-> self hits-taken))) + (cond + ((zero? v1-8) + ) + ((= v1-8 1) + (set! a1-0 7) + (set! a0-5 6) + (set! gp-0 4) + ) + ((= v1-8 2) + (set! a1-0 7) + (set! a0-5 13) + (set! gp-0 4) + ) + (else + (set! a1-0 7) + (set! a0-5 100) + (set! gp-0 4) + ) + ) + ) + (case (-> self bomb-type) + (((facboss-bomb-type bomb2) (facboss-bomb-type bomb1)) + (factory-boss-pick-floor-targets a0-5 a1-0) + (cond + ((zero? (-> self bombs-to-drop)) + (set! (-> self bombs-to-drop) gp-0) + (set! (-> self bomb-type) (facboss-bomb-type bomb0)) + 0 + ) + (else + (set! (-> self shot-timer) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 1.0 2.0))))) + ) + ) + ) + (else + (go-virtual launch-critters) + ) + ) + ) + ) + (if (and (= (-> self bomb-type) (facboss-bomb-type bomb1)) + (< (-> self num-floor-targets) (-> self bombs-to-drop)) + ) + (set! (-> self bombs-to-drop) (-> self num-floor-targets)) + ) + (factory-boss-always) + (factory-boss-move) + (factory-boss-check-bomb-timer (the-as int (-> self bomb-type))) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate hidden (factory-boss) + :virtual #t + :event factory-boss-always-handler + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self chosen-machine) 0) + (set! (-> self catwalk-angle) (factory-boss-machine-angle)) + (set! (-> self root-angle) (+ 32768.0 (-> self catwalk-angle))) + (set! (-> self catwalk-vel) 0.0) + (reset-factory-boss-speeches) + (ja-post) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + :trans (behavior () + (cond + ((task-node-closed? (game-task-node factory-boss-resolution)) + (go-virtual beaten) + ) + ((task-node-closed? (game-task-node factory-boss-introduction)) + (go-virtual drop-bombs) + ) + ) + ) + :code sleep-code + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-h_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-h_REF.gc new file mode 100644 index 0000000000..c1ff5393c3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-h_REF.gc @@ -0,0 +1,369 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fac-edge-list +(deftype fac-edge-list (basic) + ((edge int16 4) + ) + ) + +;; definition for method 3 of type fac-edge-list +(defmethod inspect ((this fac-edge-list)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tedge[4] @ #x~X~%" (-> this edge)) + (label cfg-4) + this + ) + +;; definition of type factory-inout +(deftype factory-inout (structure) + ((lpath int16) + (lpos float) + (flags factory-inout-flag) + ) + :allow-misaligned + ) + +;; definition for method 3 of type factory-inout +(defmethod inspect ((this factory-inout)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-inout) + (format #t "~1Tlpath: ~D~%" (-> this lpath)) + (format #t "~1Tlpos: ~f~%" (-> this lpos)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type factory-pathlist +(deftype factory-pathlist (structure) + ((path path-control 200) + (inout factory-inout 200 :inline) + (loops int16 200) + (npath int8) + (nloop int8) + (curidx int8) + ) + :allow-misaligned + ) + +;; definition for method 3 of type factory-pathlist +(defmethod inspect ((this factory-pathlist)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-pathlist) + (format #t "~1Tpath[200] @ #x~X~%" (-> this path)) + (format #t "~1Tinout[200] @ #x~X~%" (-> this inout)) + (format #t "~1Tloops[200] @ #x~X~%" (-> this loops)) + (format #t "~1Tnpath: ~D~%" (-> this npath)) + (format #t "~1Tnloop: ~D~%" (-> this nloop)) + (format #t "~1Tcuridx: ~D~%" (-> this curidx)) + (label cfg-4) + this + ) + +;; definition of type factory-manager +(deftype factory-manager (process) + ((self factory-manager :override) + (nfighters-spawned uint8) + (nfighters-total uint8) + (ntanks-spawned uint8) + (player-born time-frame) + (player-died time-frame) + (fighter-spawned time-frame) + (fighter-killed time-frame) + (tank-spawned time-frame) + (tank-killed time-frame) + (fpath factory-pathlist :inline) + (tpath factory-pathlist :inline) + (cur-wave uint8) + ) + (:state-methods + idle + ) + (:methods + (factory-manager-method-15 (_type_) none) + (init-paths-for-list! (_type_ factory-pathlist string) symbol) + ) + ) + +;; definition for method 3 of type factory-manager +(defmethod inspect ((this factory-manager)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tnfighters-spawned: ~D~%" (-> this nfighters-spawned)) + (format #t "~2Tnfighters-total: ~D~%" (-> this nfighters-total)) + (format #t "~2Tntanks-spawned: ~D~%" (-> this ntanks-spawned)) + (format #t "~2Tplayer-born: ~D~%" (-> this player-born)) + (format #t "~2Tplayer-died: ~D~%" (-> this player-died)) + (format #t "~2Tfighter-spawned: ~D~%" (-> this fighter-spawned)) + (format #t "~2Tfighter-killed: ~D~%" (-> this fighter-killed)) + (format #t "~2Ttank-spawned: ~D~%" (-> this tank-spawned)) + (format #t "~2Ttank-killed: ~D~%" (-> this tank-killed)) + (format #t "~2Tfpath: #~%" (-> this fpath)) + (format #t "~2Ttpath: #~%" (-> this tpath)) + (format #t "~2Tcur-wave: ~D~%" (-> this cur-wave)) + (label cfg-4) + this + ) + +;; definition of type factory-fighter +(deftype factory-fighter (rigid-body-object) + ((parent (pointer factory-manager) :override) + (first-time? symbol) + (path-pos float) + (forw vector :inline) + (upvc vector :inline) + (ppos vector :inline) + (pvel vector :inline) + (pacc vector :inline) + (blendpath float) + (newpath int8) + (path-idx int8) + (last-hit-time time-frame) + (disappear symbol) + (last-fire time-frame) + (turret-gun int8) + (light-trail handle) + (rot-vel float) + (rot-acc float) + (engine-sound sound-id) + (engine-sound-playing? symbol) + (last-snd-cmd time-frame) + (red-tip-change-time time-frame) + (red-tip-on symbol) + ) + (:state-methods + flying + explode + dive + die + ) + (:methods + (fire-shot (_type_) projectile) + (factory-fighter-method-61 (_type_) none) + (factory-fighter-method-62 (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type factory-fighter +(defmethod inspect ((this factory-fighter)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type rigid-body-object inspect))) + (t9-0 this) + ) + (format #t "~2Tfirst-time?: ~A~%" (-> this first-time?)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tforw: #~%" (-> this forw)) + (format #t "~2Tupvc: #~%" (-> this upvc)) + (format #t "~2Tppos: #~%" (-> this ppos)) + (format #t "~2Tpvel: #~%" (-> this pvel)) + (format #t "~2Tpacc: #~%" (-> this pacc)) + (format #t "~2Tblendpath: ~f~%" (-> this blendpath)) + (format #t "~2Tnewpath: ~D~%" (-> this newpath)) + (format #t "~2Tpath-idx: ~D~%" (-> this path-idx)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tdisappear: ~A~%" (-> this disappear)) + (format #t "~2Tlast-fire: ~D~%" (-> this last-fire)) + (format #t "~2Tturret-gun: ~D~%" (-> this turret-gun)) + (format #t "~2Tlight-trail: ~D~%" (-> this light-trail)) + (format #t "~2Trot-vel: ~f~%" (-> this rot-vel)) + (format #t "~2Trot-acc: ~f~%" (-> this rot-acc)) + (format #t "~2Tengine-sound: ~D~%" (-> this engine-sound)) + (format #t "~2Tengine-sound-playing?: ~A~%" (-> this engine-sound-playing?)) + (format #t "~2Tlast-snd-cmd: ~D~%" (-> this last-snd-cmd)) + (format #t "~2Tred-tip-change-time: ~D~%" (-> this red-tip-change-time)) + (format #t "~2Tred-tip-on: ~A~%" (-> this red-tip-on)) + (label cfg-4) + this + ) + +;; definition of type fac-target +(deftype fac-target (process-focusable) + ((sync sync-paused :inline) + (minimap connection-minimap) + (light-jm joint-mod) + ) + (:state-methods + idle + die-fast + retract + retracted + explode + ) + (:methods + (fac-target-method-33 (_type_) none) + (fac-target-method-34 (_type_) none) + ) + ) + +;; definition for method 3 of type fac-target +(defmethod inspect ((this fac-target)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tlight-jm: ~A~%" (-> this light-jm)) + (label cfg-4) + this + ) + +;; definition of type fac-gun-tower +(deftype fac-gun-tower (process-focusable) + ((yaw float) + (yawvel float) + (pitch float) + (pitchvel float) + (dyaw float) + (dpitch float) + (last-fire time-frame) + (last-hit-time time-frame) + (gunrot int8) + (muzzle int8) + (gun-idx int8) + (attack-id int32) + (gun-tilt-jm joint-mod) + (hit-points float) + (invincable symbol) + (rotate-sound sound-id) + (rotate-sound-playing symbol) + (blade-sound sound-id) + (blade-sound-playing symbol) + (snd-cmd-time time-frame) + (minimap connection-minimap) + ) + (:state-methods + open + idle + die + die-fast + ) + (:methods + (fac-gun-tower-method-32 (_type_) none) + (fac-gun-tower-method-33 (_type_) none) + (fac-gun-tower-method-34 (_type_) none) + (fire-shot (_type_) projectile) + (fac-gun-tower-method-36 (_type_) none) + (send-attack (_type_ process-focusable) none) + ) + ) + +;; definition for method 3 of type fac-gun-tower +(defmethod inspect ((this fac-gun-tower)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tyaw: ~f~%" (-> this yaw)) + (format #t "~2Tyawvel: ~f~%" (-> this yawvel)) + (format #t "~2Tpitch: ~f~%" (-> this pitch)) + (format #t "~2Tpitchvel: ~f~%" (-> this pitchvel)) + (format #t "~2Tdyaw: ~f~%" (-> this dyaw)) + (format #t "~2Tdpitch: ~f~%" (-> this dpitch)) + (format #t "~2Tlast-fire: ~D~%" (-> this last-fire)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tgunrot: ~D~%" (-> this gunrot)) + (format #t "~2Tmuzzle: ~D~%" (-> this muzzle)) + (format #t "~2Tgun-idx: ~D~%" (-> this gun-idx)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tgun-tilt-jm: ~A~%" (-> this gun-tilt-jm)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tinvincable: ~A~%" (-> this invincable)) + (format #t "~2Trotate-sound: ~D~%" (-> this rotate-sound)) + (format #t "~2Trotate-sound-playing: ~A~%" (-> this rotate-sound-playing)) + (format #t "~2Tblade-sound: ~D~%" (-> this blade-sound)) + (format #t "~2Tblade-sound-playing: ~A~%" (-> this blade-sound-playing)) + (format #t "~2Tsnd-cmd-time: ~D~%" (-> this snd-cmd-time)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; definition of type fac-gun-tower-break +(deftype fac-gun-tower-break (process-drawable) + () + (:state-methods + idle + idle-stick + ) + ) + +;; definition for method 3 of type fac-gun-tower-break +(defmethod inspect ((this fac-gun-tower-break)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type fac-gun-tower-base-broken +(deftype fac-gun-tower-base-broken (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-gun-tower-base-broken +(defmethod inspect ((this fac-gun-tower-base-broken)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition of type hud-factory-damage +(deftype hud-factory-damage (hud) + () + ) + +;; definition for method 3 of type hud-factory-damage +(defmethod inspect ((this hud-factory-damage)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/factory/factory-hud_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-hud_REF.gc new file mode 100644 index 0000000000..b600a5e525 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-hud_REF.gc @@ -0,0 +1,57 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for method 15 of type hud-factory-damage +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-factory-damage)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + 256 + (+ (the int (* 50.0 (-> this offset))) 376) + ) + (set! (-> this sprites 0 pos z) #xfffff0) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -71 -5) + (set! (-> this sprites 1 pos z) #xfffff0) + (let ((f0-4 (fmax 0.0 (fmin 1.0 (the-as float (-> this values 0 current)))))) + (set! (-> this sprites 1 color x) (the int (* 255.0 (- 1.0 f0-4)))) + (set! (-> this sprites 1 color y) (the int (* 255.0 f0-4))) + (set! (-> this sprites 1 color z) 0) + (set! (-> this sprites 1 scale-x) (* 35.5 f0-4)) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-factory-damage +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-factory-damage)) + (set! (-> this values 0 target) (the-as int (-> *game-info* health-bar-vehicle))) + (logclear! (-> this flags) (hud-flags disable)) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-factory-damage +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-factory-damage)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-center-2) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-vehicle-health-bar-01 factoryb-minimap))) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 scale-y) 1.2) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture common-white common))) + (set! (-> this sprites 1 flags) (hud-sprite-flags)) + (set! (-> this sprites 1 scale-x) 0.0) + (set! (-> this sprites 1 scale-y) 3.0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc new file mode 100644 index 0000000000..2f61be87db --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-manager_REF.gc @@ -0,0 +1,2069 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type task-manager-factory-sky-battle +(deftype task-manager-factory-sky-battle (task-manager) + ((factory-sky-battle-entity entity-actor) + (check-timer time-frame) + (ended-timer time-frame) + (mission-complete-time time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (cur-group int8) + (hud-delay handle) + (sound-id sound-id) + (hud-damage handle) + (hint-given symbol) + ) + (:methods + (task-manager-factory-sky-battle-method-32 (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-factory-sky-battle +(defmethod inspect ((this task-manager-factory-sky-battle)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tfactory-sky-battle-entity: ~A~%" (-> this factory-sky-battle-entity)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tended-timer: ~D~%" (-> this ended-timer)) + (format #t "~2Tmission-complete-time: ~D~%" (-> this mission-complete-time)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tcur-group: ~D~%" (-> this cur-group)) + (format #t "~2Thud-delay: ~D~%" (-> this hud-delay)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Thud-damage: ~D~%" (-> this hud-damage)) + (format #t "~2Thint-given: ~A~%" (-> this hint-given)) + (label cfg-7) + this + ) + +;; definition for symbol *fac-task-manager*, type task-manager-factory-sky-battle +(define *fac-task-manager* (the-as task-manager-factory-sky-battle #f)) + +;; definition for symbol *fac-fighter-fired*, type time-frame +(define *fac-fighter-fired* (the-as time-frame 0)) + +;; definition for symbol *fac-wave*, type int +(define *fac-wave* 0) + +;; definition for symbol *fac-shotsleft*, type int +(define *fac-shotsleft* 0) + +;; definition of type light-trail-tracker-vehicle +(deftype light-trail-tracker-vehicle (light-trail-tracker) + () + ) + +;; definition for method 3 of type light-trail-tracker-vehicle +(defmethod inspect ((this light-trail-tracker-vehicle)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type light-trail-tracker inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 17 of type light-trail-tracker-vehicle +(defmethod light-trail-tracker-method-17 ((this light-trail-tracker-vehicle) (arg0 process-focusable)) + #f + ) + +;; failed to figure out what this is: +(if (or (zero? *factory-fighter-trail*) (!= loading-level global)) + (set! *factory-fighter-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* color-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* alpha-2-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* base-alpha) 1.0) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* alpha-repeat-dist) 6144.0) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* base-width) 2048.0) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* width-repeat-dist) 20480.0) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* uv-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* uv-repeat-dist) 16384000.0) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* max-age) (seconds 0.5)) + +;; failed to figure out what this is: +(if #f + (set! (-> *factory-fighter-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *factory-fighter-trail* tex-id) (the-as uint #x100300)) + ) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-red*)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* alpha-curve-2) *curve-linear-up-red*) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *factory-fighter-trail* frame-stagger) (the-as uint 5)) + +;; definition for function fac-count-curves +(defun fac-count-curves ((arg0 entity-actor)) + (let ((s4-0 (new 'stack 'curve)) + (v1-1 (entity-actor-lookup arg0 'path-actor 0)) + (gp-0 0) + ) + (if v1-1 + (set! arg0 v1-1) + ) + (dotimes (s3-0 666) + (if (get-curve-data! arg0 s4-0 'path 'path-k (the float s3-0)) + (+! gp-0 1) + ) + ) + gp-0 + ) + ) + +;; definition for symbol *fac-tmp-str*, type string +(define *fac-tmp-str* (new 'global 'string 128 (the-as string #f))) + +;; definition for method 16 of type factory-manager +;; INFO: Used lq/sq +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +;; ERROR: Stack slot load at 448 mismatch: defined as size 4, got size 16 +(defmethod init-paths-for-list! ((this factory-manager) (arg0 factory-pathlist) (arg1 string)) + (local-vars + (sv-144 entity) + (sv-160 int) + (sv-176 int) + (sv-192 int) + (sv-208 (function _varargs_ object)) + (sv-224 int) + (sv-240 string) + (sv-256 int) + (sv-272 (function _varargs_ object)) + (sv-288 int) + (sv-304 string) + (sv-320 int) + (sv-336 vector) + (sv-352 vector) + (sv-368 vector) + (sv-384 int) + (sv-400 (function _varargs_ object)) + (sv-416 int) + (sv-432 string) + (sv-448 float) + ) + (set! (-> arg0 npath) 0) + (set! (-> arg0 nloop) 0) + (let ((s3-0 (new 'stack 'curve))) + 0 + (let ((s2-0 1)) + 0 + 0 + (let ((s1-0 #f)) + (while (not s1-0) + (let ((s0-0 0)) + (clear *fac-tmp-str*) + (format *fac-tmp-str* "~S-~d" arg1 s2-0) + (if #f + (format 0 "String: ~A~%" *fac-tmp-str*) + ) + (set! sv-144 (entity-by-name *fac-tmp-str*)) + (+! s2-0 1) + (if (not sv-144) + (set! s1-0 #t) + ) + (set! sv-160 0) + (when sv-144 + (set! (-> this entity) (the-as entity-actor sv-144)) + (set! sv-160 (fac-count-curves (the-as entity-actor sv-144))) + (set! sv-176 0) + (while (< sv-176 sv-160) + (set! sv-192 (+ sv-176 (-> arg0 npath))) + (while (not (get-curve-data! sv-144 s3-0 'path 'path-k (the float s0-0))) + (+! s0-0 1) + ) + (set! (-> arg0 path sv-192) (new 'process 'curve-control this 'path (the float s0-0))) + (+! s0-0 1) + (logior! (-> arg0 path sv-192 flags) (path-control-flag display draw-line draw-point draw-text)) + (when #f + (set! sv-208 format) + (set! sv-224 0) + (set! sv-240 "Path ~d length ~M~%") + (set! sv-256 sv-192) + (let ((a3-3 (total-distance (-> arg0 path sv-192)))) + (sv-208 sv-224 sv-240 sv-256 a3-3) + ) + ) + (set! sv-336 (new 'stack-no-clear 'vector)) + (set! sv-352 (new 'stack-no-clear 'vector)) + (get-point-at-percent-along-path! (-> arg0 path sv-192) sv-336 0.0 'interp) + (get-point-at-percent-along-path! (-> arg0 path sv-192) sv-352 1.0 'interp) + (when #f + (set! sv-272 format) + (set! sv-288 0) + (set! sv-304 "Begin to end of path ~d is ~M~%") + (set! sv-320 sv-192) + (let ((a3-6 (vector-vector-distance sv-336 sv-352))) + (sv-272 sv-288 sv-304 sv-320 a3-6) + ) + ) + (when (>= 4.096 (vector-vector-distance-squared sv-336 sv-352)) + (if #f + (format 0 "Path idx ~d is a loop~%" sv-192) + ) + (logior! (-> arg0 inout sv-192 flags) (factory-inout-flag fi0)) + (set! (-> arg0 loops (-> arg0 nloop)) sv-192) + (+! (-> arg0 nloop) 1) + ) + (set! sv-176 (+ sv-176 1)) + ) + ) + ) + (+! (-> arg0 npath) sv-160) + ) + ) + ) + ) + (when #f + (if (<= (-> arg0 npath) 0) + (format 0 "No path found~%") + ) + ) + (dotimes (s5-1 (-> arg0 npath)) + (when (not (logtest? (-> arg0 inout s5-1 flags) (factory-inout-flag fi0))) + (let ((f28-0 40960000.0) + (s3-1 -1) + (s4-1 -1) + (f30-1 -1.0) + ) + 0.0 + 0.0 + (let ((s2-1 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + (s0-1 (new 'stack-no-clear 'vector)) + ) + (set! sv-368 (new 'stack-no-clear 'vector)) + (set! sv-384 0) + (while (< sv-384 (-> arg0 npath)) + (when (logtest? (-> arg0 inout sv-384 flags) (factory-inout-flag fi0)) + (get-point-at-percent-along-path! (-> arg0 path s5-1) s2-1 0.0 'interp) + (get-point-at-percent-along-path! (-> arg0 path s5-1) s1-1 1.0 'interp) + (if #f + (format 0 "Path idx ~d is an entrance~%" s5-1) + ) + (let ((f26-0 (path-control-method-25 (-> arg0 path sv-384) s2-1)) + (f24-0 (path-control-method-25 (-> arg0 path sv-384) s1-1)) + ) + (if #f + (format 0 "u1: ~f u2: ~f~%" f26-0 f24-0) + ) + (get-point-at-percent-along-path! (-> arg0 path sv-384) s0-1 f26-0 'interp) + (get-point-at-percent-along-path! (-> arg0 path sv-384) sv-368 f24-0 'interp) + (when #f + (set! sv-400 format) + (set! sv-416 0) + (set! sv-432 "Dist1: ~M Dist2: ~M~%") + (set! sv-448 (vector-vector-distance s2-1 s0-1)) + (let ((a3-12 (vector-vector-distance s1-1 sv-368))) + (sv-400 sv-416 sv-432 sv-448 a3-12) + ) + ) + (when (< (vector-vector-distance s2-1 s0-1) f28-0) + (set! s4-1 1) + (set! f28-0 (vector-vector-distance s2-1 s0-1)) + (set! s3-1 sv-384) + (set! f30-1 f26-0) + ) + (when (< (vector-vector-distance s1-1 sv-368) f28-0) + (set! s4-1 0) + (set! f28-0 (vector-vector-distance s1-1 sv-368)) + (set! s3-1 sv-384) + (set! f30-1 f24-0) + ) + ) + ) + (set! sv-384 (+ sv-384 1)) + ) + ) + (if #f + (format 0 "Best dist: ~M best loop: ~d Best pos: ~f EExit: ~d~%" f28-0 s3-1 f30-1 s4-1) + ) + (cond + ((>= 40960.0 f28-0) + (set! (-> arg0 inout s5-1 lpath) s3-1) + (set! (-> arg0 inout s5-1 lpos) f30-1) + (if (zero? s4-1) + (logior! (-> arg0 inout s5-1 flags) (factory-inout-flag fi1)) + ) + (if (= s4-1 1) + (logior! (-> arg0 inout s5-1 flags) (factory-inout-flag fi2)) + ) + ) + (else + (if #f + (format 0 "ERROR: Path could not be connected!~%") + ) + (set! (-> arg0 inout s5-1 lpath) 0) + (set! (-> arg0 inout s5-1 lpos) 0.0) + ) + ) + ) + ) + ) + #f + ) + +;; failed to figure out what this is: +(defstate idle (factory-manager) + :virtual #t + :code (behavior () + (until #f + (while (or (<= (-> self fpath npath) 0) (<= (-> self tpath npath) 0)) + (suspend) + ) + (when (and (zero? (-> self player-born)) (and *target* (focus-test? *target* pilot))) + (set-time! (-> self player-born)) + (set! (-> self player-died) 0) + 0 + ) + (if (and (not *target*) (zero? (-> self player-died))) + (set-time! (-> self player-died)) + ) + (when (!= *fac-wave* (-> self cur-wave)) + (set! (-> self cur-wave) (the-as uint *fac-wave*)) + (if (= *fac-wave* 1) + (set! (-> self nfighters-total) (-> self nfighters-spawned)) + ) + ) + (when (and *target* + (< (-> self nfighters-spawned) (the-as uint 50)) + (< (-> self nfighters-total) (the-as uint 50)) + (focus-test? *target* pilot) + (> (-> self tpath npath) 0) + (time-elapsed? (-> self fighter-spawned) (seconds 0.2)) + (time-elapsed? (-> self fighter-killed) (seconds 0.2)) + ) + (set-time! (-> self fighter-spawned)) + (factory-fighter-spawn self) + (+! (-> self nfighters-spawned) 1) + (+! (-> self nfighters-total) 1) + ) + (when (and *target* + (< (-> self ntanks-spawned) (the-as uint 4)) + (> (-> self fpath npath) 0) + (focus-test? *target* pilot) + (time-elapsed? (-> self tank-spawned) (seconds 2)) + ) + (set-time! (-> self tank-spawned)) + (fac-robotank-spawn self) + (+! (-> self ntanks-spawned) 1) + ) + (suspend) + ) + #f + ) + ) + +;; definition for method 15 of type factory-manager +;; WARN: Return type mismatch symbol vs none. +;; WARN: Function (method 15 factory-manager) has a return type of none, but the expression builder found a return statement. +(defmethod factory-manager-method-15 ((this factory-manager)) + (dotimes (v1-0 (-> this fpath npath)) + (if (or (zero? (-> this fpath path v1-0)) + (logtest? (-> this fpath path v1-0 flags) (path-control-flag not-found)) + ) + (return #f) + ) + ) + #t + (none) + ) + +;; definition of type factory-fighter-path +(deftype factory-fighter-path (process-drawable) + () + ) + +;; definition for method 3 of type factory-fighter-path +(defmethod inspect ((this factory-fighter-path)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type factory-fighter-path +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this factory-fighter-path) (arg0 entity-actor)) + (cleanup-for-death this) + ) + +;; definition of type factory-tanks-path +(deftype factory-tanks-path (process-drawable) + () + ) + +;; definition for method 3 of type factory-tanks-path +(defmethod inspect ((this factory-tanks-path)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 11 of type factory-tanks-path +;; WARN: Return type mismatch none vs object. +(defmethod init-from-entity! ((this factory-tanks-path) (arg0 entity-actor)) + (cleanup-for-death this) + ) + +;; definition for function factory-manager-init-by-other +(defbehavior factory-manager-init-by-other factory-manager ((arg0 level)) + (set! (-> self level) arg0) + (set! (-> self player-died) 0) + (set! (-> self player-born) 0) + (set! (-> self nfighters-spawned) (the-as uint 0)) + (set! (-> self nfighters-total) (the-as uint 0)) + (set! (-> self cur-wave) (the-as uint 0)) + (init-paths-for-list! self (-> self fpath) "factory-fighter-path") + (init-paths-for-list! self (-> self tpath) "factory-tanks-path") + (go-virtual idle) + ) + +;; definition for method 7 of type factory-manager +(defmethod relocate ((this factory-manager) (offset int)) + (dotimes (v1-0 (-> this fpath npath)) + (if (nonzero? (-> this fpath path v1-0)) + (&+! (-> this fpath path v1-0) offset) + ) + ) + (dotimes (v1-3 (-> this tpath npath)) + (if (nonzero? (-> this tpath path v1-3)) + (&+! (-> this tpath path v1-3) offset) + ) + ) + (call-parent-method this offset) + ) + +;; definition for function factory-manager-start +;; WARN: Return type mismatch int vs none. +(defun factory-manager-start ((arg0 level)) + (kill-by-type factory-manager *active-pool*) + (process-spawn factory-manager arg0 :name "factory-manager" :to *entity-pool*) + 0 + (none) + ) + +;; definition for symbol *fac-fighter-rigid-body-constants*, type rigid-body-object-constants +(define *fac-fighter-rigid-body-constants* + (new 'static 'rigid-body-object-constants + :info (new 'static 'rigid-body-info + :mass 1.5 + :inv-mass 0.6666667 + :linear-damping 0.97 + :angular-damping 0.94 + :bounce-factor 0.75 + :friction-factor 0.99 + :cm-offset-joint (new 'static 'vector :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 2.5) (meters 5) (meters 2.5)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 20) + :idle-distance (meters 200) + :attack-force-scale 2.0 + ) + :name '*fac-fighter-rigid-body-constants* + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-factory-fighter kg-fighter kg-fighter-lod0-jg kg-fighter-idle-ja + ((kg-fighter-lod0-mg (meters 20)) (kg-fighter-lod1-mg (meters 40)) (kg-fighter-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-fighter-explode kg-fighter kg-fighter-explode-lod0-jg kg-fighter-explode-idle-ja + ((kg-fighter-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; definition for symbol *fac-fighter-exploder-params*, type joint-exploder-static-params +(define *fac-fighter-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition for function fighter-best-birth-path +;; INFO: Used lq/sq +(defun fighter-best-birth-path ((arg0 factory-manager)) + (local-vars (v0-2 int)) + (let ((f30-0 409600000.0)) + 0 + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + 0.0 + (set! (-> s5-0 quad) (-> *target* control trans quad)) + (dotimes (s4-0 (-> arg0 fpath npath)) + (when (logtest? (-> arg0 fpath inout s4-0 flags) (factory-inout-flag fi1)) + (get-point-at-percent-along-path! (-> arg0 fpath path s4-0) s5-0 0.0 'interp) + (let ((f0-2 (vector-vector-distance s5-0 (-> *target* control trans)))) + (vector-! s5-0 s5-0 (-> *target* control trans)) + (let ((f1-1 (vector-dot s5-0 (-> *target* node-list data 0 bone transform fvec)))) + (if (and (>= f30-0 f0-2) (>= f1-1 0.0)) + (set! f30-0 f0-2) + ) + ) + ) + ) + ) + ) + ) + (until (logtest? (-> arg0 fpath inout v0-2 flags) (factory-inout-flag fi1)) + (set! v0-2 (rand-vu-int-range 0 (+ (-> arg0 fpath npath) -1))) + ) + v0-2 + ) + +;; definition for function fighter-birth-path +(defun fighter-birth-path ((arg0 factory-manager)) + (local-vars (v0-0 int)) + 0 + (until (logtest? (-> arg0 fpath inout v0-0 flags) (factory-inout-flag fi1)) + (set! v0-0 (rand-vu-int-range 0 (+ (-> arg0 fpath npath) -1))) + ) + v0-0 + ) + +;; definition for function factory-fighter-standard-event-handler +(defbehavior factory-fighter-standard-event-handler factory-fighter ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('touched 'attack) + (when (!= (-> arg0 type) guard-shot) + (when (-> self engine-sound-playing?) + (sound-stop (-> self engine-sound)) + (set! (-> self engine-sound-playing?) #f) + ) + (if (< (rand-vu) 0.2) + (go-virtual dive) + (go-virtual explode) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (if (time-elapsed? (-> self state-time) (seconds 1)) + (go-virtual flying) + ) + ) + :code (behavior () + (until #f + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 10 of type factory-fighter +(defmethod deactivate ((this factory-fighter)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (remove-from-process *part-engine* this) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound) (new 'static 'sound-id)) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 60 of type factory-fighter +;; INFO: Used lq/sq +(defmethod fire-shot ((this factory-fighter)) + (with-pp + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when *target* + (let ((s5-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-0 quad) (-> (get-trans *target* 3) quad)) + (let ((v1-4 s5-0)) + (let ((a0-3 (-> this root trans))) + (let ((a1-1 (-> this forw))) + (let ((a2-1 17203.2)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-1 quad)) + ) + (.lvf vf4 (&-> a0-3 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-4 quad) vf6) + ) + (let ((a1-2 s5-0)) + (let ((v1-5 s5-0)) + (let ((a0-4 (-> this upvc))) + (let ((a2-3 2252.8)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-2 quad) vf6) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'get-vehicle) + (let ((a0-7 (the-as vehicle (send-event-function *target* a1-3)))) + (when a0-7 + (vector-float*! s3-0 (-> a0-7 rbody lin-velocity) 0.4) + (vector+! s4-0 s4-0 s3-0) + (sound-play "fighter-fire") + ) + ) + ) + (when #t + (rand-vu-sphere-point-uniform! s3-0 (* 61440.0 (rand-vu))) + (vector+! s4-0 s4-0 s3-0) + ) + ) + (spawn-ffight-projectile this s5-0 s4-0 819200.0 #f) + ) + ) + ) + ) + ) + +;; definition for method 62 of type factory-fighter +;; WARN: Return type mismatch int vs none. +(defmethod factory-fighter-method-62 ((this factory-fighter) (arg0 symbol)) + (when (>= (- (current-time) (-> this red-tip-change-time)) 0) + (set! (-> this red-tip-on) (not (-> this red-tip-on))) + (set! (-> this red-tip-change-time) (+ (current-time) (seconds 0.5))) + (set! arg0 #t) + ) + (when (and arg0 (logtest? (-> this draw status) (draw-control-status on-screen))) + (remove-from-process *part-engine* this) + (if (-> this red-tip-on) + (add-connection *part-engine* this 5 this 2794 (new 'static 'vector :y 2252.8 :z 4505.6 :w 819200.0)) + (add-connection *part-engine* this 5 this 2794 (new 'static 'vector :y 2252.8 :z 4505.6 :w 819200.0)) + ) + ) + 0 + (none) + ) + +;; definition for method 61 of type factory-fighter +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod factory-fighter-method-61 ((this factory-fighter)) + (local-vars (v1-64 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((f30-0 (seconds-per-frame))) + 1.0 + (-> this path-pos) + (let* ((s5-0 (ppointer->process (-> this parent))) + (f0-2 f30-0) + (f28-0 (/ 1.0 f0-2)) + ) + (set! (-> this path-pos) + (path-control-method-26 (-> s5-0 fpath path (-> this path-idx)) (-> this path-pos) (* 143360.0 f30-0)) + ) + (when (>= (-> this path-pos) 1.0) + (set! (-> this newpath) 2) + (cond + ((logtest? (-> s5-0 fpath inout (-> this path-idx) flags) (factory-inout-flag fi0)) + (set! (-> this path-pos) 0.0) + (vector-reset! (-> this forw)) + (vector-reset! (-> this upvc)) + ) + ((>= (-> s5-0 fpath inout (-> this path-idx) lpath) 0) + (set! (-> this path-pos) (-> s5-0 fpath inout (-> this path-idx) lpos)) + (set! (-> this path-idx) (-> s5-0 fpath inout (-> this path-idx) lpath)) + (vector-reset! (-> this forw)) + (vector-reset! (-> this upvc)) + ) + (else + (set! (-> this disappear) #t) + ) + ) + ) + (set! (-> this ppos quad) (-> this root trans quad)) + (get-point-at-percent-along-path! + (-> s5-0 fpath path (-> this path-idx)) + (-> this root trans) + (-> this path-pos) + 'interp + ) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (vector-! s2-0 (-> this root trans) (-> this ppos)) + (vector-float*! s2-0 s2-0 f28-0) + (set! (-> s4-0 quad) (-> s2-0 quad)) + (vector-normalize! s4-0 1.0) + (vector-! s3-0 s2-0 (-> this pvel)) + (set! (-> this pvel quad) (-> s2-0 quad)) + (vector-float*! s3-0 s3-0 (* 0.000016276043 f28-0)) + (cond + ((< 0.0 (-> this blendpath)) + (let ((v1-52 (new 'stack-no-clear 'vector))) + (vector-float*! s3-0 s3-0 (- 1.0 (-> this blendpath))) + (vector-float*! v1-52 (-> this pacc) (-> this blendpath)) + (vector+! s3-0 s3-0 v1-52) + ) + (set! (-> this blendpath) (fmax 0.0 (- (-> this blendpath) (* 4.0 f30-0)))) + ) + ((zero? (-> this newpath)) + (set! (-> this pacc quad) (-> s3-0 quad)) + ) + (else + (set! (-> s3-0 quad) (-> this pacc quad)) + (+! (-> this newpath) -1) + (if (zero? (-> this newpath)) + (set! (-> this blendpath) 1.0) + ) + ) + ) + (let ((f0-22 0.0)) + (.lvf vf1 (&-> s2-0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-64 vf1) + (if (>= f0-22 v1-64) + (vector-reset! s3-0) + ) + ) + (vector+! s5-1 *up-vector* s3-0) + (vector-normalize! s5-1 1.0) + (forward-up->quaternion (-> this root quat) s4-0 s5-1) + (set! (-> this forw quad) (-> s4-0 quad)) + (set! (-> this upvc quad) (-> s5-1 quad)) + ) + ) + ) + (transform-post) + (none) + ) + ) + +;; failed to figure out what this is: +(defstate flying (factory-fighter) + :virtual #t + :event factory-fighter-standard-event-handler + :enter (behavior () + (ja-no-eval :group! (-> self draw art-group data 4) :num! (loop!) :frame-num 0.0) + ) + :trans (behavior () + (factory-fighter-method-62 self #f) + (new 'stack-no-clear 'vector) + 0.0 + (let ((s5-0 (new 'stack-no-clear 'matrix)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (if (-> self disappear) + (go-virtual die) + ) + (quaternion->matrix s5-0 (-> self root quat)) + (set-vector! s4-0 0.0 4096.0 -8192.0 1.0) + (vector-rotate*! s4-0 s4-0 s5-0) + (vector+! gp-0 gp-0 s4-0) + ) + (send-event (handle->process (-> self light-trail)) 'notice 'add-crumb-pos gp-0) + ) + (when (time-elapsed? (-> self last-snd-cmd) (seconds 0.1)) + (set! (-> self engine-sound-playing?) #t) + (sound-play-by-name + (static-sound-name "fighter-engine") + (-> self engine-sound) + 1024 + (the int (* 1524.0 (doppler-pitch-shift (-> self root trans) (-> self pvel)))) + 0 + (sound-group) + #t + ) + (set-time! (-> self last-snd-cmd)) + ) + ) + :code (behavior () + (local-vars (v1-12 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (until #f + (when (and *target* (time-elapsed? (-> self last-fire) (seconds 2)) (time-elapsed? *fac-fighter-fired* (seconds 1))) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + 0.0 + (let ((v1-9 s5-0)) + (let ((a0-4 (-> self root trans))) + (let ((a1-0 (-> self forw))) + (let ((a2-1 17203.2)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-0 quad)) + ) + (.lvf vf4 (&-> a0-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> v1-9 quad) vf6) + ) + (let ((a1-1 s5-0)) + (let ((v1-10 s5-0)) + (let ((a0-5 (-> self upvc))) + (let ((a2-3 2252.8)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a0-5 quad)) + ) + (.lvf vf4 (&-> v1-10 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-1 quad) vf6) + ) + (.lvf vf1 (&-> gp-0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov v1-12 vf1) + v1-12 + (vector-! gp-0 (get-trans *target* 3) s5-0) + ) + (vector-normalize! gp-0 1.0) + (when (and (logtest? (-> self draw status) (draw-control-status on-screen)) + (< 0.8 (vector-dot (-> self forw) gp-0)) + (< (vector-vector-distance (-> *target* control trans) (-> self root trans)) 491520.0) + (< 163840.0 (vector-vector-distance (-> *target* control trans) (-> self root trans))) + ) + (fire-shot self) + (set-time! (-> self last-fire)) + (set! *fac-fighter-fired* (current-time)) + ) + ) + ) + (-> self skel root-channel 0) + (suspend) + ) + #f + ) + ) + :post (behavior () + (factory-fighter-method-61 self) + ) + ) + +;; failed to figure out what this is: +(defstate dive (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (cond + ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + ) + (set! (-> self rot-vel) (rand-vu-float-range -910.2222 910.2222)) + (set! (-> self rot-acc) (rand-vu-float-range -3640.889 3640.889)) + (sound-play "fighter-explode") + (let ((gp-3 (new 'stack-no-clear 'vector))) + (rand-vu-sphere-point-uniform! gp-3 20480.0) + (vector+! (-> self pvel) (-> self pvel) gp-3) + ) + ) + :trans (behavior () + (when (not (time-elapsed? (-> self state-time) (seconds 1))) + ) + (if (time-elapsed? (-> self state-time) (seconds 3)) + (go-virtual explode) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + :post (behavior () + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((a0-0 (new 'stack-no-clear 'vector)) + (f0-0 (seconds-per-frame)) + ) + (set-vector! (-> self pacc) 0.0 -81920.0 0.0 1.0) + (vector-float*! a0-0 (-> self pacc) f0-0) + (vector+! (-> self pvel) (-> self pvel) a0-0) + (vector-float*! v1-0 (-> self pvel) f0-0) + ) + (vector+! (-> self root trans) (-> self root trans) v1-0) + ) + (quaternion-rotate-local-z! (-> self root quat) (-> self root quat) (-> self rot-vel)) + (+! (-> self rot-vel) (* (-> self rot-acc) (seconds-per-frame))) + (set! (-> self rot-vel) (fmax -5461.3335 (fmin 5461.3335 (-> self rot-vel)))) + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate explode (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (remove-from-process *part-engine* self) + (set! (-> self root root-prim local-sphere w) 491520.0) + (cond + ((logtest? (-> *part-group-id-table* 730 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 730)) + ) + ) + (sound-play "fighter-explode") + ) + :trans (behavior () + '() + ) + :code (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 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((a0-1 (-> gp-0 fountain-rand-transv-lo))) + (let ((a1-2 (-> self root trans))) + (let ((a2-1 *up-vector*)) + (let ((a3-1 2048.0)) + (.mov vf7 a3-1) + ) + (.lvf vf5 (&-> a2-1 quad)) + ) + (.lvf vf4 (&-> a1-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-1 quad) vf6) + ) + (let ((a2-2 v1-1)) + (let ((a0-2 (-> self pvel))) + (let ((a1-3 *up-vector*)) + (let ((a3-3 40960.0)) + (.mov vf7 a3-3) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a2-2 quad) vf6) + ) + (let ((a2-3 (-> gp-0 fountain-rand-transv-lo))) + (let ((a0-3 v1-1)) + (let ((a1-4 *identity-vector*)) + (let ((a3-5 -204800.0)) + (.mov vf7 a3-5) + ) + (.lvf vf5 (&-> a1-4 quad)) + ) + (.lvf vf4 (&-> a0-3 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-3 quad) vf6) + ) + (let ((a1-5 (-> gp-0 fountain-rand-transv-hi))) + (let ((a0-4 *identity-vector*)) + (let ((a2-5 204800.0)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-5 quad) vf6) + ) + ) + (set! (-> gp-0 gravity) -122880.0) + (set! (-> gp-0 rot-speed) 16.0) + (set! (-> gp-0 friction) 1.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-fighter-explode" (the-as (pointer level) #f)) + 7 + gp-0 + *fac-fighter-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + (let ((v1-10 (ppointer->process (-> self parent)))) + (+! (-> v1-10 nfighters-spawned) -1) + ) + (while (-> self child) + (suspend) + ) + ) + ) + :post (behavior () + (let ((v1-0 (new 'stack-no-clear 'vector))) + (let ((a0-0 (new 'stack-no-clear 'vector)) + (f0-0 (seconds-per-frame)) + ) + (set-vector! (-> self pacc) 0.0 -327680.0 0.0 1.0) + (vector-float*! a0-0 (-> self pacc) f0-0) + (vector+! (-> self pvel) (-> self pvel) a0-0) + (vector-float*! v1-0 (-> self pvel) f0-0) + ) + (vector+! (-> self root trans) (-> self root trans) v1-0) + ) + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate die (factory-fighter) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (while (not (time-elapsed? (-> self state-time) (seconds 2))) + (ja-no-eval :group! (-> self draw art-group data 4) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + (let ((v1-28 (ppointer->process (-> self parent)))) + (+! (-> v1-28 nfighters-spawned) -1) + ) + ) + ) + +;; definition for method 34 of type factory-fighter +;; WARN: Return type mismatch symbol vs none. +(defmethod init-collision! ((this factory-fighter)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 penetrated-by) (penetrate)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (let ((v1-9 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-9 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-9 prim-core action) (collide-action solid)) + (set-vector! (-> v1-9 local-sphere) 0.0 0.0 0.0 10240.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) (the-as collide-shape-moving s5-0)) + ) + (set! (-> this root event-self) 'touched) + (none) + ) + +;; definition for method 21 of type factory-fighter +(defmethod get-trans ((this factory-fighter) (arg0 int)) + "Get the `trans` for this process." + (-> this root trans) + ) + +;; definition for function factory-fighter-init-by-other +(defbehavior factory-fighter-init-by-other factory-fighter () + (init-collision! self) + (quaternion-identity! (-> self root quat)) + (vector-identity! (-> self root scale)) + (set! (-> self level) (level-get *level* 'factoryb)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-factory-fighter" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! self *fac-fighter-rigid-body-constants*) + (set! (-> self path-idx) (fighter-birth-path (ppointer->process (-> self parent)))) + (vector-reset! (-> self pacc)) + (set! (-> self blendpath) 0.0) + (set! (-> self newpath) 2) + (set! (-> self path-pos) 0.0) + (set! (-> self rot-vel) 0.0) + (set! (-> self rot-acc) 0.0) + (set! (-> self disappear) #f) + (set-time! (-> self last-fire)) + (set! (-> self turret-gun) 5) + (set! (-> self engine-sound) (new-sound-id)) + (set! (-> self engine-sound-playing?) #f) + (set-time! (-> self last-snd-cmd)) + (set! (-> self red-tip-on) #f) + (set-time! (-> self red-tip-change-time)) + (factory-fighter-method-62 self #t) + (set! (-> self draw light-index) (the-as uint 10)) + (logclear! (-> self mask) (process-mask actor-pause)) + (process-entity-status! self (entity-perm-status no-kill) #t) + (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> gp-1 tracked-obj) (process->handle self)) + (set! (-> gp-1 appearance) *factory-fighter-trail*) + (set! (-> gp-1 max-num-crumbs) (the int (* 0.25 (the float (-> gp-1 appearance max-age))))) + (set! (-> gp-1 track-immediately?) #t) + (let* ((v1-38 + (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-1 (get-process *default-dead-pool* light-trail-tracker-vehicle (+ v1-38 8192) 1)) + ) + (set! (-> self light-trail) + (ppointer->handle (when s5-1 + (let ((t9-13 (method-of-type process activate))) + (t9-13 s5-1 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 light-trail-tracker-init-by-other gp-1) + (-> s5-1 ppointer) + ) + ) + ) + ) + ) + (go-virtual idle) + ) + +;; definition for function factory-fighter-spawn +;; WARN: Return type mismatch process vs factory-fighter. +(defun factory-fighter-spawn ((arg0 process)) + (let ((gp-0 (the-as process #f))) + (let ((v1-1 (process-spawn factory-fighter :name "factory-fighter" :to arg0))) + (if v1-1 + (set! gp-0 (-> v1-1 0)) + ) + ) + (the-as factory-fighter gp-0) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-target fac-target fac-target-lod0-jg fac-target-idle-ja + ((fac-target-lod0-mg (meters 20)) (fac-target-lod1-mg (meters 40)) (fac-target-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-target-explode fac-target fac-target-explode-lod0-jg fac-target-explode-idle-ja + ((fac-target-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 10) + ) + +;; definition for symbol *fac-target-exploder-params*, type joint-exploder-static-params +(define *fac-target-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition for method 11 of type fac-target +(defmethod init-from-entity! ((this fac-target) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 penetrated-by) (penetrate)) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 1) 0))) + (set! (-> s4-0 total-prims) (the-as uint 2)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 40960.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy obstacle)) + (set! (-> v1-7 prim-core action) (collide-action solid)) + (set! (-> v1-7 transform-index) 5) + (set-vector! (-> v1-7 local-sphere) 0.0 0.0 16384.0 16384.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-10 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this root event-self) 'touched) + (process-drawable-from-entity! this arg0) + (logclear! (-> this mask) (process-mask actor-pause)) + (process-entity-status! this (entity-perm-status no-kill) #t) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-target" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this light-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 5)) + (set! (-> this draw lod-set lod 0 dist) 409600.0) + (set! (-> this draw lod-set lod 1 dist) 819200.0) + (set! (-> this draw lod-set lod 2 dist) 1024000.0) + (let ((a1-11 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-25 0)) + (if #t + (set! v1-25 (logior v1-25 1)) + ) + (set! (-> a1-11 sync-type) 'sync-paused) + (set! (-> a1-11 sync-flags) (the-as sync-flags v1-25)) + ) + (set! (-> a1-11 entity) (-> this entity)) + (set! (-> a1-11 period) (the-as uint 1500)) + (set! (-> a1-11 percent) 0.0) + (set! (-> a1-11 pause-in) 0.0) + (set! (-> a1-11 pause-out) 0.0) + (initialize! (-> this sync) a1-11) + ) + (fac-target-method-33 this) + (cond + ((task-node-closed? (game-task-node factory-sky-battle-wave2)) + (process-entity-status! this (entity-perm-status subtask-complete) #t) + (let ((v1-34 (-> this root root-prim))) + (set! (-> v1-34 prim-core collide-as) (collide-spec)) + (set! (-> v1-34 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> this draw status) (draw-control-status no-draw)) + (cleanup-for-death this) + (go (method-of-object this die-fast)) + ) + (else + (go (method-of-object this retracted)) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die-fast (fac-target) + :virtual #t + :code nothing + ) + +;; definition for function hack-wave +(defun hack-wave () + (logtest? (current-time) 64) + ) + +;; definition for method 33 of type fac-target +;; WARN: Return type mismatch int vs none. +(defmethod fac-target-method-33 ((this fac-target)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + 0 + (none) + ) + +;; definition for method 34 of type fac-target +;; WARN: Return type mismatch int vs none. +(defmethod fac-target-method-34 ((this fac-target)) + (setup-masks (-> this draw) 0 -1) + (setup-masks (-> this draw) 1 0) + (setup-masks (-> this draw) 2 0) + 0 + (none) + ) + +;; definition for function fac-target-standard-event-handler +(defbehavior fac-target-standard-event-handler fac-target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die-fast) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (go-virtual die-fast) + ) + (('touched) + (let ((gp-0 arg0)) + (when (if (type? gp-0 vehicle) + gp-0 + ) + (sound-play "light-explode" :position (-> self root trans)) + (go-virtual retract) + ) + ) + ) + (('attack) + (let ((v1-8 (the-as attack-info (-> arg3 param 1)))) + (when (or (and (logtest? (-> v1-8 mask) (attack-mask attacker)) + (= (-> (handle->process (-> v1-8 attacker)) type) target) + ) + (let ((gp-2 arg0)) + (if (type? gp-2 warf-projectile) + gp-2 + ) + ) + ) + (sound-play "light-explode" :position (-> self root trans)) + (go-virtual retract) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (fac-target) + :virtual #t + :event fac-target-standard-event-handler + :enter (behavior () + (add-connection *part-engine* self 5 self 2795 (new 'static 'vector :z 24576.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :x 8192.0 :z 16384.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :x -8192.0 :z 16384.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :y 8192.0 :z 16384.0 :w 1638400.0)) + (add-connection *part-engine* self 5 self 2796 (new 'static 'vector :y -8192.0 :z 16384.0 :w 1638400.0)) + (ja :group! fac-target-desend-ja :num! max) + (sync-now! (-> self sync) 0.0) + (set-time! (-> self state-time)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 148) (the-as int #f) (the-as vector #t) 0)) + ) + :trans (behavior () + (ja :num! (seek! 0.0 0.5)) + ) + :code (behavior () + (until #f + (quaternion-axis-angle! + (-> self light-jm quat) + 0.0 + 0.0 + 1.0 + (the float (sar (shl (* 100 (current-time)) 48) 48)) + ) + (suspend) + ) + #f + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate retract (fac-target) + :virtual #t + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (fac-target-method-33 self) + (set-time! (-> self state-time)) + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (let ((s4-0 (-> self node-list data 3 bone transform))) + (vector-float*! s5-0 (-> s4-0 fvec) (* 4096.0 (rand-vu-float-range 20.0 30.0))) + (let ((v1-20 (-> gp-0 fountain-rand-transv-lo))) + (let ((a0-7 (-> self root trans))) + (let ((a1-3 (-> s4-0 fvec))) + (let ((a2-3 2048.0)) + (.mov vf7 a2-3) + ) + (.lvf vf5 (&-> a1-3 quad)) + ) + (.lvf vf4 (&-> a0-7 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-20 quad) vf6) + ) + ) + (let ((a1-4 (-> gp-0 fountain-rand-transv-lo))) + (let ((v1-21 s5-0)) + (let ((a0-8 *identity-vector*)) + (let ((a2-5 -204800.0)) + (.mov vf7 a2-5) + ) + (.lvf vf5 (&-> a0-8 quad)) + ) + (.lvf vf4 (&-> v1-21 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-4 quad) vf6) + ) + (let ((a0-9 (-> gp-0 fountain-rand-transv-hi))) + (let ((v1-22 *identity-vector*)) + (let ((a1-6 204800.0)) + (.mov vf7 a1-6) + ) + (.lvf vf5 (&-> v1-22 quad)) + ) + (.lvf vf4 (&-> s5-0 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-9 quad) vf6) + ) + ) + (set! (-> gp-0 gravity) -122880.0) + (set! (-> gp-0 rot-speed) 16.0) + (cond + ((logtest? (-> *part-group-id-table* 733 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 733)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 733)) + ) + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-target-explode" (the-as (pointer level) #f)) + 9 + gp-0 + *fac-target-exploder-params* + :name "joint-exploder" + :to self + :unk 0 + ) + ) + ) + ) + :trans (behavior () + (ja :num! (seek! 0.0 0.5)) + ) + :code sleep-code + :post transform-post + ) + +;; failed to figure out what this is: +(defstate retracted (fac-target) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('die-fast) + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (cleanup-for-death self) + (let* ((a0-5 self) + (t9-1 (method-of-object a0-5 fac-target-method-34)) + ) + (t9-1 a0-5) + ) + (go-virtual die-fast) + ) + (('trigger) + (when (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + ) + (logior! (-> self draw status) (draw-control-status on-screen)) + (let* ((a0-12 self) + (t9-3 (method-of-object a0-12 fac-target-method-34)) + ) + (t9-3 a0-12) + ) + (go-virtual idle) + ) + ) + ) + ) + :enter (behavior () + (when (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + (let ((v1-5 (-> self root root-prim))) + (set! (-> v1-5 prim-core collide-as) (collide-spec)) + (set! (-> v1-5 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + ) + (ja :group! fac-target-desend-ja :num! max) + (fac-target-method-33 self) + (transform-post) + ) + :trans (behavior () + (ja :num-func num-func-identity :frame-num max) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate explode (fac-target) + :virtual #t + :trans (behavior () + (ja :num-func num-func-identity :frame-num 0.0) + ) + :code sleep-code + :post ja-post + ) + +;; definition for method 20 of type fac-target +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this fac-target)) + (let ((v0-0 0)) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (set! v0-0 (logior v0-0 40)) + ) + (the-as search-info-flag v0-0) + ) + ) + +;; definition for method 21 of type fac-target +(defmethod get-trans ((this fac-target) (arg0 int)) + "Get the `trans` for this process." + (let ((v1-0 (-> this root))) + (cond + ((= arg0 3) + (let ((a2-1 (-> this node-list data 5 bone transform)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set-vector! gp-0 0.0 0.0 20480.0 1.0) + (vector-matrix*! gp-0 gp-0 a2-1) + (set! (-> gp-0 w) 20480.0) + gp-0 + ) + ) + (else + (-> v1-0 trans) + ) + ) + ) + ) + +;; definition for method 7 of type fac-target +;; WARN: Return type mismatch process-focusable vs fac-target. +(defmethod relocate ((this fac-target) (offset int)) + (if (nonzero? (-> this light-jm)) + (&+! (-> this light-jm) offset) + ) + (the-as fac-target ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 26 of type task-manager-factory-sky-battle +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-factory-sky-battle)) + (with-pp + (when (time-elapsed? (-> this check-timer) (seconds 0.1)) + (if (not (-> this factory-sky-battle-entity)) + (task-manager-factory-sky-battle-method-32 this) + ) + (when (not (-> this hint-given)) + (set! (-> this hint-given) #t) + (talker-spawn-func (-> *talker-speech* 101) *entity-pool* (target-pos 0) (the-as region #f)) + ) + (when (< (-> this cur-group) (-> this actor-group-count)) + (let ((s5-1 (-> this actor-group (-> this cur-group)))) + (dotimes (s4-1 (-> s5-1 length)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer pp)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-3 send-event-function) + (v1-21 (-> s5-1 data s4-1 actor)) + ) + (t9-3 + (if v1-21 + (-> v1-21 extra process) + ) + a1-1 + ) + ) + ) + ) + ) + ) + (when (and (zero? (-> this cur-group)) + (> (-> this actor-group-count) 0) + (task-node-closed? (game-task-node factory-sky-battle-wave1)) + ) + (let ((s5-2 (-> this actor-group 0))) + (dotimes (s4-2 (-> s5-2 length)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) (process->ppointer pp)) + (set! (-> a1-2 num-params) 0) + (set! (-> a1-2 message) 'die-fast) + (let ((t9-5 send-event-function) + (v1-36 (-> s5-2 data s4-2 actor)) + ) + (t9-5 + (if v1-36 + (-> v1-36 extra process) + ) + a1-2 + ) + ) + ) + ) + ) + (set! (-> this cur-group) 1) + ) + (when (and (= (-> this cur-group) 1) + (> (-> this actor-group-count) 0) + (task-node-closed? (game-task-node factory-sky-battle-wave2)) + ) + (let ((s5-3 (-> this actor-group 1))) + (dotimes (s4-3 (-> s5-3 length)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 0) + (set! (-> a1-3 message) 'die-fast) + (let ((t9-7 send-event-function) + (v1-53 (-> s5-3 data s4-3 actor)) + ) + (t9-7 + (if v1-53 + (-> v1-53 extra process) + ) + a1-3 + ) + ) + ) + ) + ) + (set! (-> this cur-group) 2) + ) + (set! *fac-wave* (-> this cur-group)) + (let ((s5-4 0)) + (when (> (-> this actor-group-count) 0) + (dotimes (v1-63 (-> this actor-group (-> this cur-group) length)) + (if (not (logtest? (-> this actor-group (-> this cur-group) data v1-63 actor extra perm status) + (entity-perm-status subtask-complete) + ) + ) + (+! s5-4 1) + ) + ) + ) + (if (and (> (-> this actor-group-count) 0) + (= (-> this cur-group) 2) + (zero? s5-4) + (zero? (-> this mission-complete-time)) + ) + (set-time! (-> this mission-complete-time)) + ) + (if (and (nonzero? (-> this mission-complete-time)) + (time-elapsed? (-> this mission-complete-time) (seconds 4)) + (not (task-node-closed? (game-task-node factory-sky-battle-resolution))) + *target* + (not (logtest? (-> *target* focus-status) (focus-status dead))) + ) + (send-event this 'complete) + ) + (when (and (> (-> this actor-group-count) 0) (= (-> this cur-group) 1) (zero? s5-4)) + (task-node-close! (game-task-node factory-sky-battle-wave2) 'event) + (set! (-> this cur-group) 2) + ) + (when (and (> (-> this actor-group-count) 0) (zero? (-> this cur-group)) (zero? s5-4)) + (task-node-close! (game-task-node factory-sky-battle-wave1) 'event) + (set! (-> this cur-group) 1) + ) + (when (!= (-> *game-info* counter) (the float s5-4)) + (if (zero? (-> this hud-delay)) + (set! (-> this hud-delay) (the-as handle (current-time))) + ) + (when (or (time-elapsed? (the-as int (-> this hud-delay)) (seconds 0.5)) (= (-> *game-info* counter) 0.0)) + (cond + ((< 0.0 (-> *game-info* counter)) + (sound-play "hud-chime") + (+! (-> *game-info* counter) -1.0) + ) + (else + (if (= (-> this cur-group) 1) + (sound-play "hud-chime2") + ) + (if (= (-> this cur-group) 2) + (sound-play "hud-chime3") + ) + (set! (-> *game-info* counter) (the float s5-4)) + ) + ) + (set! (-> this hud-delay) (new 'static 'handle)) + 0 + ) + ) + ) + (set-time! (-> this check-timer)) + ) + 0 + (none) + ) + ) + +;; definition for method 32 of type task-manager-factory-sky-battle +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-factory-sky-battle-method-32 ((this task-manager-factory-sky-battle)) + (local-vars (sv-16 res-tag)) + (let ((a0-2 (entity-by-name "factory-sky-battle-manager-1"))) + (when a0-2 + (set! (-> this factory-sky-battle-entity) (the-as entity-actor a0-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data a0-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + ) + (else + (format 0 "ERROR: task-manager-nest-cocoons: nst-cocoon-manager entity missing cocoon actor-group!~%") + ) + ) + ) + (set! (-> this cur-group) 0) + (set! (-> *game-info* counter) 0.0) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-fac-manager :init hud-init-by-other :name "hud-fac-manager" :to this)) + ) + (set! (-> this hud-damage) + (ppointer->handle + (process-spawn hud-factory-damage :init hud-init-by-other :name "hud-factory-damage" :to this) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-factory-sky-battle) + :virtual #t + :enter (behavior () + (send-event (handle->process (-> self hud-damage)) 'hide-and-die) + (let ((t9-2 (-> (find-parent-state) enter))) + (if t9-2 + (t9-2) + ) + ) + ) + ) + +;; definition for method 25 of type task-manager-factory-sky-battle +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-factory-sky-battle)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (set-action! + *gui-control* + (gui-action stop) + (-> this sound-id) + (gui-channel none) + (gui-action none) + (the-as string #f) + (the-as (function gui-connection symbol) #f) + (the-as process #f) + ) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (none) + ) + +;; definition for method 21 of type task-manager-factory-sky-battle +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this task-manager-factory-sky-battle)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-setting! 'allow-look-around #f 0.0 0) + (set! (-> *game-info* counter) 0.0) + (set! *fac-task-manager* (the-as task-manager-factory-sky-battle (process->ppointer this))) + (set! (-> this factory-sky-battle-entity) #f) + (set! (-> this hud-damage) (the-as handle #f)) + (set! (-> this cur-group) 0) + (set! (-> this actor-group-count) 0) + (set! (-> this check-timer) (+ (current-time) (seconds 1))) + (set! (-> this hint-given) #f) + (kill-by-type fac-gun-tower-break *active-pool*) + (none) + ) + +;; definition for method 15 of type hud-fac-manager +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-fac-manager)) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (cond + ((= *fac-wave* 2) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-fac-tower-01 factoryb-minimap))) + (set! (-> this sprites 0 angle) 16384.0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 455 225) + (set-hud-piece-position! (the-as hud-sprite (-> this strings 0 pos)) 488 257) + ) + (else + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-fac-target-01 factoryb-minimap))) + (set! (-> this sprites 0 angle) 0.0) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 488 225) + (set-hud-piece-position! (the-as hud-sprite (-> this strings 0 pos)) 488 257) + ) + ) + (dotimes (s5-1 8) + (set-hud-piece-position! (-> this sprites (+ s5-1 1)) (+ (* 11 (logand s5-1 3)) 430) (+ (if (< 3 s5-1) + 30 + 0 + ) + 145 + ) + ) + (set! (-> this sprites (+ s5-1 1) scale-x) (if (< s5-1 *fac-shotsleft*) + 0.8 + 0.0 + ) + ) + (set! (-> this sprites (+ s5-1 1) scale-y) (if (< s5-1 *fac-shotsleft*) + 0.8 + 0.0 + ) + ) + (set! (-> this sprites (+ s5-1 1) angle) 16384.0) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-fac-manager +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-fac-manager)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-fac-manager +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-fac-manager)) + (set! (-> this level) (level-get *level* 'factoryb)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-fac-target-01 factoryb-minimap))) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 0.66) + (set! (-> this sprites 0 scale-y) 0.66) + (dotimes (s5-0 8) + (set! (-> this sprites (+ s5-0 1) tid) (the-as texture-id (get-texture hud-torpedo factoryb-minimap))) + (set! (-> this sprites (+ s5-0 1) flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites (+ s5-0 1) angle) 16384.0) + (set! (-> this sprites (+ s5-0 1) scale-x) 1.0) + (set! (-> this sprites (+ s5-0 1) scale-y) 1.0) + ) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.8) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + 0 + (none) + ) + +;; definition for function factory-shotsleft +;; WARN: Return type mismatch int vs none. +(defun factory-shotsleft ((arg0 int)) + (set! *fac-shotsleft* arg0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-mood_REF.gc new file mode 100644 index 0000000000..91095d31dd --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-mood_REF.gc @@ -0,0 +1,126 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type factory-states +(deftype factory-states (structure) + ((light light-state :inline) + (blink0 float) + (blink1 float) + ) + ) + +;; definition for method 3 of type factory-states +(defmethod inspect ((this factory-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factory-states) + (format #t "~1Tlight: #~%" (-> this light)) + (format #t "~1Tblink0: ~f~%" (-> this blink0)) + (format #t "~1Tblink1: ~f~%" (-> this blink1)) + (label cfg-4) + this + ) + +;; definition for function update-mood-factory +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-factory time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (copy-mood-exterior arg0) + (when (and (= (-> *level* level arg2 status) 'active) + (< (the-as uint (-> *time-of-day-context* mode)) (the-as uint 9)) + ) + (let ((gp-1 (the-as object (-> arg0 state)))) + (update-mood-light arg0 5 0 1.0 0.0 arg1 0.0 2.0) + (set! (-> arg0 times 6 w) (-> (the-as factory-states gp-1) blink0)) + (set! (-> arg0 times 7 w) (-> (the-as factory-states gp-1) blink1)) + (when (not (paused?)) + (let ((v1-10 (-> *display* part-clock frame-counter))) + (cond + ((< (* 0.2 (the float (mod v1-10 600))) 60.0) + (seek! (-> (the-as factory-states gp-1) blink0) 0.0 (* 0.5 (seconds-per-frame))) + (if (= (-> (the-as factory-states gp-1) blink1) 0.2) + (set! (-> (the-as factory-states gp-1) blink1) 1.0) + ) + (seek! (-> (the-as factory-states gp-1) blink1) 0.2 (* 2.0 (seconds-per-frame))) + ) + (else + (seek! (-> (the-as factory-states gp-1) blink0) 1.0 (* 0.5 (seconds-per-frame))) + (set! (-> (the-as factory-states gp-1) blink1) 0.2) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type factoryd-states +(deftype factoryd-states (structure) + ((electricity electricity-state :inline) + ) + ) + +;; definition for method 3 of type factoryd-states +(defmethod inspect ((this factoryd-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factoryd-states) + (format #t "~1Telectricity: #~%" (-> this electricity)) + (label cfg-4) + this + ) + +;; definition for function update-mood-factoryd +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-factoryd time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (let* ((a0-5 (-> *display* part-clock frame-counter)) + (v1-6 (mod a0-5 300)) + (s5-0 (mod a0-5 900)) + ) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-6)))))) + (set! (-> arg0 times 3 w) (if (< 450 s5-0) + 1.0 + 0.5 + ) + ) + ) + (update-mood-electricity arg0 4 0 0.8 1.0) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function set-factoryd-light! +;; WARN: Return type mismatch float vs none. +(defun set-factoryd-light! ((arg0 float)) + (let ((v1-1 (level-get *level* 'factoryd))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as factoryd-states v1-2) electricity scale) arg0) + ) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-part_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-part_REF.gc new file mode 100644 index 0000000000..921a4d95c8 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-part_REF.gc @@ -0,0 +1,840 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-pulsating-red-light-1 + :id 784 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-pulsating-red-light-2 + :id 785 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2930 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-pulsating-red-light-3 + :id 786 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-pulsating-red-light-4 + :id 787 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-pulsating-red-light-5 + :id 788 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-pulsating-red-light-6 + :id 789 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2929 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000)) + ) + +;; failed to figure out what this is: +(defpart 2929 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 8.0) + (:omega (degrees 225015.75)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 2931) + ) + ) + +;; failed to figure out what this is: +(defpart 2931 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 2932) + ) + ) + +;; failed to figure out what this is: +(defpart 2932 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 2933) + ) + ) + +;; failed to figure out what this is: +(defpart 2933 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-steady-red-light + :id 790 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2934 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2934 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctylights-steady-yellow-glow + :id 791 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2935 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2935 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ctylights-steady-green-glow + :id 792 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2936 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2936 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 0.0 32.0) + (:g 255.0) + (:b 20.0 20.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-flashing-blue-light-1 + :id 793 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017))) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-flashing-blue-light-2 + :id 794 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 200)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-flashing-blue-light-3 + :id 795 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 400)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-flashing-blue-light-4 + :id 796 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 600)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-flashing-blue-light-5 + :id 797 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 800)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-flashing-blue-light-6 + :id 798 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2937 :flags (sp6) :period (seconds 4) :length (seconds 0.017) :offset 1000)) + ) + +;; failed to figure out what this is: +(defpart 2937 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y (meters 4)) + (:r 0.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 8.0) + (:omega (degrees 225015.75)) + (:scalevel-x (meters 0.05)) + (:scalevel-y (meters 0.04)) + (:fade-a 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + (:next-time (seconds 0.335)) + (:next-launcher 2938) + ) + ) + +;; failed to figure out what this is: +(defpart 2938 + :init-specs ((:scale-y (meters 8)) + (:a 12.0) + (:scalevel-x (meters 0)) + (:scalevel-y (meters 0)) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 2939) + ) + ) + +;; failed to figure out what this is: +(defpart 2939 + :init-specs ((:scalevel-x (meters -0.05)) + (:scalevel-y (meters -0.04)) + (:fade-a -0.04) + (:next-time (seconds 0.335)) + (:next-launcher 2940) + ) + ) + +;; failed to figure out what this is: +(defpart 2940 + :init-specs ((:scale-y (meters 4)) (:a 8.0) (:scalevel-x (meters 0)) (:scalevel-y (meters 0)) (:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpartgroup group-steady-blue-light + :id 799 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2941 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2941 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0 32.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-smokestack + :id 800 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2942) (sp-item 2943 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2943 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters 1)) + (:scale-x (meters 24) (meters 1.1)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 240.0) + (:b 100.0) + (:a 12.0 4.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2942 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.053333335) (meters 0.053333335)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.053333335 -0.053333335) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:accel-z (meters 0.001) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 2944) + ) + ) + +;; failed to figure out what this is: +(defpart 2944 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.035) (seconds 0.13)) (:next-launcher 2945)) + ) + +;; failed to figure out what this is: +(defpart 2945 + :init-specs ((:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.14666666) + (:fade-g -0.7866667) + (:fade-b -0.88) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 2946) + ) + ) + +;; failed to figure out what this is: +(defpart 2946 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 2947) + ) + ) + +;; failed to figure out what this is: +(defpart 2947 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.024)) + ) + +;; failed to figure out what this is: +(defpartgroup group-kgtower-smoke :id 801 :bounds (static-bspherem 0 0 0 10) :parts ((sp-item 2948))) + +;; failed to figure out what this is: +(defpart 2948 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.0 0.5) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 24.0 24.0) + (:vel-y (meters 0.03) (meters 0.01)) + (:scalevel-x (meters 0.026666667) (meters 0.026666667)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.21333334) + (:fade-g -0.21333334) + (:fade-b -0.21333334) + (:fade-a -0.026666667 -0.026666667) + (:accel-x (meters -0.001) (meters -0.00033333333)) + (:accel-y (meters 0.0001) (meters 0.0001)) + (:friction 0.96) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.25) (seconds 0.015)) + (:next-launcher 2949) + ) + ) + +;; failed to figure out what this is: +(defpart 2949 + :init-specs ((:scalevel-x (meters 0.02) (meters 0.02)) + (:scalevel-y :copy scalevel-x) + (:next-time (seconds 0.35) (seconds 0.147)) + (:next-launcher 2950) + ) + ) + +;; failed to figure out what this is: +(defpart 2950 + :init-specs ((:scalevel-x (meters 0.013333334) (meters 0.013333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpartgroup group-citylights-oldslums + :id 802 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2951 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2951 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0) + (:b 20.0) + (:a 128.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-citylights-newslums + :id 803 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2952 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2952 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 100.0 28.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 2048.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mhtower-orange-glow + :id 804 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2953 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2953 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 50)) + (:rot-x (degrees 225)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 200.0) + (:b 0.0) + (:a 16.0 4.0) + (:omega (degrees 225015.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mhtower-green-glowing-smoke + :id 805 + :bounds (static-bspherem 0 0 0 10) + :parts ((sp-item 2954)) + ) + +;; failed to figure out what this is: +(defpart 2954 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.1) + (:y (meters 0)) + (:scale-x (meters 8) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 255.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.02)) + (:scalevel-x (meters 0.0033333334) (meters 0.023333333)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.026666667 0.026666667) + (:accel-y (meters 0) (meters -0.0001)) + (:accel-z (meters 0.00033333333) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 8)) + (:flags (sp-cpuinfo-flag-2 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 1)) + (:next-launcher 2955) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2955 + :init-specs ((:fade-a -0.006666667 -0.006666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fact-big-torch + :id 806 + :flags (sp0 sp4 sp11 sp12) + :bounds (static-bspherem 0 1 0 3) + :parts ((sp-item 2956 :fade-after (meters 500) :falloff-to (meters 600) :flags (sp7)) + (sp-item 2957 :fade-after (meters 100) :falloff-to (meters 200) :flags (sp7)) + (sp-item 2958 :falloff-to (meters 60) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2956 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'spt-birth-func-fact-torch) + (:num 4.0 1.0) + (:y (meters 0)) + (:scale-x (meters 1)) + (:rot-z (degrees -20) (degrees 40)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 0.0) + (:a 0.0) + (:vel-y (meters -0.06666667) (meters -0.006666667)) + (:friction 0.99) + (:timer (seconds 0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-fact-torch) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-z (degrees -10) (degrees 20)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition for function sparticle-torch-spline-align +;; WARN: Return type mismatch int vs none. +(defun sparticle-torch-spline-align ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 x) (-> arg1 vel-sxvel x)) + (set! (-> s5-0 y) (-> arg1 vel-sxvel y)) + (set! (-> s5-0 z) (-> arg1 vel-sxvel z)) + (set! (-> s5-0 w) 1.0) + (let ((f30-0 (-> arg2 flag-rot-sy z))) + 0.0 + (vector-normalize! s5-0 1.0) + 0.0 + (let ((a0-2 (-> (math-camera-matrix) fvec))) + 0.0 + (let ((v1-1 (new 'stack-no-clear 'vector))) + (let ((f0-8 (vector-dot a0-2 s5-0))) + (vector-float*! v1-1 a0-2 f0-8) + ) + (vector-! s5-0 s5-0 v1-1) + ) + ) + (let ((a2-2 (matrix-transpose! (new 'stack-no-clear 'matrix) (math-camera-matrix)))) + (vector-matrix*! s5-0 s5-0 a2-2) + ) + (let* ((f0-16 (the float (sar (shl (the int (atan (-> s5-0 y) (* -1.0 (-> s5-0 x)))) 48) 48))) + (f0-20 (the float (sar (shl (the int (+ 16384.0 f0-16)) 48) 48))) + (t9-6 deg-seek) + (a0-7 f30-0) + (a1-11 f0-20) + (a2-3 (* 65536.0 (seconds-per-frame))) + (f0-23 (t9-6 a0-7 a1-11 a2-3)) + ) + (rot-to-particle f0-23 arg2 (the-as matrix a2-3)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function spt-func-fact-torch +(defun spt-func-fact-torch ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (live-func-curve arg0 arg1 (the-as vector arg2)) + (spt-func-relative-pos arg0 arg1 (the-as sprite-vec-data-3d arg2)) + (sparticle-torch-spline-align arg0 arg1 (the-as sprite-vec-data-2d arg2)) + (none) + ) + +;; definition for function spt-birth-func-fact-torch +(defun spt-birth-func-fact-torch ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-curve (the-as int arg0) arg1 arg2) + (birth-func-flip-based-on-scale + arg0 + arg1 + (the-as sprite-vec-data-3d arg2) + (the-as sparticle-launcher arg3) + (the-as sparticle-launch-state arg4) + ) + (none) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-color-fact-big-torch-flame* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :z 255.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 10.0 :y 1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-alpha-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 40.0 :y 100.0 :z 101.0 :w 102.0) + :one-over-x-deltas (new 'static 'vector :x 60.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-fact-big-torch-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -0.5001 :w -1.0) + :ys (new 'static 'vector :x -8.0 :y -5.0 :z 5.0 :w 8.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y -20.004002 :z 6.0012007 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-scale-fact-big-torch-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.5001 :w -1.0) + :ys (new 'static 'vector :x -6.0 :y -10.0 :z 6.0 :w 10.0) + :one-over-x-deltas (new 'static 'vector :x -8.0 :y 159973.45 :z 8.0016 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *r-curve-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 1.0 :z 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 1.6 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *g-curve-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 2.0 :y -1.9999994 :z -1.5000001 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *b-curve-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.31 :w -1.0) + :ys (new 'static 'vector :x 1.0 :y 1.0) + :one-over-x-deltas (new 'static 'vector :y -100.0001 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-alpha-fact-big-torch-flame* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 10.0 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fact-big-torch-flame-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.6 :w -1.0) + :ys (new 'static 'vector :x 0.3 :y 0.6 :z 0.5 :w 0.2) + :one-over-x-deltas (new 'static 'vector :x 0.6 :y -1.0 :z -0.75000006 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fact-big-torch-flame-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.5 :z -0.7 :w -1.0) + :ys (new 'static 'vector :x 0.2 :y 0.4 :z 0.5 :w 0.6) + :one-over-x-deltas (new 'static 'vector :x 0.4 :y 0.5 :z 0.3333334 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-fact-big-torch-flame-curve-settings*, type particle-curve-settings +(define *part-fact-big-torch-flame-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.05) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf1 pcf2) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2956 init-specs 15 initial-valuef) + (the-as float *part-fact-big-torch-flame-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* color-start) *range-color-fact-big-torch-flame*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* alpha-start) *range-alpha-fact-big-torch-flame*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-x-start) *range-scale-fact-big-torch-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-y-start) *range-scale-fact-big-torch-flame-y*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* r-scalar) *r-curve-fact-big-torch-flame*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* g-scalar) *g-curve-fact-big-torch-flame*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* b-scalar) *b-curve-fact-big-torch-flame*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* a-scalar) *curve-alpha-fact-big-torch-flame*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-x-scalar) *curve-fact-big-torch-flame-x*) + +;; failed to figure out what this is: +(set! (-> *part-fact-big-torch-flame-curve-settings* scale-y-scalar) *curve-fact-big-torch-flame-y*) + +;; failed to figure out what this is: +(defpart 2957 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.4) + (:y (meters 2)) + (:scale-x (meters 30) (meters 2)) + (:rot-x (degrees 6.7500005)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 32.0) + (:b 0.0) + (:a 24.0 8.0) + (:omega (degrees 11261.25)) + (:timer (seconds 0.167) (seconds 0.08)) + (:flags (sp-cpuinfo-flag-3 glow set-conerot)) + (:userdata 2048.0) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2958 + :init-specs ((:num 1.0) + (:x (meters -2) (meters 4)) + (:y (meters 2)) + (:z (meters -2) (meters 4)) + (:rot-x 8) + (:r 12288.0) + (:g 1638.4) + (:b 1638.4) + (:vel-y (meters 0.06666667)) + (:fade-b -1.3653333) + (:accel-y (meters 0.00066666666) (meters 0.00033333333)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (distort launch-along-z)) + (:next-time (seconds 1)) + (:next-launcher 2959) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2959 + :init-specs ((:fade-b 1.3653333)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factory-scenes_REF.gc b/test/decompiler/reference/jak3/levels/factory/factory-scenes_REF.gc new file mode 100644 index 0000000000..f82be00910 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factory-scenes_REF.gc @@ -0,0 +1,1587 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *war-factory-vehicle-mask*, type uint +(define *war-factory-vehicle-mask* (the-as uint 0)) + +;; definition for symbol *war-factory-effects-mask*, type uint +(define *war-factory-effects-mask* (the-as uint 0)) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-sky-battle-intro-b" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-150" + :art-group "scenecamera" + :anim "factory-sky-battle-intro-b" + :parts 8 + :command-list '((0 + (fadein (frame-time-30 10)) + (kill "lfac-hanger-door-1") + (part-tracker + "group-fma-hellcat-heathaze-ground" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 297) + ) + (apply ,(lambda :behavior scene-player + () + (set-lfacrm1-door! 0.0) + (let ((v1-1 (level-get *level* 'lfaccity))) + (if v1-1 + (logclear! (-> v1-1 info level-flags) (level-flags use-camera-other)) + ) + ) + (none) + ) + ) + ) + (262 (part-tracker + "group-hellcat-thrusters-fire" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 262 285) + ) + ) + (266 (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 266 285) + ) + ) + (270 (part-tracker + "group-hellcat-thrusters-fire" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 270 285) + ) + ) + (286 + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 286 704) + ) + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 286 704) + ) + (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 286 400) + ) + ) + (297 (part-tracker + "group-fma-hellcat-heathaze" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 298 701) + ) + ) + (510 (apply ,(lambda :behavior scene-player () (none)))) + (690 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (disable *screen-filter*) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-setting! 'allow-blackout #f 0.0 0) + ) + (none) + ) + ) + ) + (701 (want-display 'factoryb 'display)) + (702 + (part-tracker + "group-hellcat-thrusters-follow" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 702 1000) + ) + (part-tracker + "group-hellcat-thrusters-follow" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 702 1000) + ) + ) + (720 (apply ,(lambda :behavior scene-player + () + (when (not (-> self aborted?)) + (remove-setting! 'allow-blackout) + (setup + *screen-filter* + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0) + (* 1.1111112 (seconds-per-frame)) + (bucket-id tex-hud-pris2) + #x3fffff + #x33001 + #t + ) + (set-filter-color! 1.0 1.0 1.0) + ) + (none) + ) + ) + ) + (870 (fadeout (frame-time-30 30))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((v1-1 (level-get *level* 'lfaccity))) + (if v1-1 + (logior! (-> v1-1 info level-flags) (level-flags use-camera-other)) + ) + ) + (none) + ) + ) + (task-close! "factory-sky-battle-hanger") + ) + ) + :cut-list '(111 210 297 701) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "hellcat-movie" + :level 'factorya + :art-group "skel-hellcat-movie" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x1fe + ) + (new 'static 'scene-actor + :name "particleman" + :level 'factorya + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "lfac-hanger-door" + :level 'factorya + :art-group "skel-lfac-hanger-door" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :light-index #xa + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factorya-intro-b" + :end-point "factoryb-start" + :borrow '((factorya 1 lfacrm1 copy)) + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene + (new 'static 'scene + :name "factory-sky-battle-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4 scf8) + :mask-to-clear (process-mask movie projectile) + :entity "scene-stage-151" + :art-group "scenecamera" + :anim "factory-sky-battle-res" + :parts 6 + :command-list '((0 + (fadein (frame-time-30 10)) + (send-event "h-warf" 'eval ,(lambda :behavior scene-player + ((arg0 process-drawable)) + (when (nonzero? *war-factory-vehicle-mask*) + (set! (-> arg0 draw seg-mask) *war-factory-vehicle-mask*) + (set! (-> arg0 draw effect-mask) *war-factory-effects-mask*) + ) + (none) + ) + ) + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 250) + ) + (part-tracker + "group-hellcat-thruster-trail-fac" + entity + "particleman" + joint + "particleA" + track + #t + duration + (frame-range 0 250) + ) + (part-tracker + "group-hellcat-thrusters-fac" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 0 250) + ) + (part-tracker + "group-hellcat-thruster-trail-fac" + entity + "particleman" + joint + "particleB" + track + #t + duration + (frame-range 0 250) + ) + (want-display 'lfacrm2 'display) + ) + (141 (part-tracker + "group-fma-hellcat-heathaze" + entity + "particleman" + joint + "particleE" + track + #t + duration + (frame-range 141 270) + ) + ) + (210 (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleC" + track + #t + duration + (frame-range 210 260) + ) + ) + (230 (part-tracker + "group-hellcat-dust-landing-fac" + entity + "particleman" + joint + "particleD" + track + #t + duration + (frame-range 230 270) + ) + ) + (595 (fadeout (frame-time-30 20))) + (10000 (task-close! "factory-sky-battle-resolution")) + ) + :cut-list '(141) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "particleman" + :level 'factoryb + :art-group "skel-particleman" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factoryb + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factoryb + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "h-warf" + :level 'factorya + :art-group "skel-h-warf" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x1fe + ) + ) + :load-point "factorya-movie" + :end-point "factoryc-start-lfacrm2" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xd9 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-assault-res" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "camera-start-151" + :art-group "scenecamera" + :anim "arena-training-1-intro" + :parts 16 + :command-list '((10000 (task-close! "factory-boss-introduction"))) + :cut-list '() + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factoryc-start" + :end-point "factoryd-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe5 + :on-running #f + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-boss-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-204" + :art-group "scenecamera" + :anim "factory-boss-intro" + :parts 16 + :command-list '((0 + (fadein (frame-time-30 10)) + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryd) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + ) + (1801 (fadeout (frame-time-30 10))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-boss-introduction") + ) + ) + :cut-list '(0 353 415 851 989 1065 1254 1748) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x280 + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "errol" + :level 'factorya + :art-group "skel-errol" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + ) + :load-point "factoryd-start" + :end-point "factoryd-start" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe6 + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-indax-1-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-181" + :art-group "scenecamera" + :anim "factory-indax-1-intro" + :parts 4 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (410 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-1-introduction") + ) + ) + :cut-list '(200) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-1" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xdb + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-indax-2-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-180" + :art-group "scenecamera" + :anim "factory-indax-2-intro" + :parts 3 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (340 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-2-introduction") + ) + ) + :cut-list '(163) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-2" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xdd + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-indax-3-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-179" + :art-group "scenecamera" + :anim "factory-indax-3-intro" + :parts 3 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (320 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-3-introduction") + ) + ) + :cut-list '(145 241) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-3" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xdf + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(load-scene (new 'static 'scene + :name "factory-indax-4-intro" + :extra #f + :info #f + :scene-flags (scene-flags scf1 scf2 scf3 scf4) + :mask-to-clear (process-mask movie enemy platform projectile) + :entity "scene-stage-178" + :art-group "scenecamera" + :anim "factory-indax-4-intro" + :parts 3 + :command-list '((0 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function mood-context none) #f) (-> gp-0 mood-context)) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factoryc) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (fadein (frame-time-30 10)) + ) + (340 (fadeout (frame-time-30 20))) + (10000 + (apply ,(lambda :behavior scene-player + () + (let ((gp-0 (level-get *level* 'factorya))) + (when gp-0 + (clear-mood-context (-> gp-0 mood-context)) + (if #f + ((the-as (function level none) #f) (the-as level (-> gp-0 mood-context))) + ) + (set! (-> gp-0 info mood-func) 'update-mood-factory) + (logior! (-> gp-0 info level-flags) (level-flags lf9)) + ) + ) + (none) + ) + ) + (task-close! "factory-assault-indax-4-introduction") + ) + ) + :cut-list '(191) + :wait-ground-time (seconds 1) + :actor (new 'static 'boxed-array :type scene-actor + (new 'static 'scene-actor + :name "scenecamera" + :level #f + :art-group "skel-scenecamera" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :camera 4 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "sidekick-highres" + :level 'factorya + :art-group "skel-sidekick-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + ) + (new 'static 'scene-actor + :name "jakc-highres" + :level 'factorya + :art-group "skel-jakc-highres" + :prefix "" + :draw-frames '((min max)) + :scissor-frames '() + :shadow-frames '((min max)) + :cloth-reset-frames '() + :cloth-commands '() + :flags #x1 + :shadow-flags -1 + :shadow-volume-joint #f + :no-draw-seg #x80 + ) + ) + :load-point "factoryc-start" + :end-point "factory-indax-4" + :borrow '() + :sfx-volume -1.0 + :ambient-volume -1.0 + :music-delay 1500.0 + :scene-task #xe1 + :on-running '(sound-play-loop "factory-amb-mov") + :on-complete #f + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-hellcat-heathaze-ground + :id 756 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2833 :flags (sp7)) (sp-item 2834 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2833 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b -5.4613333) + (:accel-x (meters -0.00066666666) (meters 0.0013333333)) + (:accel-y (meters 0.001)) + (:accel-z (meters -0.00066666666) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:next-time (seconds 0.167)) + (:next-launcher 2835) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2835 + :init-specs ((:fade-b 5.4613333)) + ) + +;; failed to figure out what this is: +(defpart 2834 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b 5.4613333) + (:accel-x (meters -0.00066666666) (meters 0.0013333333)) + (:accel-y (meters 0.001)) + (:accel-z (meters -0.00066666666) (meters 0.0013333333)) + (:timer (seconds 0.335)) + (:flags (distort)) + (:next-time (seconds 0.167)) + (:next-launcher 2836) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2836 + :init-specs ((:fade-b -5.4613333)) + ) + +;; failed to figure out what this is: +(defpartgroup group-fma-hellcat-heathaze + :id 757 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2837 :flags (sp7)) (sp-item 2838 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2837 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b -2.7306666) + (:timer (seconds 0.667)) + (:flags (distort)) + (:next-time (seconds 0.335)) + (:next-launcher 2839) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2839 + :init-specs ((:fade-b 2.7306666)) + ) + +;; failed to figure out what this is: +(defpart 2838 + :init-specs ((:num 2.0) + (:x (meters 0) (meters 5)) + (:rot-x 6) + (:r 2048.0) + (:g 1024.0) + (:b 1024.0) + (:vel-y (meters -0.016666668)) + (:fade-b 2.7306666) + (:timer (seconds 0.667)) + (:flags (distort)) + (:next-time (seconds 0.335)) + (:next-launcher 2840) + (:conerot-x (degrees -10) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2840 + :init-specs ((:fade-b -2.7306666)) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thrusters-fire + :id 758 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2841 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 2842 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 2841 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 2.0) + (:z (meters -1.5)) + (:scale-x (meters 3) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 255.0) + (:g 150.0) + (:b 0.0) + (:a 30.0 30.0) + (:scalevel-x (meters -0.02)) + (:fade-a -0.6) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2842 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 6) (meters 1)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 0.0) + (:a 10.0 2.0) + (:omega (degrees 4511.25)) + (:fade-a -0.12) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thrusters-fac + :id 759 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2843 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 2844 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 2843 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -1.5)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 30.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2844 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 3.0) + (:scale-x (meters 5) (meters 1)) + (:rot-x (degrees 6.7500005)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 12.0 2.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4.096) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thrusters-follow + :id 760 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2845 :flags (is-3d sp7) :period (seconds 0.017) :length (seconds 0.017)) + (sp-item 2846 :flags (sp7) :period (seconds 0.017) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 2845 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:num 4.0) + (:z (meters -1.5)) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 180)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0) 1 (degrees 90)) + (:scale-y (meters 3) (meters 1)) + (:r 10.0 20.0) + (:g 200.0) + (:b 255.0) + (:a 30.0 30.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-x (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2846 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 3.0) + (:scale-x (meters 5) (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 100.0 28.0) + (:b 255.0) + (:a 12.0 2.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-thruster-trail-fac + :id 761 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 2847 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + (sp-item 2848 :flags (sp7) :period (seconds 0.035) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 2847 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 4.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 10.0 5.0) + (:vel-z (meters 0) (meters -0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.05 -0.05) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2848 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:num 4.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 120.0) + (:b 255.0) + (:a 10.0 5.0) + (:vel-z (meters -0.33333334) (meters -0.33333334)) + (:scalevel-x (meters 0.006666667) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.05 -0.05) + (:friction 0.5) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-hellcat-dust-landing-fac + :id 762 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 64) + :parts ((sp-item 2849 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2849 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 100.0) + (:b 60.0) + (:a 0.0) + (:vel-x (meters 0.033333335) (meters 0.06666667)) + (:accel-y (meters 0) (meters 0.00016666666)) + (:timer (seconds 3)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-z (degrees 0)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fac-dust-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 120.0 :y 120.0 :z 120.0 :w 128.0) + (new 'static 'vector :x 80.0 :y 80.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 80.0 :y 80.0 :z 80.0 :w 128.0) + (new 'static 'vector :x 80.0 :y 80.0 :z 80.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fac-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 20.0 :y 40.0 :z 41.0 :w 42.0) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fac-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-fac-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 2.0 :z 3.0 :w 4.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-fac-dust-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.5 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 1.0) + :one-over-x-deltas (new 'static 'vector :x 3.3333333 :z -2.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fac-dust-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-fac-dust-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.3 :z -0.4 :w -1.0) + :ys (new 'static 'vector :y 5.0 :z 6.0 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 16.666666 :y 10.000001 :z 0.8333333 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-hellcat-dust-landing-fac-curve-settings*, type particle-curve-settings +(define *part-hellcat-dust-landing-fac-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 1.5) + :lifetime-offset (seconds 1) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2849 init-specs 15 initial-valuef) + (the-as float *part-hellcat-dust-landing-fac-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* color-start) *range-fac-dust-color*) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* alpha-start) *range-fac-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-x-start) *range-fac-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-y-start) *range-fac-dust-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* a-scalar) *curve-fac-dust-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-x-scalar) *curve-fac-dust-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-hellcat-dust-landing-fac-curve-settings* scale-y-scalar) *curve-fac-dust-scale-y*) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factorya-init_REF.gc b/test/decompiler/reference/jak3/levels/factory/factorya-init_REF.gc new file mode 100644 index 0000000000..fbfa9826ca --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factorya-init_REF.gc @@ -0,0 +1,36 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function factorya-login +;; WARN: Return type mismatch int vs none. +(defun factorya-login ((arg0 level)) + 0 + (none) + ) + +;; definition for function factorya-activate +;; WARN: Return type mismatch int vs none. +(defun factorya-activate ((arg0 level)) + (let ((gp-0 *traffic-info*) + (v1-1 (level-get *level* 'factorya)) + ) + (set! (-> gp-0 vehicle-level) v1-1) + (set! (-> gp-0 vehicle-levels 8) (-> v1-1 name)) + ) + (vehicle-manager-start (the-as process *entity-pool*)) + 0 + (none) + ) + +;; definition for function factorya-deactivate +;; WARN: Return type mismatch int vs none. +(defun factorya-deactivate ((arg0 level)) + (set! (-> *traffic-info* vehicle-level) #f) + (vehicle-manager-kill) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc new file mode 100644 index 0000000000..01b62c65c3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factoryb-init_REF.gc @@ -0,0 +1,22 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function factoryb-activate +;; WARN: Return type mismatch int vs none. +(defun factoryb-activate ((arg0 level)) + (cond + ((= (status-of-level-and-borrows *level* 'lfactory #f) 'active) + (format 0 "factoryb-activate~%") + (factory-manager-start arg0) + ) + (else + (format 0 "WARNING: factoryb is starting up without lfactory, there will be no manager.") + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-manager_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-manager_REF.gc new file mode 100644 index 0000000000..6f5299c80e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-manager_REF.gc @@ -0,0 +1,175 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function factoryd-activate +;; WARN: Return type mismatch int vs none. +(defun factoryd-activate ((arg0 level)) + (if (and (nonzero? *nav-network*) *nav-network*) + (init-by-other! *nav-network* arg0 *factoryd-adjacency*) + ) + 0 + (none) + ) + +;; definition of type task-manager-factory-assault +(deftype task-manager-factory-assault (task-manager) + ((explode-car-time time-frame) + (daxter-done symbol) + (region-hack symbol) + ) + ) + +;; definition for method 3 of type task-manager-factory-assault +(defmethod inspect ((this task-manager-factory-assault)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Texplode-car-time: ~D~%" (-> this explode-car-time)) + (format #t "~2Tdaxter-done: ~A~%" (-> this daxter-done)) + (format #t "~2Tregion-hack: ~A~%" (-> this region-hack)) + (label cfg-4) + this + ) + +;; definition for method 26 of type task-manager-factory-assault +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-factory-assault)) + (when (< -1 (-> this explode-car-time)) + (let* ((s4-0 (handle->process (-> *vehicle-info* handle-by-vehicle-type 21))) + (s5-0 (if (type? s4-0 process-focusable) + (the-as process-focusable s4-0) + ) + ) + ) + (when s5-0 + (cond + ((and (or (focus-test? s5-0 dead) (< 245760.0 (- (-> (target-pos 0) y) (-> s5-0 root trans y)))) + (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + ) + (if (and *target* (focus-test? *target* indax)) + (send-event + *target* + 'attack-invinc + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 100.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode 'death)) + ) + ) + ) + (send-event this 'fail) + ) + ((= (-> this player-vehicle) #f) + (set! (-> this player-vehicle) (process->handle (send-event *target* 'get-vehicle))) + ) + ) + ) + ) + ) + (when (not (-> this daxter-done)) + (cond + ((task-node-closed? (game-task-node factory-assault-indax-4)) + (set! (-> this daxter-done) #t) + (remove-setting! 'pilot) + ) + (else + (set-setting! 'pilot #f 0.0 0) + ) + ) + ) + (if (and *target* (focus-test? *target* pilot-riding)) + (task-close! "factory-assault-get-vehicle") + ) + (when (and (> (-> this explode-car-time) 0) (< (-> this explode-car-time) (current-time))) + (let* ((s4-1 (handle->process (-> *vehicle-info* handle-by-vehicle-type 21))) + (s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when s5-1 + (cond + ((-> this region-hack) + (set! (-> this explode-car-time) 0) + (send-event + s5-1 + 'attack + #f + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) (damage 250.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 0.0)) + ) + ) + ) + (else + (set! (-> this explode-car-time) -1) + (send-event *target* 'invulnerable 360) + (let ((v1-63 (new 'static 'vector :z 4096.0 :w 1.0))) + (send-event s5-1 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 250.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 0.1) + (attacker-velocity v1-63) + ) + ) + ) + ) + (task-close! "factory-assault-broke-ultimate-fence") + ) + ) + ) + ) + ) + (none) + ) + +;; definition for method 30 of type task-manager-factory-assault +;; WARN: disable def twice: 18. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. +(defmethod taskman-event-handler ((this task-manager-factory-assault) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v0-0 object)) + (case arg2 + (('vehicle-breached) + (set! v0-0 (+ (current-time) (seconds 1))) + (set! (-> this explode-car-time) (the-as time-frame v0-0)) + v0-0 + ) + (('faccar-terminate) + (when (and *target* (focus-test? *target* pilot-riding)) + (set! (-> this explode-car-time) (+ (current-time) (seconds 2))) + (set! v0-0 #t) + (set! (-> this region-hack) (the-as symbol v0-0)) + v0-0 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 27 of type task-manager-factory-assault +(defmethod task-manager-method-27 ((this task-manager-factory-assault)) + (send-event (handle->process (-> this player-vehicle)) 'go-die) + (set! (-> this player-vehicle) (the-as handle #f)) + ((method-of-type task-manager task-manager-method-27) this) + (none) + ) + +;; definition for method 21 of type task-manager-factory-assault +(defmethod set-time-limit ((this task-manager-factory-assault)) + (set! (-> this explode-car-time) 0) + (set! (-> this daxter-done) #f) + (set! (-> this region-hack) #f) + (set-setting! 'unique-vehicle-mission-critical #f 0.0 0) + ((method-of-type task-manager set-time-limit) this) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-mood_REF.gc new file mode 100644 index 0000000000..a2525db88e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-mood_REF.gc @@ -0,0 +1,71 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type factoryc-states +(deftype factoryc-states (structure) + ((electricity electricity-state 2 :inline) + (flame flames-state :inline :offset 32) + ) + ) + +;; definition for method 3 of type factoryc-states +(defmethod inspect ((this factoryc-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'factoryc-states) + (format #t "~1Telectricity[2] @ #x~X~%" (-> this electricity)) + (format #t "~1Tflame: #~%" (-> this flame)) + (label cfg-4) + this + ) + +;; definition for function update-mood-factoryc +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-factoryc time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior-ambient arg0 #t 0.0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 1 w) 1.0) + (let* ((a0-5 (-> *display* part-clock frame-counter)) + (v1-7 (mod a0-5 300)) + (s5-0 (mod a0-5 900)) + ) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-7)))))) + (set! (-> arg0 times 3 w) (if (< 450 s5-0) + 1.0 + 0.5 + ) + ) + ) + (update-mood-electricity arg0 4 0 0.8 1.0) + (update-mood-electricity arg0 6 16 0.8 1.0) + (update-mood-flames arg0 5 1 32 0.85 0.00068359374 2.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + +;; definition for function set-factoryc-light! +;; WARN: Return type mismatch float vs none. +(defun set-factoryc-light! ((arg0 float) (arg1 int)) + (let ((v1-1 (level-get *level* 'factoryc))) + (when v1-1 + (let ((v1-2 (the-as object (-> v1-1 mood-context state)))) + (set! (-> (the-as factoryc-states (+ (the-as uint v1-2) (* arg1 16))) electricity 0 scale) arg0) + ) + ) + ) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc new file mode 100644 index 0000000000..fcb4cc4768 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-obs2_REF.gc @@ -0,0 +1,2153 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fac-break-floor +(deftype fac-break-floor (process-drawable) + ((root collide-shape :override) + (notify-actor entity-actor) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type fac-break-floor +(defmethod inspect ((this fac-break-floor)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-floor fac-break-floor fac-break-floor-lod0-jg fac-break-floor-idle-ja + ((fac-break-floor-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-floor-explode fac-break-floor fac-break-floor-explode-lod0-jg fac-break-floor-explode-idle-ja + ((fac-break-floor-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; definition for symbol *fac-break-floor-exploder-params*, type joint-exploder-static-params +(define *fac-break-floor-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 21 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 22 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 23 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 24 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 25 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 26 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; failed to figure out what this is: +(defstate idle (fac-break-floor) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (logtest? (-> (the-as attack-info (-> block param 1)) penetrate-using) (penetrate flop)) + (go-virtual die) + #f + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (fac-break-floor) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (sound-play "break-floor") + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) (process->ppointer self)) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'trigger) + (let ((t9-2 send-event-function) + (v1-6 (-> self notify-actor)) + ) + (t9-2 + (if v1-6 + (-> v1-6 extra process) + ) + a1-1 + ) + ) + ) + ) + :code (behavior () + ((lambda :behavior fac-break-floor + () + (cond + ((logtest? (-> *part-group-id-table* 750 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 750)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 750)) + ) + ) + (let ((gp-2 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (a0-14 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when a0-14 + (set! (-> gp-2 fountain-rand-transv-lo quad) (-> (get-trans a0-14 0) quad)) + (+! (-> gp-2 fountain-rand-transv-lo y) 16384.0) + ) + ) + (set! (-> gp-2 fountain-rand-transv-hi x) 24576.0) + (set! (-> gp-2 fountain-rand-transv-hi y) 81920.0) + (set! (-> gp-2 fountain-rand-transv-hi z) 12288.0) + (set! (-> gp-2 fountain-rand-transv-hi w) 32768.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-floor-explode" (the-as (pointer level) #f)) + 6 + gp-2 + *fac-break-floor-exploder-params* + :name "joint-exploder" + :to self + ) + ) + ) + ) + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +;; definition for method 11 of type fac-break-floor +(defmethod init-from-entity! ((this fac-break-floor) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 0.0 0.0 0.0 20480.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) + ) + (set! (-> this root penetrated-by) (penetrate flop)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-floor" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-15 (-> this skel root-channel 0))) + (set! (-> a0-15 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-15 frame-num) 0.0) + (joint-control-channel-group! a0-15 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (go (method-of-object this idle)) + ) + +;; definition of type fac-break-fence +(deftype fac-break-fence (process-focusable) + ((notify-actor entity-actor) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type fac-break-fence +(defmethod inspect ((this fac-break-fence)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (fac-break-fence) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('impact-impulse) + (let ((gp-0 (the-as object (-> block param 0)))) + (format #t "roboguard::handle-events: got impact-impulse ~M~%" (-> (the-as rigid-body-impact gp-0) impulse)) + (when (< 16384.0 (-> (the-as rigid-body-impact gp-0) impulse)) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.15)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 192 (seconds 0.1)) + (go-virtual die) + #t + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (fac-break-fence) + :virtual #t + :enter (behavior () + '() + ) + :code (behavior () + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +;; definition for method 27 of type fac-break-fence +(defmethod get-inv-mass ((this fac-break-fence)) + 6.6666665 + ) + +;; definition of type fac-break-fence-a +(deftype fac-break-fence-a (fac-break-fence) + ((pad uint8 4) + ) + ) + +;; definition for method 3 of type fac-break-fence-a +(defmethod inspect ((this fac-break-fence-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type fac-break-fence inspect))) + (t9-0 this) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-fence-a fac-break-fence-a fac-break-fence-a-lod0-jg fac-break-fence-a-idle-ja + ((fac-break-fence-a-lod0-mg (meters 999999))) + :bounds (static-spherem 9 6 0 12) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-fence-a-explode fac-break-fence-a fac-break-fence-a-explode-lod0-jg fac-break-fence-a-explode-idle-ja + ((fac-break-fence-a-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +;; definition for symbol *fac-break-fence-a-exploder-params*, type joint-exploder-static-params +(define *fac-break-fence-a-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :collide-sound (static-sound-name "fence-debris") + :collide-sound-interval (seconds 0.4) + ) + ) + +;; failed to figure out what this is: +(defstate die (fac-break-fence-a) + :virtual #t + :enter (behavior () + (local-vars (v1-10 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (get-trans s4-0 0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-0 0) (-> self root trans))) + (s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (.lvf vf1 (&-> s4-1 quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (if (< (the int v1-10) 0) + (vector-negate-in-place! s4-1) + ) + (vector+float*! (-> gp-0 fountain-rand-transv-lo) s5-1 s4-1 49152.0) + ) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 49152.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 262144.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 0.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-fence-a-explode" (the-as (pointer level) #f)) + 6 + gp-0 + *fac-break-fence-a-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((a1-9 (new 'static 'vector :x 49152.0 :y 24576.0 :w 1.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) + (cond + ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-hit-fence") + (sound-play "fence-break") + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +;; definition for method 11 of type fac-break-fence-a +(defmethod init-from-entity! ((this fac-break-fence-a) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 36864.0 24576.0 0.0 49152.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-fence-a" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (if (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + (go (method-of-object this idle)) + ) + ) + +;; definition of type fac-break-fence-b +(deftype fac-break-fence-b (fac-break-fence) + ((pad uint8 4) + ) + ) + +;; definition for method 3 of type fac-break-fence-b +(defmethod inspect ((this fac-break-fence-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type fac-break-fence inspect))) + (t9-0 this) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-fence-b fac-break-fence-b fac-break-fence-b-lod0-jg fac-break-fence-b-idle-ja + ((fac-break-fence-b-lod0-mg (meters 999999))) + :bounds (static-spherem 10 6 0 12.5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-fence-b-explode fac-break-fence-b fac-break-fence-b-explode-lod0-jg fac-break-fence-b-explode-idle-ja + ((fac-break-fence-b-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +;; definition for symbol *fac-break-fence-b-exploder-params*, type joint-exploder-static-params +(define *fac-break-fence-b-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :collide-sound (static-sound-name "fence-debris") + :collide-sound-interval (seconds 0.4) + ) + ) + +;; failed to figure out what this is: +(defstate die (fac-break-fence-b) + :virtual #t + :enter (behavior () + (local-vars (v1-10 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (get-trans s4-0 0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-0 0) (-> self root trans))) + (s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (.lvf vf1 (&-> s4-1 quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (if (< (the int v1-10) 0) + (vector-negate-in-place! s4-1) + ) + (vector+float*! (-> gp-0 fountain-rand-transv-lo) s5-1 s4-1 49152.0) + ) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 49152.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 262144.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 0.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-fence-b-explode" (the-as (pointer level) #f)) + 6 + gp-0 + *fac-break-fence-b-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((a1-9 (new 'static 'vector :x 49152.0 :y 24576.0 :w 1.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) + (cond + ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-hit-fence") + (sound-play "fence-break") + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +;; definition for method 11 of type fac-break-fence-b +(defmethod init-from-entity! ((this fac-break-fence-b) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 40960.0 24576.0 0.0 51200.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-fence-b" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (if (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + (go (method-of-object this idle)) + ) + ) + +;; definition of type fac-break-fence-c +(deftype fac-break-fence-c (fac-break-fence) + ((pad uint8 4) + ) + ) + +;; definition for method 3 of type fac-break-fence-c +(defmethod inspect ((this fac-break-fence-c)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type fac-break-fence inspect))) + (t9-0 this) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-fence-c fac-break-fence-c fac-break-fence-c-lod0-jg fac-break-fence-c-idle-ja + ((fac-break-fence-c-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-break-fence-c-explode fac-break-fence-c fac-break-fence-c-explode-lod0-jg fac-break-fence-c-explode-idle-ja + ((fac-break-fence-c-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 12 0 0 18) + ) + +;; definition for symbol *fac-break-fence-c-exploder-params*, type joint-exploder-static-params +(define *fac-break-fence-c-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :collide-sound (static-sound-name "fence-debris") + :collide-sound-interval (seconds 0.4) + ) + ) + +;; definition for method 11 of type fac-break-fence-c +(defmethod init-from-entity! ((this fac-break-fence-c) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-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 obstacle)) + (set! (-> v1-2 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-2 prim-core action) (collide-action solid)) + (set! (-> v1-2 transform-index) 3) + (set-vector! (-> v1-2 local-sphere) 49152.0 0.0 0.0 73728.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) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-break-fence-c" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (let ((a0-14 (-> this skel root-channel 0))) + (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-14 frame-num) 0.0) + (joint-control-channel-group! a0-14 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (if (not (task-node-closed? (game-task-node factory-assault-broke-ultimate-fence))) + (go (method-of-object this idle)) + ) + ) + +;; failed to figure out what this is: +(defstate idle (fac-break-fence-c) + :virtual #t + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (fac-break-fence-c) + :virtual #t + :enter (behavior () + (local-vars (v1-10 float)) + (rlet ((vf1 :class vf) + (vf2 :class vf) + ) + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1)))) + (let* ((s5-0 *target*) + (s4-0 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when s4-0 + (let ((s5-1 (get-trans s4-0 0)) + (s3-1 (vector-! (new 'stack-no-clear 'vector) (get-trans s4-0 0) (-> self root trans))) + (s4-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))) + ) + (.lvf vf1 (&-> s4-1 quad)) + (.lvf vf2 (&-> s3-1 quad)) + (.mul.vf vf1 vf1 vf2) + (.add.y.vf vf1 vf1 vf1 :mask #b1) + (.add.z.vf vf1 vf1 vf1 :mask #b1) + (.mov v1-10 vf1) + (if (< (the int v1-10) 0) + (vector-negate-in-place! s4-1) + ) + (vector+float*! (-> gp-0 fountain-rand-transv-lo) s5-1 s4-1 49152.0) + ) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi x) 49152.0) + (set! (-> gp-0 fountain-rand-transv-hi y) 262144.0) + (set! (-> gp-0 fountain-rand-transv-hi z) 0.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 24576.0) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-break-fence-c-explode" (the-as (pointer level) #f)) + 6 + gp-0 + *fac-break-fence-c-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (let ((a1-9 (new 'static 'vector :x 49152.0 :y 24576.0 :w 1.0)) + (gp-1 (new 'stack-no-clear 'vector)) + ) + (vector-matrix*! gp-1 a1-9 (-> self node-list data 0 bone transform)) + (cond + ((logtest? (-> *part-group-id-table* 751 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-1 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 751)) + ) + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-hit-fence") + (sound-play "fence-break") + (suspend) + (ja-channel-set! 0) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + :post ja-post + ) + +;; definition of type fac-switch +(deftype fac-switch (process-drawable) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (lever-jmod joint-mod-rotate-local :inline) + (part-red sparticle-launch-control :overlay-at part) + (part-green sparticle-launch-control) + (minimap connection-minimap) + ) + (:state-methods + idle + (done symbol) + ) + (:methods + (is-done? (_type_) symbol) + ) + ) + +;; definition for method 3 of type fac-switch +(defmethod inspect ((this fac-switch)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process-drawable 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 "~2Tlever-jmod: #~%" (-> this lever-jmod)) + (format #t "~2Tpart-red: ~A~%" (-> this part)) + (format #t "~2Tpart-green: ~A~%" (-> this part-green)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-switch fac-switch fac-switch-lod0-jg fac-switch-idle-ja + ((fac-switch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition for method 22 of type fac-switch +(defmethod is-done? ((this fac-switch)) + (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (let ((a0-2 (res-lump-struct (-> this entity) 'task-name string))) + (if a0-2 + (task-closed? a0-2) + #f + ) + ) + ) + ) + +;; definition for method 7 of type fac-switch +(defmethod relocate ((this fac-switch) (offset int)) + (when (nonzero? (-> this part-green)) + (if (nonzero? (-> this part-green)) + (&+! (-> this part-green) offset) + ) + ) + (call-parent-method this offset) + ) + +;; failed to figure out what this is: +(defstate idle (fac-switch) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let ((gp-0 (the-as object (-> block param 1)))) + (when (and (= (-> (find-offending-process-focusable proc (the-as attack-info gp-0)) type) target) + (logtest? (-> (the-as attack-info gp-0) penetrate-using) (penetrate flop punch spin roll uppercut bonk)) + ) + (when (and *target* (focus-test? *target* indax)) + (let ((gp-1 (res-lump-struct (-> self entity) 'on-activate structure))) + (if gp-1 + (script-eval (the-as pair gp-1)) + ) + ) + (sound-play "floor-switch") + (go-virtual done #f) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (setup-masks (-> self draw) 4 0) + (setup-masks (-> self draw) 0 2) + (quaternion-identity! (-> self lever-jmod rotation)) + ) + :exit (behavior () + (when (-> self minimap) + (logior! (-> self minimap flags) (minimap-flag fade-out)) + (set! (-> self minimap) #f) + ) + ) + :trans (behavior () + (cond + ((task-open? (res-lump-struct (-> self entity) 'task-name string)) + (if (not (-> self minimap)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 129) (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) + ) + ) + ) + (spawn-from-cspace (-> self part) (joint-node fac-switch-lod0-jg glow)) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate done (fac-switch) + :virtual #t + :enter (behavior ((arg0 symbol)) + (setup-masks (-> self draw) 0 4) + (setup-masks (-> self draw) 2 0) + ) + :trans (behavior () + (spawn-from-cspace (-> self part-green) (joint-node fac-switch-lod0-jg glow)) + ) + :code (behavior ((arg0 symbol)) + (when (> (-> self actor-group-count) 0) + (dotimes (s5-0 (length (-> self actor-group 0))) + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-7 (-> self actor-group 0 data s5-0 actor)) + ) + (t9-0 + (if v1-7 + (-> v1-7 extra process) + ) + a1-0 + ) + ) + ) + ) + ) + (set-time! (-> self state-time)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cond + ((not arg0) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 0.3)) + (let* ((f28-0 (lerp-clamp 0.0 3640.889 (* 0.011111111 (the float (- (current-time) (-> self state-time)))))) + (f30-0 (cos f28-0)) + (f0-2 (sin f28-0)) + ) + (quaternion-set! (-> self lever-jmod rotation) f0-2 0.0 0.0 f30-0) + ) + (suspend) + ) + ) + (let ((gp-2 (res-lump-struct (-> self entity) 'cutaway-camera structure))) + (when (and gp-2 *target*) + (while (not (process-grab? *target* #f)) + (suspend) + ) + (set-setting! 'entity-name gp-2 0.0 0) + (let ((gp-3 (current-time))) + (until (time-elapsed? gp-3 (seconds 3)) + '() + (suspend) + ) + ) + (remove-setting! 'entity-name) + (while (not (process-release? *target*)) + (suspend) + ) + ) + ) + ) + (else + (quaternion-set! (-> self lever-jmod rotation) 0.34202015 0.0 0.0 0.9396926) + ) + ) + (sleep-code) + ) + :post pusher-post + ) + +;; definition for method 11 of type fac-switch +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this fac-switch) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 4) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 5) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 8192.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-20 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-20 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-20 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this minimap) #f) + (set! (-> this entity) arg0) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-switch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-26 (res-lump-data arg0 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-26 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-26)) + ) + (else + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (init (-> this lever-jmod) this (the-as uint 4) (joint-mod-base-flags attached)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 753) this)) + (set! (-> this part-green) (create-launch-control (-> *part-group-id-table* 754) this)) + (if (is-done? this) + (go (method-of-object this done) #t) + (go (method-of-object this idle)) + ) + ) + +;; definition of type fac-move-plat-a +(deftype fac-move-plat-a (plat) + ((dead-set-time float) + ) + (:state-methods + locking-down + ) + (:methods + (fac-move-plat-a-method-39 (_type_) none) + ) + ) + +;; definition for method 3 of type fac-move-plat-a +(defmethod inspect ((this fac-move-plat-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type plat inspect))) + (t9-0 this) + ) + (format #t "~2Tdead-set-time: ~f~%" (-> this dead-set-time)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-move-pla fac-move-plat-a fac-move-plat-a-lod0-jg fac-move-plat-a-idle-ja + ((fac-move-plat-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 15) + ) + +;; definition for method 31 of type fac-move-plat-a +(defmethod get-art-group ((this fac-move-plat-a)) + (art-group-get-by-name *level* "skel-fac-move-pla" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type fac-move-plat-a +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this fac-move-plat-a)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 36864.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this root pause-adjust-distance) 573440.0) + 0 + (none) + ) + +;; definition for method 33 of type fac-move-plat-a +;; WARN: Return type mismatch vector vs none. +(defmethod base-plat-method-33 ((this fac-move-plat-a)) + (set-vector! (-> this root scale) 1.4 1.4 1.6 1.0) + (none) + ) + +;; definition for method 10 of type fac-move-plat-a +(defmethod deactivate ((this fac-move-plat-a)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + ((method-of-type plat deactivate) this) + (none) + ) + +;; definition for method 37 of type fac-move-plat-a +(defmethod go-initial-state ((this fac-move-plat-a)) + (set! (-> this dead-set-time) (res-lump-float (-> this entity) 'fac-plat-dead-set :default 0.5)) + (cond + ((or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (task-closed? (res-lump-struct (-> this entity) 'task-name string)) + ) + (fac-move-plat-a-method-39 this) + (go (method-of-object this plat-idle)) + ) + (else + (go (method-of-object this plat-path-active)) + ) + ) + ) + +;; definition for method 39 of type fac-move-plat-a +;; WARN: Return type mismatch vector vs none. +(defmethod fac-move-plat-a-method-39 ((this fac-move-plat-a)) + (set! (-> this path-pos) (-> this dead-set-time)) + (get-point-at-percent-along-path! (-> this path) (-> this basetrans) (-> this path-pos) 'interp) + (none) + ) + +;; failed to figure out what this is: +(defstate plat-idle (fac-move-plat-a) + :virtual #t + :event plat-event + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((t9-1 (-> (find-parent-state) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate plat-path-active (fac-move-plat-a) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual locking-down) + ) + (else + (plat-event proc argc message block) + ) + ) + ) + :exit (behavior () + (sound-stop (-> self sound-id)) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (if (< (vector-vector-distance (-> self root trans) (ear-trans 0)) 163840.0) + (sound-play "move-plat-loop" :id (-> self sound-id) :position (-> self root trans)) + ) + (let ((v1-11 (shr (-> self sync period) 1))) + (if (< (mod (current-time) (the-as time-frame v1-11)) + (mod (-> self clock old-frame-counter) (the-as time-frame v1-11)) + ) + (sound-play "move-plat-hit") + ) + ) + (plat-trans) + ) + :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 plat-post + ) + +;; failed to figure out what this is: +(defstate locking-down (fac-move-plat-a) + :virtual #t + :event plat-event + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + :trans plat-trans + :code (behavior () + (let ((f30-0 (-> self dead-set-time))) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (set! (-> self path-pos) + (lerp-clamp (get-norm! (-> self sync) 0) f30-0 (* 0.0011111111 (the float (- (current-time) gp-0)))) + ) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (suspend) + ) + ) + (suspend) + (set! (-> self path-pos) f30-0) + ) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (sleep-code) + ) + :post plat-post + ) + +;; definition of type fac-move-plat-b +(deftype fac-move-plat-b (plat) + () + ) + +;; definition for method 3 of type fac-move-plat-b +(defmethod inspect ((this fac-move-plat-b)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type plat inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-move-pla fac-move-plat-b fac-move-plat-b-lod0-jg fac-move-plat-b-idle-ja + ((fac-move-plat-b-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 9) + ) + +;; definition for method 31 of type fac-move-plat-b +(defmethod get-art-group ((this fac-move-plat-b)) + (art-group-get-by-name *level* "skel-fac-move-pla" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type fac-move-plat-b +;; WARN: Return type mismatch float vs none. +(defmethod init-collision! ((this fac-move-plat-b)) + (let ((s5-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))) + (let ((s4-0 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 22528.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-12 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-12 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-12 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (set! (-> this root pause-adjust-distance) 327680.0) + (none) + ) + +;; definition for method 10 of type fac-move-plat-b +(defmethod deactivate ((this fac-move-plat-b)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + ((method-of-type plat deactivate) this) + (none) + ) + +;; definition for method 37 of type fac-move-plat-b +(defmethod go-initial-state ((this fac-move-plat-b)) + (let ((f0-0 (res-lump-float (-> this entity) 'fac-plat-dead-start :default -1.0))) + (if (>= f0-0 0.0) + (get-point-at-percent-along-path! (-> this path) (-> this basetrans) f0-0 'interp) + ) + ) + (if (and (nonzero? (res-lump-value (-> this entity) 'fac-plat-reset-stopped uint128 :time -1000000000.0)) + (not (task-closed? (res-lump-struct (-> this entity) 'task-name string))) + ) + (go (method-of-object this plat-idle)) + (go (method-of-object this plat-path-active)) + ) + ) + +;; failed to figure out what this is: +(defstate plat-idle (fac-move-plat-b) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual plat-path-active) + ) + (('bonk) + (start-bounce! self) + ) + ) + ) + :trans (behavior () + (let ((t9-1 (-> (find-parent-state) trans))) + (if t9-1 + (t9-1) + ) + ) + ) + :code (behavior () + (let ((t9-1 (-> (find-parent-state) code))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate plat-path-active (fac-move-plat-b) + :virtual #t + :event plat-event + :exit (behavior () + (sound-stop (-> self sound-id)) + ) + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self basetrans) (-> self path-pos) 'interp) + (if (< (vector-vector-distance (-> self root trans) (ear-trans 0)) 163840.0) + (sound-play "move-plat-loop" :id (-> self sound-id) :position (-> self root trans)) + ) + (let ((v1-11 (shr (-> self sync period) 1))) + (if (< (mod (current-time) (the-as time-frame v1-11)) + (mod (-> self clock old-frame-counter) (the-as time-frame v1-11)) + ) + (sound-play "move-plat-hit") + ) + ) + (plat-trans) + ) + :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 plat-post + ) + +;; definition of type fac-rotfan +(deftype fac-rotfan (process-drawable) + ((root collide-shape :override) + (motor-noise sound-id) + (effect-opacity float) + (no-collision-timer time-frame) + (attack-id int32) + ) + (:state-methods + idle + spindown + out + ) + (:methods + (is-out? (_type_) symbol) + ) + ) + +;; definition for method 3 of type fac-rotfan +(defmethod inspect ((this fac-rotfan)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tmotor-noise: ~D~%" (-> this motor-noise)) + (format #t "~2Teffect-opacity: ~f~%" (-> this effect-opacity)) + (format #t "~2Tno-collision-timer: ~D~%" (-> this no-collision-timer)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-rotfan fac-rotfan fac-rotfan-lod0-jg fac-rotfan-idle-ja + ((fac-rotfan-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 20) + ) + +;; definition for method 23 of type fac-rotfan +(defmethod is-out? ((this fac-rotfan)) + (or (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)) + (task-closed? (res-lump-struct (-> this entity) 'task-name string)) + ) + ) + +;; definition for function fac-rotfan-part-trans +(defbehavior fac-rotfan-part-trans fac-rotfan () + (when (not (logtest? (-> self entity extra perm status) (entity-perm-status subtask-complete))) + (set! (-> *part-id-table* 2832 init-specs 8 initial-valuef) (-> self effect-opacity)) + (if (< (-> self effect-opacity) 30.0) + (set! (-> *part-id-table* 2832 init-specs 8 random-rangef) 0.0) + ) + (spawn-from-cspace (-> self part) (joint-node fac-rotfan-lod0-jg electrified)) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate idle (fac-rotfan) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trigger) + (go-virtual spindown) + ) + (('touch) + (let* ((s4-0 proc) + (gp-0 (if (type? s4-0 process-focusable) + s4-0 + ) + ) + ) + (when (and gp-0 (= (-> gp-0 type) target) ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> block param 0)) + (-> self root) + (the-as uint 4) + ) + ) + (when (time-elapsed? (-> self no-collision-timer) (-> *TARGET-bank* hit-invulnerable-timeout)) + (let ((s4-1 + (vector-negate! (new 'stack-no-clear 'vector) (the-as vector (-> self node-list data 3 bone transform))) + ) + ) + (set! (-> s4-1 y) 0.0) + (vector-xz-normalize! s4-1 1.0) + (when (send-event + gp-0 + 'attack + (-> block param 0) + (static-attack-info + :mask (vehicle-impulse-factor) + ((id (the-as uint (-> self attack-id))) + (damage 0.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (mode 'shock) + (vector s4-1) + (shove-back (meters 6)) + (shove-up (meters 1)) + (control (if (focus-test? (the-as process-focusable gp-0) board) + 1.0 + 0.0 + ) + ) + ) + ) + ) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self no-collision-timer) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + ) + ) + ) + ) + ) + :enter (behavior () + (ja-no-eval :group! fac-rotfan-spin-ja :num! (loop! 0.5) :frame-num 0.0) + (set! (-> self effect-opacity) 40.0) + (set! (-> self no-collision-timer) 0) + 0 + ) + :trans fac-rotfan-part-trans + :code (behavior () + (let ((f28-0 15.0)) + (new-sound-id) + (until #f + (let ((f30-0 (* 0.05 (the float (mod (current-time) 300))))) + (let ((f26-0 (- f30-0 (* (the float (the int (/ f30-0 5.0))) 5.0)))) + (if (< f26-0 f28-0) + (sound-play-by-name + (static-sound-name "fan-blades-fast") + (new-sound-id) + (the int (* 1024.0 (rand-vu-float-range 0.75 1.0))) + -1219 + 0 + (sound-group) + #t + ) + ) + (set! f28-0 f26-0) + ) + (ja :group! fac-rotfan-spin-ja :num! (identity f30-0)) + ) + (suspend) + ) + ) + #f + ) + :post (behavior () + (sound-play "fan-motor-loop" :id (-> self motor-noise)) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate spindown (fac-rotfan) + :virtual #t + :trans fac-rotfan-part-trans + :code (behavior () + (set-time! (-> self state-time)) + (let* ((f30-0 15.0) + (f28-0 f30-0) + (gp-0 900) + (f26-0 (* 0.0033333334 (the float (mod (current-time) 300)) f30-0)) + ) + (- f26-0 (* (the float (the int (/ f26-0 5.0))) 5.0)) + (let ((s5-0 #f) + (s4-0 (the-as sound-id #f)) + ) + (while (not (time-elapsed? (-> self state-time) gp-0)) + (let ((f24-0 (/ (the float (- (current-time) (-> self state-time))) (the float gp-0)))) + (set! (-> self effect-opacity) (lerp 40.0 0.0 f24-0)) + (let ((f0-13 (+ f26-0 (* (lerp f30-0 0.0 f24-0) (seconds-per-frame))))) + (set! f26-0 (- f0-13 (* (the float (the int (/ f0-13 15.0))) 15.0))) + ) + ) + (set! f28-0 + (cond + ((not (time-elapsed? (-> self state-time) (seconds 2.035))) + (let ((f24-1 (- f26-0 (* (the float (the int (/ f26-0 5.0))) 5.0)))) + (if (< f24-1 f28-0) + (set! s4-0 + (sound-play-by-name + (static-sound-name "fan-blades-slow") + (new-sound-id) + (the int (* 1024.0 (rand-vu-float-range 0.75 1.0))) + -1524 + 0 + (sound-group) + #t + ) + ) + ) + f24-1 + ) + ) + (else + (when (not s5-0) + (sound-stop s4-0) + (sound-play "fan-blades-stop") + (set! s5-0 #t) + ) + f28-0 + ) + ) + ) + (ja :group! fac-rotfan-spin-ja :num! (identity f26-0)) + (when *sound-player-enable* + (let ((s3-3 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> s3-3 command) (sound-command set-param)) + (set! (-> s3-3 id) (-> self motor-noise)) + (set! (-> s3-3 params pitch-mod) + (the int + (* 1524.0 + (lerp-clamp + -1.4 + -0.1 + (* 0.06666667 (lerp f30-0 0.0 (/ (the float (- (current-time) (-> self state-time))) (the float gp-0)))) + ) + ) + ) + ) + (set! (-> s3-3 params mask) (the-as uint 2)) + (-> s3-3 id) + ) + ) + (suspend) + ) + ) + ) + (sound-stop (-> self motor-noise)) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action) + (collide-action) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (sleep-code) + ) + :post transform-post + ) + +;; failed to figure out what this is: +(defstate out (fac-rotfan) + :virtual #t + :enter (behavior () + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-with) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core collide-as) + (collide-spec) + ) + (set! (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1 prim-core action) + (collide-action) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + :code (behavior () + (ja :group! fac-rotfan-spin-ja :num! (identity 2.0)) + (sleep-code) + ) + :post ja-post + ) + +;; definition for method 10 of type fac-rotfan +(defmethod deactivate ((this fac-rotfan)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this motor-noise)) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 11 of type fac-rotfan +(defmethod init-from-entity! ((this fac-rotfan) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 3) 0))) + (set! (-> s4-0 total-prims) (the-as uint 4)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set! (-> s3-0 transform-index) 3) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 81920.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid)) + (set! (-> v1-15 transform-index) 4) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 4)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 3) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 81920.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 2) (the-as uint 2)))) + (set! (-> v1-19 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-19 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 3) + (set-vector! (-> v1-19 local-sphere) 0.0 0.0 0.0 20480.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-22 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-22 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-22 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (set! (-> this motor-noise) (new-sound-id)) + (set! (-> this root pause-adjust-distance) 327680.0) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 755) this)) + (let* ((v1-29 *game-info*) + (a0-27 (+ (-> v1-29 attack-id) 1)) + ) + (set! (-> v1-29 attack-id) a0-27) + (set! (-> this attack-id) (the-as int a0-27)) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-rotfan" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (if (is-out? this) + (go (method-of-object this out)) + (go (method-of-object this idle)) + ) + ) + +;; definition of type fac-robot-ass-manager +(deftype fac-robot-ass-manager (process) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-robot-ass-manager +(defmethod inspect ((this fac-robot-ass-manager)) + (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: +(defstate idle (fac-robot-ass-manager) + :virtual #t + :code sleep-code + ) + +;; definition for method 11 of type fac-robot-ass-manager +(defmethod init-from-entity! ((this fac-robot-ass-manager) (arg0 entity-actor)) + (process-entity-set! this arg0) + (go (method-of-object this idle)) + ) + +;; definition of type factory-conveyor +(deftype factory-conveyor (conveyor) + () + ) + +;; definition for method 3 of type factory-conveyor +(defmethod inspect ((this factory-conveyor)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type conveyor inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 24 of type factory-conveyor +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-fields! ((this factory-conveyor)) + (local-vars (sv-16 res-tag)) + (set! (-> this speed) 22528.0) + (set! (-> this pull-y-threshold) 10240.0) + (set! (-> this speed-mult-array) (the-as (pointer float) #f)) + (set! (-> this speed-mult-array-len) 0) + (let ((a0-1 (-> this entity))) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-3 (res-lump-data a0-1 'scale-factor pointer :tag-ptr (& sv-16)))) + (when v1-3 + (set! (-> this speed-mult-array) (the-as (pointer float) v1-3)) + (set! (-> this speed-mult-array-len) (the-as int (-> sv-16 elt-count))) + ) + ) + ) + (set! (-> this belt-radius) (* 4096.0 (the-as float ((method-of-type res-lump get-property-struct) + (-> this entity) + 'extra-radius + 'interp + -1000000000.0 + (the-as structure 6.0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + (set! (-> this root pause-adjust-distance) 327680.0) + 0 + (none) + ) + +;; definition of type fac-punch-wall +(deftype fac-punch-wall (process-drawable) + ((root collide-shape :override) + (notify-actor entity-actor) + (spool-sound-id sound-id) + ) + (:state-methods + idle + die + ) + (:states + perish-immediately + ) + ) + +;; definition for method 3 of type fac-punch-wall +(defmethod inspect ((this fac-punch-wall)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tnotify-actor: ~A~%" (-> this notify-actor)) + (format #t "~2Tspool-sound-id: ~D~%" (-> this spool-sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-punch-wall fac-punch-wall fac-punch-wall-lod0-jg fac-punch-wall-idle-ja + ((fac-punch-wall-lod0-mg (meters 20)) (fac-punch-wall-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; failed to figure out what this is: +(defstate idle (fac-punch-wall) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (let* ((a1-2 (-> block param 1)) + (v1-1 (find-offending-process-focusable proc (the-as attack-info a1-2))) + ) + (when (and v1-1 + (= (-> v1-1 type) target) + (not (focus-test? v1-1 indax)) + (< (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 163840.0 + ) + ) + (go-virtual die) + #f + ) + ) + ) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (fac-punch-wall) + :virtual #t + :enter (behavior () + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) (process->ppointer self)) + (set! (-> a1-0 num-params) 0) + (set! (-> a1-0 message) 'trigger) + (let ((t9-0 send-event-function) + (v1-2 (-> self notify-actor)) + ) + (t9-0 + (if v1-2 + (-> v1-2 extra process) + ) + a1-0 + ) + ) + ) + ) + :code (behavior () + (sound-play "fac-glass-break") + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-4 prim-core collide-as) (collide-spec)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + (set-time! (-> self state-time)) + (ja-no-eval :group! fac-punch-wall-drop-ja :num! (seek! 10.0 2.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! 10.0 2.0)) + ) + (set! (-> self spool-sound-id) + (add-process *gui-control* self (gui-channel background) (gui-action play) "glassmsh" -99.0 0) + ) + (ja-no-eval :group! fac-punch-wall-drop-ja :num! (seek! max 2.0) :frame-num 10.0) + (until (ja-done? 0) + (when *sound-player-enable* + (let ((v1-44 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) + (set! (-> v1-44 command) (sound-command set-param)) + (set! (-> v1-44 id) (-> self spool-sound-id)) + (set! (-> v1-44 params volume) 696) + (set! (-> v1-44 params mask) (the-as uint 1)) + (-> v1-44 id) + ) + ) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (setup-masks (-> self draw) 1 2) + (sleep-code) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate perish-immediately (fac-punch-wall) + :enter (behavior () + (ja :group! fac-punch-wall-drop-ja :num! max) + (setup-masks (-> self draw) 1 2) + (let ((v1-16 (-> (the-as collide-shape-prim-group (-> self root root-prim)) child 1))) + (set! (-> v1-16 prim-core collide-as) (collide-spec)) + (set! (-> v1-16 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :code sleep-code + ) + +;; definition for method 11 of type fac-punch-wall +(defmethod init-from-entity! ((this fac-punch-wall) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 2) 0))) + (set! (-> s4-0 total-prims) (the-as uint 3)) + (set! (-> s3-0 prim-core collide-as) (collide-spec obstacle)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid)) + (set-vector! (-> s3-0 local-sphere) 0.0 0.0 0.0 204800.0) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 1) (the-as uint 2)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 102400.0) + ) + (let ((v1-10 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 1)))) + (set! (-> v1-10 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-10 prim-core collide-with) (collide-spec backgnd)) + (set! (-> v1-10 prim-core action) (collide-action solid)) + (set! (-> v1-10 transform-index) 3) + (set-vector! (-> v1-10 local-sphere) 0.0 0.0 0.0 102400.0) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-13 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-13 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-13 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-punch-wall" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this notify-actor) (entity-actor-lookup arg0 'alt-actor 0)) + (set! (-> this spool-sound-id) (the-as sound-id #f)) + (let ((a0-21 (-> this skel root-channel 0))) + (set! (-> a0-21 frame-group) (the-as art-joint-anim (-> this draw art-group data 3))) + (set! (-> a0-21 frame-num) 0.0) + (joint-control-channel-group! a0-21 (the-as art-joint-anim (-> this draw art-group data 3)) num-func-identity) + ) + (transform-post) + (logclear! (-> this mask) (process-mask actor-pause)) + (if (not (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle)) + (go perish-immediately) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc b/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc new file mode 100644 index 0000000000..1bd1f9d7f2 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/factoryc-obs_REF.gc @@ -0,0 +1,1369 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-fac-fire-torch + :id 807 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2960 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 2960 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters 0.03)) + (:timer (seconds 0.667)) + (:flags ()) + (:conerot-x (degrees -30) (degrees 60)) + (:rotate-x (degrees 180)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function factoryc-activate +;; WARN: Return type mismatch int vs none. +(defun factoryc-activate ((arg0 level)) + (if (and (nonzero? *nav-network*) *nav-network*) + (init-by-other! *nav-network* arg0 *factoryc-adjacency*) + ) + 0 + (none) + ) + +;; definition for function factoryc-login +;; WARN: Return type mismatch int vs none. +(defun factoryc-login ((arg0 level)) + (set! *nav-network* (new 'loading-level 'nav-network)) + (alloc-nav-network-for-level! *nav-network* 64 10) + 0 + (none) + ) + +;; definition for function factoryc-logout +;; WARN: Return type mismatch int vs none. +(defun factoryc-logout ((arg0 level)) + (set! *nav-network* (the-as nav-network 0)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-generic-spot-ring gun gun-dark-2-ring-lod0-jg gun-dark-2-ring-idle-ja + ((gun-dark-2-ring-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0.5 84) + :longest-edge (meters 80) + :shadow gun-dark-2-ring-shadow-mg + ) + +;; definition of type generic-spot-shadow-effect +(deftype generic-spot-shadow-effect (process-drawable) + ((focal-length float) + (near-clip float) + (far-clip float) + (color rgba) + (pre-flicker-pos vector :inline) + (jmod-outer joint-mod-add-local :inline) + (jmod-inner joint-mod-add-local :inline) + ) + (:state-methods + idle + inactive + ) + (:methods + (set-jmod-inner-scale! (_type_ vector) none) + (set-jmod-outer-scale! (_type_ vector) none) + ) + ) + +;; definition for method 3 of type generic-spot-shadow-effect +(defmethod inspect ((this generic-spot-shadow-effect)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tfocal-length: ~f~%" (-> this focal-length)) + (format #t "~2Tnear-clip: ~f~%" (-> this near-clip)) + (format #t "~2Tfar-clip: ~f~%" (-> this far-clip)) + (format #t "~2Tcolor: ~D~%" (-> this color)) + (format #t "~2Tpre-flicker-pos: #~%" (-> this pre-flicker-pos)) + (format #t "~2Tjmod-outer: #~%" (-> this jmod-outer)) + (format #t "~2Tjmod-inner: #~%" (-> this jmod-inner)) + (label cfg-4) + this + ) + +;; definition for method 22 of type generic-spot-shadow-effect +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod set-jmod-inner-scale! ((this generic-spot-shadow-effect) (arg0 vector)) + (set! (-> this jmod-inner transform scale quad) (-> arg0 quad)) + (none) + ) + +;; definition for method 23 of type generic-spot-shadow-effect +;; INFO: Used lq/sq +;; WARN: Return type mismatch vector vs none. +(defmethod set-jmod-outer-scale! ((this generic-spot-shadow-effect) (arg0 vector)) + (set! (-> this jmod-outer transform scale quad) (-> arg0 quad)) + (none) + ) + +;; definition for function generic-spot-shadow-effect-init-by-other +;; INFO: Used lq/sq +(defbehavior generic-spot-shadow-effect-init-by-other generic-spot-shadow-effect ((arg0 vector) (arg1 quaternion)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (quaternion-copy! (-> self root quat) arg1) + (set! (-> self pre-flicker-pos quad) (-> self root trans quad)) + (set! (-> self level) (-> *level* level-default)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-generic-spot-ring" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init (-> self jmod-inner) self (the-as uint 4) (joint-mod-base-flags attached scale)) + (init (-> self jmod-outer) self (the-as uint 3) (joint-mod-base-flags attached scale)) + (set! (-> self focal-length) 409600.0) + (set! (-> self near-clip) 0.0) + (set! (-> self far-clip) 122880.0) + (set! (-> self color) (new 'static 'rgba :r #xf0 :g #xf0 :a #x80)) + (cond + ((-> self draw shadow) + (set! (-> self draw shadow-ctrl) (new + 'process + 'shadow-control + 0.0 + 0.0 + 614400.0 + (the-as vector #f) + (shadow-flags shdf02 shdf03 shdf04 disable-draw) + 245760.0 + ) + ) + (set! (-> self draw shadow-ctrl settings shadow-type) 1) + (set! (-> self draw shadow-ctrl settings flags) (shadow-flags disable-fade shdf03 shdf04 shdf07)) + (logclear! (-> self draw status) (draw-control-status no-draw)) + ) + (else + (go process-drawable-art-error "Shadow error (no self draw shadow)") + ) + ) + (go-virtual idle) + ) + +;; definition for function generic-spot-shadow-effect-handler +(defbehavior generic-spot-shadow-effect-handler generic-spot-shadow-effect ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('on) + (go-virtual idle) + ) + (('off) + (go-virtual inactive) + ) + ) + ) + +;; failed to figure out what this is: +(defstate idle (generic-spot-shadow-effect) + :virtual #t + :event generic-spot-shadow-effect-handler + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (let ((v1-3 (-> self draw shadow-ctrl))) + (logclear! (-> v1-3 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + :trans (behavior () + (shadow-control-method-14 + (-> self draw shadow-ctrl) + (-> self root trans) + (vector-negate! (new 'stack-no-clear 'vector) (-> self node-list data 3 bone transform uvec)) + (-> self focal-length) + (-> self near-clip) + (-> self far-clip) + ) + (persist-with-delay + *setting-control* + 'spotlight-color + (seconds 0.1) + 'spotlight-color + #f + 0.0 + (the-as int (-> self color)) + ) + ) + :code sleep-code + :post (behavior () + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 x) (+ -1024.0 (* 4096.0 (* 0.5 (rand-vu))))) + (set! (-> gp-0 y) 0.0) + (set! (-> gp-0 z) (+ -1024.0 (* 4096.0 (* 0.5 (rand-vu))))) + (set! (-> gp-0 w) 1.0) + (vector+! (-> self root trans) (-> self pre-flicker-pos) gp-0) + ) + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate inactive (generic-spot-shadow-effect) + :virtual #t + :event generic-spot-shadow-effect-handler + :enter (behavior () + (setup-masks (-> self draw) 0 1) + (let ((v1-3 (-> self draw shadow-ctrl))) + (logior! (-> v1-3 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + :trans (behavior () + '() + ) + :code sleep-code + ) + +;; definition of type fac-zapper +(deftype fac-zapper (process) + ((on-duration time-frame) + (off-duration time-frame) + (phase-offset time-frame) + (beam-is-on symbol) + (bzzt-sound sound-id) + (path path-control) + (lightning lightning-control) + (hilite handle) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-zapper +(defmethod inspect ((this fac-zapper)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Ton-duration: ~D~%" (-> this on-duration)) + (format #t "~2Toff-duration: ~D~%" (-> this off-duration)) + (format #t "~2Tphase-offset: ~D~%" (-> this phase-offset)) + (format #t "~2Tbeam-is-on: ~A~%" (-> this beam-is-on)) + (format #t "~2Tbzzt-sound: ~D~%" (-> this bzzt-sound)) + (format #t "~2Tpath: ~A~%" (-> this path)) + (format #t "~2Tlightning: ~A~%" (-> this lightning)) + (format #t "~2Thilite: ~D~%" (-> this hilite)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 33) (new 'static 'lightning-spec + :name "fac-zapper-zap" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 60.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.62 + :num-points 32 + :box-size 16384.0 + :merge-factor 0.25 + :merge-count 2 + :radius 2252.8 + :duration 99.9 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 34) (new 'static 'lightning-spec + :name "fac-elec-gate-zap" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x40 :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 12288.0 + :merge-factor 0.125 + :merge-count 2 + :radius 3072.0 + :duration 99.9 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defstate idle (fac-zapper) + :virtual #t + :trans (behavior () + (if (-> self beam-is-on) + (sound-play + "laser-loop" + :id (-> self bzzt-sound) + :position (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.5 'interp) + ) + (sound-stop (-> self bzzt-sound)) + ) + ) + :code (behavior () + (let ((gp-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp)) + (s5-0 (get-point-in-path! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp)) + ) + (let ((a0-2 (-> self lightning)) + (v1-2 gp-0) + ) + (set! (-> a0-2 state meet data 0 quad) (-> v1-2 quad)) + ) + (let ((a0-5 (-> self lightning)) + (v1-4 s5-0) + ) + (set! (-> a0-5 state meet data (+ (-> a0-5 state points-to-draw) -1) quad) (-> v1-4 quad)) + ) + (until #f + (let ((v1-9 (mod (+ (current-time) (-> self phase-offset)) (+ (-> self on-duration) (-> self off-duration))))) + (cond + ((and (< v1-9 (-> self on-duration)) + (< (- (the-as time-frame v1-9) (- (current-time) (-> self clock old-frame-counter))) 0) + ) + (let ((v1-10 (-> self lightning)) + (a0-18 1) + ) + (let ((a1-11 (!= a0-18 (-> v1-10 state mode)))) + (case a0-18 + ((3) + (if a1-11 + (set! (-> v1-10 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-10 state start-color) (-> v1-10 spec start-color)) + (set! (-> v1-10 state end-color) (-> v1-10 spec end-color)) + ) + ) + ) + (set! (-> v1-10 state mode) (the-as uint a0-18)) + ) + (set! (-> self beam-is-on) #t) + (send-event (handle->process (-> self hilite)) 'on) + (set-factoryc-light! 1.0 0) + ) + ((and (>= v1-9 (-> self on-duration)) + (< (- (the-as time-frame v1-9) (- (current-time) (-> self clock old-frame-counter))) (-> self on-duration)) + ) + (let ((v1-22 (-> self lightning)) + (a0-29 3) + ) + (let ((a1-26 (!= a0-29 (-> v1-22 state mode)))) + (case a0-29 + ((3) + (if a1-26 + (set! (-> v1-22 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-22 state start-color) (-> v1-22 spec start-color)) + (set! (-> v1-22 state end-color) (-> v1-22 spec end-color)) + ) + ) + ) + (set! (-> v1-22 state mode) (the-as uint a0-29)) + ) + (set! (-> self beam-is-on) #f) + (send-event (handle->process (-> self hilite)) 'off) + (set-factoryc-light! 0.0 0) + ) + ) + ) + (when (and *target* (-> self beam-is-on)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (when (< (vector-segment-distance-point! (target-pos 0) gp-0 s5-0 s3-0) 4915.2) + (sound-play "laser-zap-dax") + (send-event + *target* + '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 'shock)) + ) + ) + ) + ) + ) + (suspend) + ) + ) + #f + (sleep-code) + ) + ) + +;; definition for method 11 of type fac-zapper +(defmethod init-from-entity! ((this fac-zapper) (arg0 entity-actor)) + (set! (-> this entity) arg0) + (set! (-> this path) (new 'process 'path-control this 'path 0.0 arg0 #f)) + (set! (-> this lightning) (new 'process 'lightning-control (-> *lightning-spec-id-table* 33) this 0.0)) + (let ((v1-4 (-> this lightning)) + (a0-3 0) + ) + (let ((a1-4 (!= a0-3 (-> v1-4 state mode)))) + (case a0-3 + ((3) + (if a1-4 + (set! (-> v1-4 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-4 state start-color) (-> v1-4 spec start-color)) + (set! (-> v1-4 state end-color) (-> v1-4 spec end-color)) + ) + ) + ) + (set! (-> v1-4 state mode) (the-as uint a0-3)) + ) + (set! (-> this on-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'on-duration :default 1.15)))) + ) + (set! (-> this off-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'off-duration :default 1.85)))) + ) + (set! (-> this phase-offset) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'zapper-phase)))) + ) + (set! (-> this beam-is-on) #f) + (set-factoryc-light! 0.0 0) + (set! (-> this bzzt-sound) (new-sound-id)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'quaternion)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (get-point-in-path! (-> this path) s3-0 0.5 'interp) + (+! (-> s3-0 y) 4096.0) + (vector-! s5-0 (-> this path curve cverts 0) (-> this path curve cverts 1)) + (let ((f30-3 (vector-length s5-0))) + (vector-float/! s5-0 s5-0 f30-3) + (quaternion-look-at! s2-0 s5-0 *up-vector*) + (quaternion*! s2-0 s2-0 (new 'static 'quaternion :x 1.0)) + (let ((s4-0 (process-spawn generic-spot-shadow-effect s3-0 s2-0 :name "generic-spot-shadow-effect" :to this))) + (when s4-0 + (set! (-> this hilite) (ppointer->handle s4-0)) + (set! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0 far-clip) 2867.2) + (set! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0 near-clip) 0.4096) + (set! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0 color) + (new 'static 'rgba :r #xff :g #x60 :b #x60 :a #x80) + ) + (set-jmod-inner-scale! + (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0) + (new 'static 'vector :x 0.0001 :y 0.0001 :z 0.0001 :w 1.0) + ) + (set-vector! s5-0 1.2 1.2 (* 0.0001319679 f30-3) 1.0) + (set-jmod-outer-scale! (-> (the-as (pointer generic-spot-shadow-effect) s4-0) 0) s5-0) + ) + ) + ) + ) + (go (method-of-object this idle)) + ) + +;; definition for method 10 of type fac-zapper +(defmethod deactivate ((this fac-zapper)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this bzzt-sound)) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type fac-zapper +(defmethod relocate ((this fac-zapper) (offset int)) + (if (nonzero? (-> this path)) + (&+! (-> this path) offset) + ) + (if (nonzero? (-> this lightning)) + (&+! (-> this lightning) offset) + ) + (call-parent-method this offset) + ) + +;; definition of type fac-fire-torch +(deftype fac-fire-torch (process-drawable) + ((on-duration time-frame) + (off-duration time-frame) + (phase-offset time-frame) + (fire-is-on symbol) + (sync sync-eased :inline) + (path-pos float) + (looping-sound sound-id) + (particle-hack matrix :inline) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type fac-fire-torch +(defmethod inspect ((this fac-fire-torch)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Ton-duration: ~D~%" (-> this on-duration)) + (format #t "~2Toff-duration: ~D~%" (-> this off-duration)) + (format #t "~2Tphase-offset: ~D~%" (-> this phase-offset)) + (format #t "~2Tfire-is-on: ~A~%" (-> this fire-is-on)) + (format #t "~2Tsync: #~%" (-> this sync)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Tlooping-sound: ~D~%" (-> this looping-sound)) + (format #t "~2Tparticle-hack: #~%" (-> this particle-hack)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-fire-torch fac-fire-torch fac-fire-torch-lod0-jg fac-fire-torch-idle-ja + ((fac-fire-torch-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 1.75) + ) + +;; failed to figure out what this is: +(defstate idle (fac-fire-torch) + :virtual #t + :trans (behavior () + (set! (-> self path-pos) (get-norm! (-> self sync) 0)) + (get-point-at-percent-along-path! (-> self path) (-> self root trans) (-> self path-pos) 'interp) + (sound-play "fire-loop" :id (-> self looping-sound) :position (-> self root trans)) + ) + :code (behavior () + (set! (-> self fire-is-on) #t) + (sleep-code) + ) + :post (behavior () + (when (-> self fire-is-on) + (let ((f30-0 (total-distance (-> self path))) + (gp-0 (current-time)) + ) + (- (get-scaled-val! (-> self sync) f30-0 (the-as int (+ gp-0 1))) + (get-scaled-val! (-> self sync) f30-0 (the-as int gp-0)) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'matrix))) + (let* ((v1-9 gp-1) + (a3-0 (-> self node-list data 4 bone transform)) + (a0-5 (-> a3-0 rvec quad)) + (a1-2 (-> a3-0 uvec quad)) + (a2-2 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-9 rvec quad) a0-5) + (set! (-> v1-9 uvec quad) a1-2) + (set! (-> v1-9 fvec quad) a2-2) + (set! (-> v1-9 trans quad) a3-1) + ) + (vector-negate-in-place! (-> gp-1 uvec)) + (vector-negate-in-place! (-> gp-1 fvec)) + (let ((a2-3 (-> self particle-hack)) + (v1-10 (-> gp-1 rvec quad)) + (a0-8 (-> gp-1 uvec quad)) + (a1-3 (-> gp-1 fvec quad)) + (a3-2 (-> gp-1 trans quad)) + ) + (set! (-> a2-3 rvec quad) v1-10) + (set! (-> a2-3 uvec quad) a0-8) + (set! (-> a2-3 fvec quad) a1-3) + (set! (-> a2-3 trans quad) a3-2) + ) + ) + (add-debug-rot-matrix #t (bucket-id debug-no-zbuf1) (-> self particle-hack) (-> self root trans)) + (spawn-from-mat (-> self part) (-> self particle-hack)) + (when (and *target* (< -32768.0 (- (-> (target-pos 0) y) (-> self root trans y)))) + (when (< (if *target* + (vector-vector-xz-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 5939.2 + ) + (sound-play "get-burned") + (send-event + *target* + '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 'burn)) + ) + ) + ) + ) + ) + (ja-post) + ) + ) + +;; definition for method 11 of type fac-fire-torch +(defmethod init-from-entity! ((this fac-fire-torch) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-fire-torch" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this on-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'on-duration :default 1.15)))) + ) + (set! (-> this off-duration) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'off-duration :default 1.85)))) + ) + (set! (-> this phase-offset) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'zapper-phase)))) + ) + (set! (-> this fire-is-on) #f) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 806) this)) + (let* ((s4-1 (-> this part)) + (s3-1 (method-of-object s4-1 set-local-space-info)) + (s2-0 (the-as + particle-local-space-info + (add-connection *part-local-space-engine* this local-space-proc-joint 4 0 0) + ) + ) + ) + (let ((v1-20 (process->handle this))) + (if (= v1-20 #f) + (set! v1-20 (process->handle this)) + ) + (set! (-> s2-0 hand) (the-as handle v1-20)) + ) + (matrix-identity! (-> s2-0 mat-new)) + (matrix-identity! (-> s2-0 mat-prev)) + (set! (-> s2-0 flags) (part-local-space-flags)) + (s3-1 s4-1 s2-0) + ) + (let ((a1-11 (new 'stack-no-clear 'sync-info-params))) + (let ((v1-24 0)) + (if #t + (set! v1-24 (logior v1-24 1)) + ) + (set! (-> a1-11 sync-type) 'sync-eased) + (set! (-> a1-11 sync-flags) (the-as sync-flags v1-24)) + ) + (set! (-> a1-11 period) (the-as uint 1200)) + (set! (-> a1-11 entity) arg0) + (set! (-> a1-11 percent) 0.0) + (set! (-> a1-11 ease-in) 0.15) + (set! (-> a1-11 ease-out) 0.15) + (set! (-> a1-11 pause-in) 0.0) + (set! (-> a1-11 pause-out) 0.0) + (initialize! (-> this sync) a1-11) + ) + (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 looping-sound) (new-sound-id)) + (cond + ((logtest? (-> this path flags) (path-control-flag not-found)) + (set! (-> this path-pos) 0.0) + ) + ((> (-> this sync period) 0) + (set! (-> this path-pos) (get-norm! (-> this sync) 0)) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + ) + (else + (set! (-> this path-pos) 0.0) + (get-point-at-percent-along-path! (-> this path) (-> this root trans) (-> this path-pos) 'interp) + ) + ) + (go (method-of-object this idle)) + ) + +;; definition for symbol *fac-robopod-pool-count*, type int +(define *fac-robopod-pool-count* 0) + +;; definition of type fac-robopod +(deftype fac-robopod (process-focusable) + ((my-baby handle 3) + (num-babies uint32) + (subtask-countdown int32) + (suppressed symbol) + ) + (:state-methods + idle + generate + die + already-dead + ) + ) + +;; definition for method 3 of type fac-robopod +(defmethod inspect ((this fac-robopod)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tmy-baby[3] @ #x~X~%" (-> this my-baby)) + (format #t "~2Tnum-babies: ~D~%" (-> this num-babies)) + (format #t "~2Tsubtask-countdown: ~D~%" (-> this subtask-countdown)) + (format #t "~2Tsuppressed: ~A~%" (-> this suppressed)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-robopod fac-robopod fac-robopod-lod0-jg fac-robopod-idle-ja + ((fac-robopod-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-robopod-explode fac-robopod fac-robopod-explode-lod0-jg fac-robopod-explode-idle-ja + ((fac-robopod-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; definition for symbol *fac-robopod-exploder-params*, type joint-exploder-static-params +(define *fac-robopod-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 15 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 16 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 17 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 18 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 19 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 20 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + :art-level #f + ) + ) + +;; definition for function fac-robopod-add-hoverbot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun fac-robopod-add-hoverbot ((arg0 fac-robopod)) + (cond + ((and (< (-> arg0 num-babies) (the-as uint 3)) + (< *fac-robopod-pool-count* 3) + (not (-> *setting-control* user-current nuke-active?)) + ) + (let ((v1-5 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'enemy-init-by-other-params)) + ) + (vector+! v1-5 (-> arg0 root trans) (new 'static 'vector :w 1.0)) + (set! (-> s5-0 trans quad) (-> v1-5 quad)) + (quaternion-copy! (-> s5-0 quat) (-> arg0 root quat)) + (set! (-> s5-0 entity) (-> arg0 entity)) + (set! (-> s5-0 directed?) #f) + (set! (-> s5-0 no-initial-move-to-ground?) #t) + (set! (-> s5-0 art-level) 'lfacrm2) + (let* ((s4-0 (get-process *default-dead-pool* robo-hover #x4000 1)) + (v0-4 (ppointer->handle (when s4-0 + (let ((t9-2 (method-of-type process activate))) + (t9-2 s4-0 arg0 "robo-hover" (the-as pointer #x70004000)) + ) + (run-now-in-process s4-0 enemy-init-by-other arg0 s5-0) + (-> s4-0 ppointer) + ) + ) + ) + ) + (when (!= v0-4 #f) + (set! (-> arg0 my-baby (-> arg0 num-babies)) (the-as handle v0-4)) + (+! (-> arg0 num-babies) 1) + (set! *fac-robopod-pool-count* (+ *fac-robopod-pool-count* 1)) + ) + ) + ) + ) + (else + ) + ) + (none) + ) + +;; definition for function fac-robopod-invalidate-hoverbot +;; WARN: Return type mismatch symbol vs none. +(defun fac-robopod-invalidate-hoverbot ((arg0 fac-robopod) (arg1 int)) + (when (> (-> arg0 num-babies) 0) + (let ((v1-2 (+ (-> arg0 num-babies) -1))) + (set! (-> arg0 num-babies) v1-2) + (let ((a2-2 (-> arg0 my-baby v1-2)) + (a3-2 (-> arg0 my-baby arg1)) + ) + (set! *fac-robopod-pool-count* (+ *fac-robopod-pool-count* -1)) + (when (!= v1-2 arg1) + (set! (-> arg0 my-baby arg1) a2-2) + (set! (-> arg0 my-baby v1-2) a3-2) + ) + ) + (set! (-> arg0 my-baby v1-2) (the-as handle #f)) + ) + ) + (none) + ) + +;; definition for function fac-robopod-base-handler +(defbehavior fac-robopod-base-handler fac-robopod ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('impact-impulse) + (let ((v1-1 (the-as object (-> arg3 param 0)))) + (when (< 40960.0 (-> (the-as rigid-body-impact v1-1) impulse)) + (logior! (-> self root penetrated-by) (penetrate vehicle)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.15)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 192 (seconds 0.1)) + (go-virtual die) + #t + ) + ) + ) + (('child-die) + (let ((v1-10 (+ (-> self subtask-countdown) -1))) + (set! (-> self subtask-countdown) v1-10) + (when (zero? v1-10) + (let ((t9-3 format) + (a0-9 #t) + (a1-3 "%s dead~%") + ) + (-> self name) + (t9-3 a0-9 a1-3) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + ) + ) + ) + (('suppress) + (format #t "suppress~%") + (set! (-> self suppressed) #t) + (dotimes (gp-0 3) + (format #t "~d : ~I~%" gp-0 (-> self my-baby gp-0)) + (when (and (-> self my-baby gp-0) (handle->process (-> self my-baby gp-0))) + (let ((s5-0 (handle->process (-> self my-baby gp-0)))) + (format #t "killing ~A~%" (-> s5-0 name)) + (send-event s5-0 'die-fast) + ) + ) + ) + #f + ) + (('unsuppress) + (set! (-> self suppressed) #f) + #f + ) + ) + ) + +;; definition for method 27 of type fac-robopod +;; INFO: this function exists in multiple non-identical object files +(defmethod get-inv-mass ((this fac-robopod)) + 2.0 + ) + +;; failed to figure out what this is: +(defstate idle (fac-robopod) + :virtual #t + :event fac-robopod-base-handler + :enter (behavior () + (setup-masks (-> self draw) 2 1) + ) + :code (behavior () + (until #f + (dotimes (gp-0 (the-as int (-> self num-babies))) + (cond + ((and (-> self my-baby gp-0) (handle->process (-> self my-baby gp-0))) + (let ((s5-0 (handle->process (-> self my-baby gp-0)))) + (when (and (-> s5-0 next-state) (= (-> s5-0 next-state name) 'dormant)) + (fac-robopod-invalidate-hoverbot self gp-0) + (send-event s5-0 'die-fast) + ) + ) + ) + (else + (fac-robopod-invalidate-hoverbot self gp-0) + ) + ) + ) + (if (and (< (-> self num-babies) (the-as uint 3)) + (< *fac-robopod-pool-count* 3) + (and (< (if *target* + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + 4096000.0 + ) + 245760.0 + ) + (< (+ -24576.0 (-> self root trans y)) (-> (target-pos 0) y)) + (not (-> self suppressed)) + ) + ) + (go-virtual generate) + ) + (suspend) + ) + #f + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate generate (fac-robopod) + :virtual #t + :event fac-robopod-base-handler + :code (behavior () + (fac-robopod-add-hoverbot self) + (sound-play "fac-hatch-open") + (ja-no-eval :group! fac-robopod-open-ja :num! (seek! max 2.0) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + (sound-play "fac-hatch-close") + (ja-no-eval :group! fac-robopod-close-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-virtual idle) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate die (fac-robopod) + :virtual #t + :enter (behavior () + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (let* ((gp-0 (new 'stack 'joint-exploder-tuning (the-as uint 1))) + (s5-0 *target*) + (a0-3 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (when a0-3 + (get-trans a0-3 0) + (let ((s5-1 (-> *target* control transv))) + (vector-negate! (-> gp-0 fountain-rand-transv-lo) s5-1) + (vector+! (-> gp-0 fountain-rand-transv-lo) (-> gp-0 fountain-rand-transv-lo) (-> self root trans)) + (+! (-> gp-0 fountain-rand-transv-lo y) -40960.0) + (let ((f0-2 (vector-length s5-1))) + (set! (-> gp-0 fountain-rand-transv-hi x) f0-2) + (set! (-> gp-0 fountain-rand-transv-hi y) (* 3.0 f0-2)) + ) + ) + (set! (-> gp-0 fountain-rand-transv-hi z) 24576.0) + (set! (-> gp-0 fountain-rand-transv-hi w) 73728.0) + (sound-play "fac-hatch-explo") + (cond + ((logtest? (-> *part-group-id-table* 752 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 752)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 752)) + ) + ) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-fac-robopod-explode" (the-as (pointer level) #f)) + 8 + gp-0 + *fac-robopod-exploder-params* + :name "joint-exploder" + :to self + ) + ) + ) + ) + :code (behavior () + (set! (-> self root root-prim prim-core collide-with) (collide-spec)) + (set! (-> self root root-prim prim-core collide-as) (collide-spec)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (cond + ((logtest? (-> *part-group-id-table* 218 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 218)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 218)) + ) + ) + (setup-masks (-> self draw) 1 2) + (sleep-code) + ) + :post ja-post + ) + +;; failed to figure out what this is: +(defstate already-dead (fac-robopod) + :virtual #t + :enter (behavior () + (set! (-> self root root-prim prim-core collide-with) (collide-spec)) + (set! (-> self root root-prim prim-core collide-as) (collide-spec)) + (set! (-> self root root-prim prim-core action) (collide-action)) + (setup-masks (-> self draw) 1 2) + ) + :code sleep-code + :post ja-post + ) + +;; definition for method 27 of type fac-robopod +;; INFO: this function exists in multiple non-identical object files +(defmethod get-inv-mass ((this fac-robopod)) + 2.0 + ) + +;; definition for method 10 of type fac-robopod +(defmethod deactivate ((this fac-robopod)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (format #t "~s killing ~d babies~%" (-> this name) (-> this num-babies)) + (set! *fac-robopod-pool-count* (- *fac-robopod-pool-count* (the-as int (-> this num-babies)))) + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type fac-robopod +(defmethod init-from-entity! ((this fac-robopod) (arg0 entity-actor)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-6 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-6 prim-core collide-as) (collide-spec obstacle)) + (set! (-> v1-6 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set! (-> v1-6 transform-index) 3) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 20480.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) v1-6) + ) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-9 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-fac-robopod" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((v1-14 0) + (a0-14 2) + ) + (while (>= a0-14 v1-14) + (set! (-> this my-baby v1-14) (the-as handle #f)) + (+! v1-14 1) + ) + ) + (set! (-> this num-babies) (the-as uint 0)) + (set! (-> this subtask-countdown) + (res-lump-value (-> this entity) 'gate-countdown int :default (the-as uint128 5) :time -1000000000.0) + ) + (set! (-> this suppressed) #f) + (if (not (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle)) + (go (method-of-object this already-dead)) + ) + ) + +;; definition of type factory-elec-gate +(deftype factory-elec-gate (process) + ((path-l path-control) + (path-r path-control) + (beams lightning-control 4) + (beams-on symbol 4) + (bzzt-sound sound-id) + (blocking-plane handle) + (actor-group (pointer actor-group)) + (actor-group-count int32) + ) + (:state-methods + idle + flickering + ) + ) + +;; definition for method 3 of type factory-elec-gate +(defmethod inspect ((this factory-elec-gate)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type process inspect))) + (t9-0 this) + ) + (format #t "~2Tpath-l: ~A~%" (-> this path-l)) + (format #t "~2Tpath-r: ~A~%" (-> this path-r)) + (format #t "~2Tbeams[4] @ #x~X~%" (-> this beams)) + (format #t "~2Tbeams-on[4] @ #x~X~%" (-> this beams-on)) + (format #t "~2Tbzzt-sound: ~D~%" (-> this bzzt-sound)) + (format #t "~2Tblocking-plane: ~D~%" (-> this blocking-plane)) + (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)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate idle (factory-elec-gate) + :virtual #t + :enter (behavior () + (let ((gp-0 0) + (s5-0 3) + ) + (while (>= s5-0 gp-0) + (let ((s4-0 (get-point-in-path! (-> self path-l) (new 'stack-no-clear 'vector) (the float gp-0) 'interp)) + (v1-2 (get-point-in-path! (-> self path-r) (new 'stack-no-clear 'vector) (the float gp-0) 'interp)) + ) + (set! (-> self beams gp-0 state meet data 0 quad) (-> s4-0 quad)) + (let ((a0-9 (-> self beams gp-0))) + (set! (-> a0-9 state meet data (+ (-> a0-9 state points-to-draw) -1) quad) (-> v1-2 quad)) + ) + ) + (set! (-> self beams-on gp-0) #t) + (set-factoryc-light! 1.0 1) + (+! gp-0 1) + ) + ) + (when (not (handle->process (-> self blocking-plane))) + (let ((gp-1 (new 'static 'inline-array vector 2 (new 'static 'vector) (new 'static 'vector)))) + (get-point-in-path! (-> self path-l) (-> gp-1 0) 0.0 'interp) + (get-point-in-path! (-> self path-r) (-> gp-1 1) 0.0 'interp) + (+! (-> gp-1 0 y) -16384.0) + (+! (-> gp-1 1 y) -16384.0) + (set! (-> self blocking-plane) + (ppointer->handle (process-spawn blocking-plane gp-1 #x47f00000 :name "blocking-plane" :to self)) + ) + ) + (send-event (handle->process (-> self blocking-plane)) 'collide-as #x4000000) + (send-event (handle->process (-> self blocking-plane)) 'attack-mode 'shock) + ) + ) + :code sleep-code + :post (behavior () + (when (> (-> self actor-group-count) 0) + (dotimes (gp-0 (length (-> self actor-group 0))) + (when (logtest? (-> self actor-group 0 data gp-0 actor extra perm status) (entity-perm-status subtask-complete)) + (go-virtual flickering) + #t + (goto cfg-8) + ) + ) + ) + (label cfg-8) + (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) + (debug-draw (-> self path-l)) + (debug-draw (-> self path-r)) + ) + ) + +;; failed to figure out what this is: +(defstate flickering (factory-elec-gate) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 3)) + (let ((s5-0 (the-as int (rand-uint31-gen *random-generator*)))) + (let ((s4-0 0) + (s3-0 3) + ) + (while (>= s3-0 s4-0) + (cond + ((logtest? s5-0 1) + (when (not (-> self beams-on s4-0)) + (let ((v1-8 (-> self beams s4-0)) + (a0-1 1) + ) + (let ((a1-1 (!= a0-1 (-> v1-8 state mode)))) + (case a0-1 + ((3) + (if a1-1 + (set! (-> v1-8 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-8 state start-color) (-> v1-8 spec start-color)) + (set! (-> v1-8 state end-color) (-> v1-8 spec end-color)) + ) + ) + ) + (set! (-> v1-8 state mode) (the-as uint a0-1)) + ) + (set! (-> self beams-on s4-0) #t) + (set-factoryc-light! 1.0 1) + ) + ) + (else + (when (-> self beams-on s4-0) + (let ((v1-17 (-> self beams s4-0)) + (a0-5 3) + ) + (let ((a1-12 (!= a0-5 (-> v1-17 state mode)))) + (case a0-5 + ((3) + (if a1-12 + (set! (-> v1-17 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-17 state start-color) (-> v1-17 spec start-color)) + (set! (-> v1-17 state end-color) (-> v1-17 spec end-color)) + ) + ) + ) + (set! (-> v1-17 state mode) (the-as uint a0-5)) + ) + (set! (-> self beams-on s4-0) #f) + (set-factoryc-light! 0.0 1) + ) + ) + ) + (set! s5-0 (/ s5-0 2)) + (+! s4-0 1) + ) + ) + (let ((s4-1 (current-time))) + (until (time-elapsed? s4-1 (seconds 0.1)) + (if (logand s5-0 1) + (sound-play "laser-loop" :id (-> self bzzt-sound) :position (-> self entity trans)) + ) + (suspend) + ) + ) + ) + (suspend) + ) + ) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (process-entity-status! self (entity-perm-status dead) #t) + (sound-stop (-> self bzzt-sound)) + (let ((a0-13 (handle->process (-> self blocking-plane)))) + (if a0-13 + (deactivate a0-13) + ) + ) + ) + :post (behavior () + (debug-draw (-> self path-l)) + (debug-draw (-> self path-r)) + ) + ) + +;; definition for method 7 of type factory-elec-gate +(defmethod relocate ((this factory-elec-gate) (offset int)) + (if (nonzero? (-> this path-l)) + (&+! (-> this path-l) offset) + ) + (if (nonzero? (-> this path-r)) + (&+! (-> this path-r) offset) + ) + (let ((v1-8 0) + (a0-1 3) + ) + (while (>= a0-1 v1-8) + (if (nonzero? (-> this beams v1-8)) + (&+! (-> this beams v1-8) offset) + ) + (+! v1-8 1) + ) + ) + (call-parent-method this offset) + ) + +;; definition for method 10 of type factory-elec-gate +(defmethod deactivate ((this factory-elec-gate)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (sound-stop (-> this bzzt-sound)) + (call-parent-method this) + (none) + ) + +;; definition for method 11 of type factory-elec-gate +;; INFO: Used lq/sq +(defmethod init-from-entity! ((this factory-elec-gate) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (when (task-node-closed? (game-task-node factory-assault-get-vehicle)) + (process-entity-status! this (entity-perm-status dead) #t) + (deactivate this) + ) + (set! (-> this path-l) (new 'process 'path-control this 'pathl 0.0 arg0 #f)) + (set! (-> this path-r) (new 'process 'path-control this 'pathr 0.0 arg0 #f)) + (logior! (-> this path-l flags) (path-control-flag display draw-line draw-point draw-text)) + (logior! (-> this path-r flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this bzzt-sound) (new-sound-id)) + (let ((s4-0 0) + (s3-0 3) + ) + (while (>= s3-0 s4-0) + (set! (-> this beams s4-0) (new 'process 'lightning-control (-> *lightning-spec-id-table* 34) this 0.0)) + (set! (-> this beams-on s4-0) #f) + (set-factoryc-light! 0.0 1) + (+! s4-0 1) + ) + ) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-20 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-20 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) v1-20) + ) + (else + (set! (-> this actor-group-count) 0) + 0 + ) + ) + ) + (set! (-> this blocking-plane) (the-as handle #f)) + (if (not (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete))) + (go (method-of-object this idle)) + (go (method-of-object this flickering)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc new file mode 100644 index 0000000000..8de0ddfb79 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/ffight-projectile_REF.gc @@ -0,0 +1,765 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 2850 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2851 + :init-specs ((:texture (gun-enemy-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y (meters 16)) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -3.2) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2852 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.15) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 2853 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2854 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 1.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.8) + (:fade-g -0.8) + (:fade-b -0.4) + (:fade-a -0.1875) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2855 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y (meters 5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 255.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2856 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.10666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ffight-shot-hit-object + :id 763 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2857 :flags (sp3)) (sp-item 2858 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +;; failed to figure out what this is: +(defpart 2857 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2858 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 255.0) + (:g 40.0) + (:b 100.0) + (:a 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.42666668 -0.42666668) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ffight-shot-hit + :id 764 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2859 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2860 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2861 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2862 :period (seconds 30) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 2859 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 255.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2860 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 40.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.4) + (:fade-g -0.13333334) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2861 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2862 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 30.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.26666668) + (:fade-g -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ffight-shot-die + :id 765 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; definition of type ffight-shot +(deftype ffight-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + +;; definition for method 3 of type ffight-shot +(defmethod inspect ((this ffight-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (label cfg-4) + this + ) + +;; definition for method 37 of type ffight-shot +(defmethod deal-damage! ((this ffight-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition for method 24 of type ffight-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this ffight-shot)) + (draw-beam (-> *part-id-table* 2855) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 2856)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type ffight-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this ffight-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 2851 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2851 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 2851) a1-0 s5-1 #f) + (set! (-> *part-id-table* 2851 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 2852) s4-0) + (launch-particles (-> *part-id-table* 2853) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f28-1 (* 0.000015258789 f30-0)) + (f30-1 (-> *part-id-table* 2854 init-specs 3 initial-valuef)) + ) + (-> *part-id-table* 2854 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) (* f28-1 f30-1)) + (launch-particles (-> *part-id-table* 2854) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 2854 init-specs 3 initial-valuef) f30-1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type ffight-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this ffight-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 763 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 763) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 763) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 764 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 764) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 764) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type ffight-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this ffight-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "ffight-shot-fir") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "fighter-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + (sound-play "ffight-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate impact (ffight-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + ) + +;; definition for function ffight-shot-move +;; WARN: Return type mismatch int vs none. +(defun ffight-shot-move ((arg0 ffight-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 65536.0 f0-0) + (vector-normalize! s4-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type ffight-shot +(defmethod made-impact? ((this ffight-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +;; definition for method 30 of type ffight-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this ffight-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type ffight-shot +;; INFO: Used lq/sq +(defmethod init-proj-settings! ((this ffight-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'ffight-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) ffight-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) 1.0) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + (none) + ) + +;; definition for function spawn-ffight-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-ffight-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 symbol)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as projectile (spawn-projectile ffight-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 27) (new 'static 'lightning-spec + :name "lightning-trail-ffight-ffight" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 28) (new 'static 'lightning-spec + :name "lightning-fractal-ffight-ffight" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defpart 2863 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 2864 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup part-ffight-lightning-glow + :id 766 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2864 :fade-after (meters 100) :flags (sp6)) (sp-item 2863 :fade-after (meters 100) :flags (sp6))) + ) + +;; failed to figure out what this is: +0 diff --git a/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc new file mode 100644 index 0000000000..7c59935fa3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/ftank-projectile_REF.gc @@ -0,0 +1,674 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 2865 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2866 + :init-specs ((:texture (gun-blue-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 16)) + (:r 32.0) + (:g 32.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -1.6) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2867 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.15) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 2868 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2869 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 1.0 10.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g -1.6) + (:fade-b 1.6) + (:fade-a -0.375) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2870 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 2)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 255.0) + (:fade-a -2.56) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2871 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 255.0) + (:scalevel-x (meters 0.10666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -5.1) + (:timer (seconds 0.167)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ftank-shot-hit-object + :id 767 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2872 :flags (sp3)) (sp-item 2873 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +;; failed to figure out what this is: +(defpart 2872 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2873 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 0.0) + (:g 0.0 64.0) + (:b 255.0) + (:a 128.0 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.21333334 -0.21333334) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ftank-shot-hit + :id 768 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2874 :flags (sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2874 + :init-specs ((:texture (laser-hit2 level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 30.0) + (:b 255.0) + (:a 255.0) + (:vel-z (meters -0.033333335)) + (:scalevel-x (meters 0.6666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -4.25) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-ftank-shot-die + :id 769 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; definition of type ftank-shot +(deftype ftank-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + +;; definition for method 3 of type ftank-shot +(defmethod inspect ((this ftank-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (label cfg-4) + this + ) + +;; definition for method 37 of type ftank-shot +(defmethod deal-damage! ((this ftank-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition for method 24 of type ftank-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this ftank-shot)) + (draw-beam (-> *part-id-table* 2870) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 2871)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type ftank-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this ftank-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 2866 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2866 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 2866) a1-0 s5-1 #f) + (set! (-> *part-id-table* 2866 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 2867) s4-0) + (launch-particles (-> *part-id-table* 2868) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f28-1 (* 0.000015258789 f30-0)) + (f30-1 (-> *part-id-table* 2869 init-specs 3 initial-valuef)) + ) + (-> *part-id-table* 2869 init-specs 4 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) (* f28-1 f30-1)) + (launch-particles (-> *part-id-table* 2869) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 2869 init-specs 3 initial-valuef) f30-1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type ftank-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this ftank-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 767 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 767) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 767) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 768 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 768) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 768) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type ftank-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this ftank-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "tank-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "tank-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate impact (ftank-shot) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + (when *traffic-manager* + (let ((v1-5 (new 'stack-no-clear 'traffic-danger-info))) + (set! (-> v1-5 sphere quad) (-> self root trans quad)) + (set! (-> v1-5 sphere r) 40960.0) + (set! (-> v1-5 velocity quad) (-> self root transv quad)) + (set! (-> v1-5 notify-radius) 122880.0) + (set! (-> v1-5 danger-level) 1.0) + (set! (-> v1-5 decay-rate) 0.0) + (set! (-> v1-5 flags) (the-as uint 1)) + (set! (-> v1-5 danger-type) (the-as uint 0)) + (set! (-> v1-5 handle) (the-as handle #f)) + (send-event *traffic-manager* 'add-danger-sphere v1-5) + ) + ) + ) + ) + +;; definition for function ftank-shot-move +;; WARN: Return type mismatch int vs none. +(defun ftank-shot-move ((arg0 ftank-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 65536.0 f0-0) + (vector-normalize! s4-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type ftank-shot +(defmethod made-impact? ((this ftank-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +;; definition for method 30 of type ftank-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this ftank-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type ftank-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this ftank-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fac-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) ftank-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this vehicle-damage-factor) 0.5) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + 0 + (none) + ) + +;; definition for function spawn-ftank-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-ftank-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as projectile (spawn-projectile ftank-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 29) (new 'static 'lightning-spec + :name "lightning-trail-ftank-ftank" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 30) (new 'static 'lightning-spec + :name "lightning-fractal-ftank-ftank" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defpart 2875 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 2876 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup part-ftank-lightning-glow + :id 770 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2876 :fade-after (meters 100) :flags (sp6)) (sp-item 2875 :fade-after (meters 100) :flags (sp6))) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc new file mode 100644 index 0000000000..d5ad2640e3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/fturret-projectile_REF.gc @@ -0,0 +1,761 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 2877 + :init-specs ((:texture (common-white common)) + (:num 10.0 1.0) + (:x (meters 0)) + (:y (meters 0)) + (:z (meters 0)) + (:scale-x (meters 1)) + (:rot-x (degrees 90)) + (:rot-y (degrees 0)) + (:rot-z (degrees 0)) + (:scale-y (meters 0.1)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:accel-y (meters -0.00033333333) (meters -0.001)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2878 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.25)) + (:scale-y (meters 9)) + (:r 128.0) + (:g 0.0 64.0) + (:b 0.0) + (:a 128.0) + (:scalevel-x (meters 0.0016666667)) + (:fade-a -2.1333334) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2879 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0 32.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a -1.6) + (:timer (seconds 0.085)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2880 + :init-specs ((:texture (glow level-default-sprite)) + (:num 0.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2881 + :init-specs ((:texture (radial-gradient level-default-sprite)) + (:num 8.0 8.0) + (:z (meters 0) (meters -3)) + (:scale-x (meters 0.4) (meters 0.4)) + (:scale-y (meters 0.4) (meters 0.4)) + (:r 192.0) + (:g 64.0 128.0) + (:b 0.0) + (:a 64.0) + (:scalevel-x (meters -0.00234375)) + (:scalevel-y :copy scalevel-x) + (:fade-g -1.2 -2.4) + (:fade-a -0.53333336 -2.1333334) + (:accel-y (meters -0.00016666666) (meters -0.00016666666)) + (:timer (seconds 0.8)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2882 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2883 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 255.0) + (:omega (degrees 4515.75)) + (:scalevel-x (meters 0.053333335)) + (:scalevel-y :copy scalevel-x) + (:fade-g -3.6571429) + (:fade-a -7.285714) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 1024.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fturret-shot-hit-object + :id 771 + :duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2884 :flags (sp3)) (sp-item 2885 :flags (sp7) :period (seconds 4) :length (seconds 0.1))) + ) + +;; failed to figure out what this is: +(defpart 2884 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 90)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:fade-a -0.21333334) + (:timer (seconds 0.035)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 glow)) + (:userdata 16384.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2885 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 5.0) + (:scale-x (meters 2)) + (:rot-x 4) + (:scale-y (meters 0.15)) + (:r 255.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0 128.0) + (:omega (degrees 0.0225)) + (:vel-z (meters 0.33333334) (meters 0.16666667)) + (:fade-b -0.42666668 -0.42666668) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0016666667)) + (:friction 0.8 0.02) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 launch-along-z)) + (:func 'sparticle-motion-blur) + (:conerot-x (degrees -10) (degrees 20)) + (:conerot-y (degrees -10) (degrees 20)) + (:rotate-x (degrees -45)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fturret-shot-hit + :id 772 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2886 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2887 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2888 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2889 :period (seconds 30) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 2886 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2887 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.4) + (:fade-b -0.13333334) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2888 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2889 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fturret-grenade + :id 773 + :duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 2890 :fade-after (meters 200) :falloff-to (meters 200))) + ) + +;; failed to figure out what this is: +(defpart 2890 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 64.0 128.0) + (:g :copy r) + (:b :copy g) + (:a 16.0 32.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.013333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.16 -0.16) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + (:conerot-radius (meters 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-fturret-shot-die + :id 774 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; definition of type fturret-shot +(deftype fturret-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + +;; definition for method 3 of type fturret-shot +(defmethod inspect ((this fturret-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (label cfg-4) + this + ) + +;; definition for method 37 of type fturret-shot +(defmethod deal-damage! ((this fturret-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition for method 24 of type fturret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this fturret-shot)) + (draw-beam (-> *part-id-table* 2882) (-> this tail-pos) (-> this starting-dir) #f) + (let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this starting-dir) 2048.0)) + (v1-2 (vector+! (new 'stack-no-clear 'vector) (-> this tail-pos) a0-3)) + (t9-2 sp-launch-particles-var) + (a0-4 *sp-particle-system-2d*) + (a1-4 (-> *part-id-table* 2883)) + (a2-2 *launch-matrix*) + ) + (set! (-> a2-2 trans quad) (-> v1-2 quad)) + (t9-2 a0-4 a1-4 a2-2 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + 0 + (none) + ) + +;; definition for method 25 of type fturret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this fturret-shot)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 a1-0)) + (f30-0 (vector-length s5-1)) + ) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s5-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s4-0 quad) vf6) + (let ((f28-0 (-> *part-id-table* 2878 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2878 init-specs 4 initial-valuef) (vector-length s5-1)) + (draw-beam (-> *part-id-table* 2878) a1-0 s5-1 #f) + (set! (-> *part-id-table* 2878 init-specs 4 initial-valuef) f28-0) + ) + (vector-normalize! s5-1 1.0) + (launch-particles (-> *part-id-table* 2879) s4-0) + (launch-particles (-> *part-id-table* 2880) s4-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix)) + (f26-0 (* 0.000027126736 f30-0)) + (f30-1 (-> *part-id-table* 2881 init-specs 3 initial-valuef)) + (f28-1 (-> *part-id-table* 2881 init-specs 4 initial-valuef)) + ) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + (set! (-> *part-id-table* 2881 init-specs 3 initial-valuef) (* f26-0 f30-1)) + (set! (-> *part-id-table* 2881 init-specs 4 initial-valuef) (* f26-0 f28-1)) + (launch-particles (-> *part-id-table* 2881) s4-1 :origin-is-matrix #t) + (set! (-> *part-id-table* 2881 init-specs 3 initial-valuef) f30-1) + (set! (-> *part-id-table* 2881 init-specs 4 initial-valuef) f28-1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 26 of type fturret-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this fturret-shot)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 771 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 771) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 771) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 772 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 772) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 772) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type fturret-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this fturret-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "tank-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "turret-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +;; definition for function fturret-shot-move +;; WARN: Return type mismatch int vs none. +(defun fturret-shot-move ((arg0 fturret-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 36864.0 f0-0) + (vector-normalize! s4-0 36864.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 38 of type fturret-shot +(defmethod made-impact? ((this fturret-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -6144.0 0.0 -2048.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +;; definition for method 30 of type fturret-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this fturret-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot crate hit-by-others-list player-list)) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type fturret-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this fturret-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'fac-robotank-shot) + (set! (-> this max-speed) 819200.0) + (set! (-> this move) fturret-shot-move) + (set! (-> this update-velocity) projectile-update-velocity-space-wars) + (set! (-> this timeout) (seconds 0.5)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this damage) 1.0) + (logior! (-> this options) (projectile-options po13)) + (set-gravity-length (-> this root dynam) 573440.0) + 0 + (none) + ) + +;; definition for function spawn-fturret-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-fturret-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float) (arg4 vector)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-13 *game-info*) + (a2-12 (+ (-> a0-13 attack-id) 1)) + ) + (set! (-> a0-13 attack-id) a2-12) + (set! (-> gp-0 attack-id) a2-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (if arg4 + (set! (-> gp-0 pos quad) (-> arg4 quad)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + ) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (the-as projectile (spawn-projectile fturret-shot gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 31) (new 'static 'lightning-spec + :name "lightning-trail-fturret-fturret" + :flags (lightning-spec-flags lsf1) + :rand-func #x2 + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 32) (new 'static 'lightning-spec + :name "lightning-fractal-fturret-fturret" + :flags (lightning-spec-flags lsf1) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.6 + :num-points 16 + :box-size 2048.0 + :merge-factor 0.5 + :merge-count 2 + :radius 1638.4 + :duration -1.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defpart 2891 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8) (meters 0.2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17) (degrees 360)) + (:scale-y :copy scale-x) + (:r 32.0 96.0) + (:g :copy r) + (:b 255.0) + (:a 32.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpart 2892 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 1)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees -17)) + (:scale-y :copy scale-x) + (:r 0.0 64.0) + (:g :copy r) + (:b 255.0) + (:a 16.0 16.0) + (:omega (degrees 2265.75)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup part-fturret-lightning-glow + :id 775 + :duration (seconds 0.017) + :linger-duration (seconds 0.035) + :bounds (static-bspherem 0 0 0 4) + :parts ((sp-item 2892 :fade-after (meters 100) :flags (sp6)) (sp-item 2891 :fade-after (meters 100) :flags (sp6))) + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc new file mode 100644 index 0000000000..54f316b6a3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/h-warf_REF.gc @@ -0,0 +1,1925 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *h-warf-center-of-level*, type vector +(define *h-warf-center-of-level* (new 'static 'vector :x 1228800.0 :z 1024000.0 :w 1.0)) + +;; failed to figure out what this is: +(defskelgroup skel-h-warf hellcat hellcat-lod0-jg hellcat-idle-ja + ((hellcat-lod0-mg (meters 20)) (hellcat-lod1-mg (meters 40)) (hellcat-lod2-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6.8) + :shadow hellcat-shadow-mg + :origin-joint-index 3 + ) + +;; definition for symbol *h-warf-constants*, type rigid-body-vehicle-constants +(define *h-warf-constants* + (new 'static 'rigid-body-vehicle-constants + :info (new 'static 'rigid-body-info + :mass 10.0 + :inv-mass 0.1 + :linear-damping 1.0 + :angular-damping 1.0 + :bounce-factor 0.4 + :friction-factor 0.05 + :bounce-mult-factor 1.22 + :cm-offset-joint (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :inertial-tensor-box (new 'static 'array meters 3 (meters 6) (meters 6) (meters 6)) + ) + :extra (new 'static 'rigid-body-object-extra-info + :max-time-step 0.033333335 + :gravity (meters 20) + :idle-distance (meters 50) + :attack-force-scale 1.0 + ) + :name '*h-warf-constants* + :flags #x40408 + :object-type #x17 + :guard-type #xb + :vehicle-type (vehicle-type-u8 vt27) + :transmission (new 'static 'vehicle-transmission-info :gear-count 1) + :handling (new 'static 'vehicle-handling-info + :max-engine-thrust (meters 30) + :inv-max-engine-thrust 0.000008138021 + :engine-response-rate 60.0 + :engine-intake-factor 1.0 + :brake-factor 2.25 + :turbo-boost-factor 1.0 + :turbo-boost-duration (seconds 1) + :max-xz-speed (meters 30) + :player-turn-anim-min -1.0 + :player-turn-anim-max 1.0 + :pilot-x-accel-factor 1.0 + :pilot-y-accel-factor 1.0 + :pilot-z-accel-factor 1.0 + :ground-probe-distance (meters 4.5) + :cos-ground-effect-angle 0.42261827 + :spring-lift-factor 0.3 + :air-drag-factor 1.0 + :steering-thruster-factor 30.0 + :steering-thruster-max-gain 2.0 + :steering-thruster-half-gain-speed (meters 300) + :tire-steering-speed-factor 61440.0 + :tire-friction-factor 0.5 + :tire-static-friction 0.55 + :tire-dynamic-friction 0.4 + :tire-dynamic-friction-speed (meters 2) + :tire-inv-max-friction-speed 0.000034877234 + :airfoil-factor 1.0 + :drag-force-factor 1.0 + :speed-scrubbing-drag 10.0 + :speed-limiting-drag 0.5 + :pitch-control-factor 0.5 + :roll-control-factor 1.0 + :jump-thrust-factor 0.5 + :buoyancy-factor 1.0 + :water-drag-factor 1.0 + :player-weight 163840.0 + :player-shift-x (meters 0.6) + :player-shift-z (meters 1) + :air-angular-damping 1.0 + :ground-torque-scale 1.0 + :ai-steering-factor 1.0 + :ai-throttle-factor 1.0 + ) + :target-speed-offset (meters -2) + :turning-accel (meters 12) + :camera (new 'static 'vehicle-camera-info + :string-min-height (meters 6.5) + :string-max-height (meters 6.5) + :string-min-length (meters 13.4) + :string-max-length (meters 17.5) + :min-fov 16384.0 + :max-fov 18204.445 + :head-offset 4096.0 + :foot-offset -4096.0 + :air-max-angle-offset 5461.3335 + :max-lookaround-speed 40960.0 + :look-pos-array (new 'static 'inline-array vector 4 + (new 'static 'vector :y 11059.2 :z -51200.0 :w 1.0) + (new 'static 'vector :x -20480.0 :y 14336.0 :w 1.0) + (new 'static 'vector :x 20480.0 :y 14336.0 :w 1.0) + (new 'static 'vector :y 14336.0 :z 20480.0 :w 1.0) + ) + ) + :sound (new 'static 'vehicle-sound-info + :engine-pitch-scale 0.25 + :engine-pitch-mod-amp 0.025 + :engine-sound-select 8 + :thrust-sound (static-sound-name "bike-thrust") + :scrape-sound (static-sound-name "impact-hard") + :glance-sound (static-sound-name "impact-soft") + :impact-sound (static-sound-name "impact-hard") + :explode-sound (static-sound-name "hellcat-explode") + :explode2-sound (static-sound-name "vehicle-explo-b") + :extra-sound (static-sound-name "car-by-8") + :bank-replace '() + :idle-pitch-scale 1.0 + :idle-crossover-rpm 1000.0 + :engine-crossover-rpm 4000.0 + :start-sound (static-sound-name "vehicl-ignition") + :susp-speed-threshold 40960.0 + :tire-roll-sounds (new 'static 'inline-array vehicle-sound-loop-info 4 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + :tire-slide-sounds (new 'static 'inline-array vehicle-sound-loop-info 2 + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + (new 'static 'vehicle-sound-loop-info + :speed 409600.0 + :max-speed 409600.0 + :pitch-scale 1.0 + :min-pitch -10.0 + :max-pitch 10.0 + ) + ) + ) + :particles (new 'static 'vehicle-particle-info + :headlight-count 3 + :taillight-count 2 + :thruster-flame-width (meters 0.6) + :thruster-flame-length (meters 1) + :thruster-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 4096.0 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 4096.0 :z -17612.8 :w 1.0) + ) + :exhaust-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 6144.0 :y 5529.6 :z -17612.8 :w 1.0) + (new 'static 'vector :x -6144.0 :y 5529.6 :z -17612.8 :w 1.0) + ) + :exhaust-local-dir (new 'static 'inline-array vector 2 (new 'static 'vector :z -1.0 :w 1.0) (new 'static 'vector :z -1.0 :w 1.0)) + :smoke-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :y 4096.0 :z -16384.0 :w 1.0) + (new 'static 'vector :x -2048.0 :y 4096.0 :z -16384.0 :w 1.0) + ) + :smoke-local-vel (new 'static 'inline-array vector 2 + (new 'static 'vector :x 2048.0 :w 1.0) + (new 'static 'vector :x -2048.0 :w 1.0) + ) + :headlight-local-pos (new 'static 'inline-array vector 3 + (new 'static 'vector :x 5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :x -5734.4 :y 1843.2 :z 15769.6 :w 1.0) + (new 'static 'vector :y 6963.2 :z 6922.24 :w 1.0) + ) + :taillight-local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 10362.88 :y 4710.4 :z -16998.4 :w 1.0) + (new 'static 'vector :x -10362.88 :y 4710.4 :z -16998.4 :w 1.0) + ) + ) + :damage (new 'static 'vehicle-damage-info + :inv-toughness-factor 0.005 + :hit-points 30.0 + :inv-hit-points 0.033333335 + :hit-small 102400.0 + :hit-big 131072.0 + :hit-deadly 286720.0 + :impact-damage-factor 1.0 + :section-count 4 + :section-array (new 'static 'inline-array vehicle-section-info 4 + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x200 #x20 #x2) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x400 #x40 #x4) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x800 #x80 #x8) + :damage-seg-count 3 + ) + (new 'static 'vehicle-section-info + :damage-seg-array (new 'static 'array uint64 3 #x1000 #x100 #x10) + :damage-seg-count 3 + ) + ) + ) + :physics-model (new 'static 'vehicle-physics-model-info + :lift-thruster-count 2 + :roll-thruster-count 2 + :stabilizer-count 4 + :inv-lift-thruster-count 0.5 + :lift-thruster-array (new 'static 'inline-array vehicle-attach-point 4 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 8192.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -12288.0 :w 1.0) + :rot (new 'static 'vector :y -1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :roll-thruster-array (new 'static 'inline-array vehicle-attach-point 2 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x 6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 0.3 :y -0.6 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :x -6963.2 :y 2867.2 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x -0.3 :y -0.6 :w 1.0) + ) + ) + :stabilizer-array (new 'static 'inline-array vehicle-attach-point 6 + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z 6144.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 0.5) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -2048.0 :w 1.0) + :rot (new 'static 'vector :x 1.0 :w 2.0) + ) + (new 'static 'vehicle-attach-point + :local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :rot (new 'static 'vector :y 1.0 :w 1.0) + ) + (new 'static 'vehicle-attach-point) + (new 'static 'vehicle-attach-point) + ) + :engine-thrust-local-pos (new 'static 'vector :y 2048.0 :z -7782.4 :w 1.0) + :brake-local-pos (new 'static 'vector :y 2048.0 :z -10240.0 :w 1.0) + :wheel-count 4 + :drive-wheel-count 2 + :front-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + :rear-wheel (new 'static 'vehicle-wheel-info + :local-pos (new 'static 'vector :w 1.0) + :inertia 1.0 + :radius 4096.0 + :scale 1.0 + :travel 2048.0 + :width 4096.0 + :suspension-spring 0.5 + :suspension-damping 0.5 + :forward-grip 1.0 + :side-grip 1.0 + :max-brake-torque 1.0 + :settle-pos 0.8 + :probe-radius 409.6 + :tread-texture "common-white" + ) + ) + :setup (new 'static 'vehicle-setup-info + :settle-height 6144.0 + :shadow-bot-clip -40960.0 + :shadow-locus-dist 409600.0 + :color-option-count 1 + :color (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + :gun-yaw-min -65536.0 + :gun-yaw-max 65536.0 + :gun-pitch-min -16384.0 + :gun-pitch-max 16384.0 + ) + :rider (new 'static 'vehicle-rider-info + :seat-count 3 + :rider-stance #x1 + :grab-rail-count 6 + :grab-rail-array (new 'static 'inline-array vehicle-grab-rail-info 6 + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 3686.4 :y 409.6 :z 24576.0 :w 1.0) + (new 'static 'vector :x 3276.8 :y 409.6 :z 25395.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -3276.8 :y 409.6 :z 25395.2 :w 1.0) + (new 'static 'vector :x -3686.4 :y 409.6 :z 24576.0 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x 8601.6 :z -409.6 :w 1.0) + (new 'static 'vector :x 8601.6 :y -409.6 :z 2867.2 :w 1.0) + ) + :normal (new 'static 'vector :x 1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -8601.6 :y -409.6 :z 2867.2 :w 1.0) + (new 'static 'vector :x -8601.6 :z -409.6 :w 1.0) + ) + :normal (new 'static 'vector :x -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + (new 'static 'vector :x 10240.0 :y -409.6 :z -13926.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + (new 'static 'vehicle-grab-rail-info + :local-pos (new 'static 'inline-array vector 2 + (new 'static 'vector :x -10240.0 :y -409.6 :z -13926.4 :w 1.0) + (new 'static 'vector :y -409.6 :z -15974.4 :w 1.0) + ) + :normal (new 'static 'vector :z -1.0 :w 1.0) + ) + ) + :seat-array (new 'static 'inline-array vehicle-seat-info 4 + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x 5120.0 :y 819.2 :z 2457.6 :w (the-as float #x10000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :x -5120.0 :y 819.2 :z 2457.6 :w (the-as float #x20000)) + ) + (new 'static 'vehicle-seat-info + :position (new 'static 'vector :y 3686.4 :z -8192.0 :w (the-as float #x40000)) + ) + (new 'static 'vehicle-seat-info) + ) + :rider-hand-offset (new 'static 'inline-array vector 2 + (new 'static 'vector :x 1351.68 :y 2048.0 :w 1.0) + (new 'static 'vector :x -1351.68 :y 2048.0 :w 1.0) + ) + :attach-point-array #f + ) + :explosion #f + :explosion-part #xdb + :debris #f + ) + ) + +;; definition of type h-warf +(deftype h-warf (hvehicle) + ((minalt float) + (curalt float) + (maxalt float) + (forward vector :inline) + (langvel vector :inline) + (rollerr float) + (pitcherr float) + (straighterr float) + (alterr float) + (rolling symbol) + (speed float) + (poierr float) + (poipos float) + (poivel float) + (bigshotcount int8) + (deathspin symbol) + (deathrot vector :inline) + (birth time-frame) + (stop-time time-frame) + (bounce-state? symbol) + (bounce-angle float) + (fire-time time-frame 4) + (l1-fire-time time-frame) + (l1-recharge-time time-frame) + (snd-cmd-time time-frame) + (damage-loop sound-id) + (damage-loop-playing? symbol) + (damage-loop-index uint8) + (engine-sound sound-id) + (engine-boost-sound sound-id) + (wind-noise-sound sound-id) + (wind-noise-playing? symbol) + (track-obj handle) + (track-joint int8) + (wind float) + ) + (:methods + (h-warf-method-162 (_type_ time-frame) symbol) + (h-warf-method-163 (_type_ vector) float) + (draw-thrusters (_type_ float vector vector) none) + ) + ) + +;; definition for method 3 of type h-warf +(defmethod inspect ((this h-warf)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hvehicle inspect))) + (t9-0 this) + ) + (format #t "~2Tminalt: ~f~%" (-> this minalt)) + (format #t "~2Tcuralt: ~f~%" (-> this curalt)) + (format #t "~2Tmaxalt: ~f~%" (-> this maxalt)) + (format #t "~2Tforward: #~%" (-> this forward)) + (format #t "~2Tlangvel: #~%" (-> this langvel)) + (format #t "~2Trollerr: ~f~%" (-> this rollerr)) + (format #t "~2Tpitcherr: ~f~%" (-> this pitcherr)) + (format #t "~2Tstraighterr: ~f~%" (-> this straighterr)) + (format #t "~2Talterr: ~f~%" (-> this alterr)) + (format #t "~2Trolling: ~A~%" (-> this rolling)) + (format #t "~2Tspeed: ~f~%" (-> this speed)) + (format #t "~2Tpoierr: ~f~%" (-> this poierr)) + (format #t "~2Tpoipos: ~f~%" (-> this poipos)) + (format #t "~2Tpoivel: ~f~%" (-> this poivel)) + (format #t "~2Tbigshotcount: ~D~%" (-> this bigshotcount)) + (format #t "~2Tdeathspin: ~A~%" (-> this deathspin)) + (format #t "~2Tdeathrot: #~%" (-> this deathrot)) + (format #t "~2Tbirth: ~D~%" (-> this birth)) + (format #t "~2Tstop-time: ~D~%" (-> this stop-time)) + (format #t "~2Tbounce-state?: ~A~%" (-> this bounce-state?)) + (format #t "~2Tbounce-angle: ~f~%" (-> this bounce-angle)) + (format #t "~2Tfire-time[4] @ #x~X~%" (-> this fire-time)) + (format #t "~2Tl1-fire-time: ~D~%" (-> this l1-fire-time)) + (format #t "~2Tl1-recharge-time: ~D~%" (-> this l1-recharge-time)) + (format #t "~2Tsnd-cmd-time: ~D~%" (-> this snd-cmd-time)) + (format #t "~2Tdamage-loop: ~D~%" (-> this damage-loop)) + (format #t "~2Tdamage-loop-playing?: ~A~%" (-> this damage-loop-playing?)) + (format #t "~2Tdamage-loop-index: ~D~%" (-> this damage-loop-index)) + (format #t "~2Tengine-sound: ~D~%" (-> this engine-sound)) + (format #t "~2Tengine-boost-sound: ~D~%" (-> this engine-boost-sound)) + (format #t "~2Twind-noise-sound: ~D~%" (-> this wind-noise-sound)) + (format #t "~2Twind-noise-playing?: ~A~%" (-> this wind-noise-playing?)) + (format #t "~2Ttrack-obj: ~D~%" (-> this track-obj)) + (format #t "~2Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~2Twind: ~f~%" (-> this wind)) + (label cfg-4) + this + ) + +;; definition for method 7 of type h-warf +(defmethod relocate ((this h-warf) (offset int)) + (call-parent-method this offset) + ) + +;; definition for function impact-reduction +(defun impact-reduction ((arg0 int)) + (fmax 0.0 (fmin 1.0 (* 0.0026666669 (the float (+ (- -90 arg0) (current-time)))))) + ) + +;; definition for function steer-attenuation +(defun steer-attenuation ((arg0 int)) + 0.0 + (let ((f0-2 (- 1.0 (fmax 0.0 (fmin 1.0 (* 0.0033333334 (the float (+ (- -90 arg0) (current-time))))))))) + (* f0-2 f0-2) + ) + ) + +;; definition of type warf-asc +(deftype warf-asc (structure) + ((asc float) + (des float) + ) + ) + +;; definition for method 3 of type warf-asc +(defmethod inspect ((this warf-asc)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'warf-asc) + (format #t "~1Tasc: ~f~%" (-> this asc)) + (format #t "~1Tdes: ~f~%" (-> this des)) + (label cfg-4) + this + ) + +;; definition for function ascention-atten! +(defun ascention-atten! ((arg0 float)) + (let ((v0-0 (new 'static 'vector))) + 0.0 + (cond + ((< arg0 1286144.0) + (set! (-> v0-0 x) 1.0) + (set! (-> v0-0 y) 0.0) + ) + ((< arg0 1331200.0) + (let ((f0-6 (- 1.0 (* 0.000022194603 (- 1331200.0 arg0))))) + (set! (-> v0-0 x) (+ 1.0 (* 0.0 f0-6))) + (set! (-> v0-0 y) (* 0.7 f0-6)) + ) + ) + ((< arg0 1351680.0) + (let ((f0-10 (- 1.0 (* 0.000048828126 (- 1351680.0 arg0))))) + (set! (-> v0-0 x) (+ 1.0 (* 0.0 f0-10))) + (set! (-> v0-0 y) (+ 0.7 (* 0.3 f0-10))) + ) + ) + ((< arg0 1638400.0) + (let ((f0-15 (- 1.0 (* 0.0000034877232 (- 1638400.0 arg0))))) + (set! (-> v0-0 x) (+ 1.0 (* -0.5 f0-15))) + (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-15))) + ) + ) + ((< arg0 1761280.0) + (let ((f0-20 (- 1.0 (* 0.000008138021 (- 1761280.0 arg0))))) + (set! (-> v0-0 x) (+ 0.5 (* -0.5 f0-20))) + (set! (-> v0-0 y) (+ 1.0 (* 0.0 f0-20))) + ) + ) + (else + (set! (-> v0-0 x) 0.0) + (set! (-> v0-0 y) 1.0) + ) + ) + v0-0 + ) + ) + +;; definition for method 34 of type h-warf +;; WARN: Return type mismatch int vs none. +(defmethod init-collision! ((this h-warf)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate vehicle)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 7) 0))) + (set! (-> s5-0 total-prims) (the-as uint 8)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 26624.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-11 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 1)))) + (set! (-> v1-11 prim-core action) (collide-action solid)) + (set! (-> v1-11 transform-index) 0) + (set-vector! (-> v1-11 local-sphere) 4096.0 1228.8 9011.2 6144.0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 4)))) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set! (-> v1-13 transform-index) 0) + (set-vector! (-> v1-13 local-sphere) -4096.0 1228.8 9011.2 6144.0) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core action) (collide-action solid nav-sphere)) + (set! (-> v1-15 transform-index) 0) + (set-vector! (-> v1-15 local-sphere) 0.0 2048.0 -409.6 6144.0) + (set! (-> v1-15 nav-radius) 24576.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 10)))) + (set! (-> v1-17 prim-core action) (collide-action solid)) + (set! (-> v1-17 transform-index) 0) + (set-vector! (-> v1-17 local-sphere) 0.0 4096.0 -10240.0 8192.0) + ) + (let ((v1-19 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 2)))) + (set! (-> v1-19 prim-core action) (collide-action solid)) + (set! (-> v1-19 transform-index) 0) + (set-vector! (-> v1-19 local-sphere) 10240.0 2048.0 -8192.0 6144.0) + ) + (let ((v1-21 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 8)))) + (set! (-> v1-21 prim-core action) (collide-action solid)) + (set! (-> v1-21 transform-index) 0) + (set-vector! (-> v1-21 local-sphere) -10240.0 2048.0 -8192.0 6144.0) + ) + (let ((v1-23 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-23 prim-core action) (collide-action solid rideable)) + (set! (-> v1-23 transform-index) 3) + (set-vector! (-> v1-23 local-sphere) 0.0 0.0 0.0 26624.0) + ) + (set! (-> s5-0 nav-radius) 20480.0) + (let ((v1-25 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-25 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-25 prim-core collide-with)) + ) + (set! (-> s5-0 nav-flags) (nav-flags has-child-spheres)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 162 of type h-warf +(defmethod h-warf-method-162 ((this h-warf) (arg0 time-frame)) + (let ((a3-0 0) + (v1-0 -1) + ) + (dotimes (a2-0 4) + (when (< a3-0 (- (current-time) (-> this fire-time a2-0))) + (set! a3-0 (the-as int (- (current-time) (-> this fire-time a2-0)))) + (set! v1-0 a2-0) + ) + ) + (when (and (>= v1-0 0) (time-elapsed? (-> this fire-time v1-0) arg0)) + (set-time! (-> this fire-time v1-0)) + (return #t) + ) + ) + #f + ) + +;; definition for method 91 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod control-hook-player ((this h-warf)) + (local-vars (sv-1040 vector)) + (b! (focus-test? *target* dead grabbed) cfg-39 :delay (nop!)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (matrix-rotate-y! s5-0 (* 182.04445 (seconds-per-frame) (* 180.0 (-> this controls steering)))) + (vector-rotate*! (-> this forward) (-> this forward) s5-0) + ) + (call-parent-method this) + (when (and (cpad-pressed? 0 r1) (h-warf-method-162 this (seconds 1))) + (let ((s3-0 (-> this node-list data 0 bone transform)) + (s4-0 (new 'stack-no-clear 'vector)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-1 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (set-vector! s2-0 0.0 7372.8 10649.6 1.0) + (vector-matrix*! s4-0 s2-0 s3-0) + (sound-play "hellcat-fire") + (set! (-> s5-1 ent) (-> this entity)) + (set! (-> s5-1 charge) 1.0) + (set! (-> s5-1 options) (projectile-options po13)) + (logclear! (-> s5-1 options) (projectile-options po14 po15 po16)) + (set! (-> s5-1 pos quad) (-> s4-0 quad)) + (set! (-> s5-1 notify-handle) (the-as handle #f)) + (set! (-> s5-1 owner-handle) (process->handle *target*)) + (set! (-> s5-1 target-handle) (the-as handle #f)) + (set! (-> s5-1 target-pos quad) (the-as uint128 0)) + (set! (-> s5-1 ignore-handle) (process->handle (send-event this 'get-vehicle))) + (let* ((v1-33 *game-info*) + (a0-26 (+ (-> v1-33 attack-id) 1)) + ) + (set! (-> v1-33 attack-id) a0-26) + (set! (-> s5-1 attack-id) a0-26) + ) + (set! (-> s5-1 timeout) (seconds 4)) + (set-vector! s2-0 0.0 0.0 4096000.0 1.0) + (vector-rotate*! (-> s5-1 vel) s2-0 s3-0) + (vector+! (-> s5-1 vel) (-> s5-1 vel) (-> this rbody lin-velocity)) + (let ((s1-1 (new 'stack 'boxed-array collide-shape 128)) + (s0-1 (new 'stack-no-clear 'vector)) + ) + (set! sv-1040 (new 'stack-no-clear 'vector)) + 0 + (set-vector! s2-0 0.0 0.0 204800.0 1.0) + (vector-matrix*! s0-1 s2-0 s3-0) + (set-vector! s2-0 0.0 0.0 1658880.0 1.0) + (vector-rotate*! sv-1040 s2-0 s3-0) + (set! (-> s0-1 w) 32768.0) + (set! (-> sv-1040 w) 32768.0) + (set! (-> s1-1 length) (fill-actor-list-for-sphere + *actor-hash* + s0-1 + sv-1040 + (-> sv-1040 w) + (the-as (pointer collide-shape) (-> s1-1 data)) + (-> s1-1 allocated-length) + -1 + ) + ) + (let ((a0-41 (find-nearest-focusable + (the-as (array collide-shape) s1-1) + s0-1 + 1658880.0 + (search-info-flag prefer-angle cull-angle-simple) + (search-info-flag) + (-> s3-0 fvec) + s4-0 + 10922.667 + ) + ) + ) + (when a0-41 + (vector-! (-> s5-1 vel) (get-trans a0-41 3) (-> s5-1 pos)) + (vector-normalize! (-> s5-1 vel) 4096000.0) + ) + ) + ) + (spawn-projectile gun-warf-shot s5-1 this *default-dead-pool*) + ) + 0 + ) + (when (and (time-elapsed? (-> this l1-recharge-time) (seconds 20)) (< (-> this bigshotcount) 8)) + (set-time! (-> this l1-recharge-time)) + (+! (-> this bigshotcount) 1) + (factory-shotsleft (-> this bigshotcount)) + ) + (when (and (> (-> this bigshotcount) 0) (cpad-pressed? 0 l1) (time-elapsed? (-> this l1-fire-time) (seconds 2))) + (set-time! (-> this l1-fire-time)) + (let ((s4-3 (-> this node-list data 0 bone transform))) + (let ((s2-1 (new 'stack-no-clear 'vector)) + (s3-1 (new 'stack-no-clear 'vector)) + (s5-2 (new 'stack-no-clear 'projectile-init-by-other-params)) + ) + (set-vector! s3-1 0.0 7372.8 18841.6 1.0) + (vector-matrix*! s2-1 s3-1 s4-3) + (set! (-> s5-2 ent) (-> this entity)) + (set! (-> s5-2 charge) 1.0) + (set! (-> s5-2 options) (projectile-options)) + (logclear! (-> s5-2 options) (projectile-options po14 po15 po16)) + (set! (-> s5-2 pos quad) (-> s2-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 handle #f)) + (set! (-> s5-2 target-pos quad) (the-as uint128 0)) + (set! (-> s5-2 ignore-handle) (process->handle (send-event this 'get-vehicle))) + (let* ((v1-90 *game-info*) + (a0-63 (+ (-> v1-90 attack-id) 1)) + ) + (set! (-> v1-90 attack-id) a0-63) + (set! (-> s5-2 attack-id) a0-63) + ) + (set! (-> s5-2 timeout) (seconds 10)) + (set! (-> s5-2 damage) 64.0) + (logior! (-> s5-2 options) (projectile-options po14)) + (set-vector! s3-1 0.0 0.0 819200.0 1.0) + (vector-rotate*! (-> s5-2 vel) s3-1 s4-3) + (vector+! (-> s5-2 vel) (-> s5-2 vel) (-> this rbody lin-velocity)) + (sound-play "hellcat-firealt") + (spawn-projectile warf-projectile s5-2 this *default-dead-pool*) + ) + ) + (+! (-> this bigshotcount) -1) + (factory-shotsleft (-> this bigshotcount)) + ) + (label cfg-39) + 0 + (none) + ) + +;; definition for method 79 of type h-warf +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-79 ((this h-warf)) + 0 + (none) + ) + +;; definition for method 106 of type h-warf +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-106 ((this h-warf)) + (let ((t9-0 (method-of-type hvehicle vehicle-method-106))) + (t9-0 this) + ) + (when (-> this damage-loop-playing?) + (sound-stop (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #f) + (set! (-> this damage-loop-index) (the-as uint 0)) + 0 + ) + (when (nonzero? (-> this wind-noise-sound)) + (sound-stop (-> this wind-noise-sound)) + (set! (-> this wind-noise-playing?) #f) + (set! (-> this wind-noise-sound) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> this engine-sound)) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound) (new 'static 'sound-id)) + 0 + ) + (when (nonzero? (-> this engine-boost-sound)) + (sound-stop (-> this engine-boost-sound)) + (set! (-> this engine-boost-sound) (new 'static 'sound-id)) + 0 + ) + (none) + ) + +;; definition for method 38 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod rigid-body-object-method-38 ((this h-warf)) + (let ((t9-0 (method-of-type hvehicle rigid-body-object-method-38))) + (t9-0 this) + ) + 0.0 + (let ((f0-2 (+ 1.0 (fmax 0.0 (fmin 1.0 (* 0.0000024414062 (-> this speed))))))) + (sound-play-by-name + (static-sound-name "hellcat-engine") + (-> this engine-sound) + 1024 + (the int (* 1524.0 f0-2)) + 0 + (sound-group) + (-> this root trans) + ) + ) + (sound-play-by-name + (static-sound-name "hellcat-boost") + (-> this engine-boost-sound) + (the int (* 1024.0 (-> this engine-thrust))) + 1524 + 0 + (sound-group) + (-> this root trans) + ) + 0.0 + (let ((v1-11 (new 'stack-no-clear 'vector))) + (set! (-> v1-11 quad) (-> this rbody ang-velocity quad)) + (let ((f0-10 (* 0.25 (fabs (-> v1-11 y))))) + (set! (-> v1-11 y) 0.0) + (let* ((f0-11 (+ f0-10 (vector-length v1-11))) + (f0-13 (fmax 0.0 (fmin 1.0 f0-11))) + ) + (seek! (-> this wind) f0-13 (* 2.0 (seconds-per-frame))) + ) + ) + ) + (cond + (#f + (when (-> this wind-noise-playing?) + (sound-stop (-> this wind-noise-sound)) + (set! (-> this wind-noise-playing?) #f) + ) + ) + (else + (sound-play-by-name + (static-sound-name "hellcat-bank") + (-> this wind-noise-sound) + (the int (* 1024.0 (-> this wind))) + (the int (* 1524.0 (+ 0.7 (* 0.25 (-> this wind))))) + 0 + (sound-group) + (-> this root trans) + ) + (set! (-> this wind-noise-playing?) #t) + ) + ) + (when (time-elapsed? (-> this snd-cmd-time) (seconds 2)) + (set-time! (-> this snd-cmd-time)) + (cond + ((< (-> this hit-points) 0.15) + (if (!= (-> this damage-loop-index) 3) + (sound-stop (-> this damage-loop)) + ) + (sound-play "damage-high" :id (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #t) + (set! (-> this damage-loop-index) (the-as uint 3)) + ) + ((< (-> this hit-points) 0.2) + (if (!= (-> this damage-loop-index) 2) + (sound-stop (-> this damage-loop)) + ) + (sound-play "damage-med" :id (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #t) + (set! (-> this damage-loop-index) (the-as uint 2)) + ) + ((< (-> this hit-points) 0.5) + (if (!= (-> this damage-loop-index) 1) + (sound-stop (-> this damage-loop)) + ) + (sound-play "damage-low" :id (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #t) + (set! (-> this damage-loop-index) (the-as uint 1)) + ) + ((and (-> this damage-loop-playing?) (< 0.5 (-> this hit-points))) + (sound-stop (-> this damage-loop)) + (set! (-> this damage-loop-playing?) #f) + (set! (-> this damage-loop-index) (the-as uint 0)) + 0 + ) + ) + ) + (none) + ) + +;; definition for method 35 of type h-warf +;; WARN: Return type mismatch int vs none. +(defmethod init-rbody-control! ((this h-warf)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-h-warf" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (alloc-rbody-control! this *h-warf-constants*) + (vector-reset! (-> this deathrot)) + (set-time! (-> this birth)) + (set-time! (-> this stop-time)) + (set! (-> this deathspin) #f) + (set! (-> this rbody angular-damping) 0.97) + (set-vector! (-> this forward) 0.0 0.0 1.0 1.0) + (set! (-> this bigshotcount) 8) + (factory-shotsleft (-> this bigshotcount)) + (set! (-> this minalt) 1288192.0) + (set! (-> this maxalt) 1966080.0) + (set! (-> this curalt) (-> this minalt)) + (set! (-> this rollerr) 0.0) + (set! (-> this alterr) 0.0) + (set! (-> this pitcherr) 0.0) + (set! (-> this straighterr) 0.0) + (set! (-> this rolling) #f) + (set! (-> this speed) 0.0) + (set! (-> this poierr) 0.0) + (set! (-> this poipos) 0.0) + (set! (-> this poivel) 0.0) + (set! (-> this bounce-state?) #f) + (set! (-> this bounce-angle) 0.0) + (set! (-> this wind) 0.0) + (set! (-> this engine-sound) (new-sound-id)) + (set! (-> this engine-boost-sound) (new-sound-id)) + (set! (-> this wind-noise-sound) (new-sound-id)) + (set! (-> this wind-noise-playing?) #f) + (set! (-> this damage-loop) (new-sound-id)) + (set! (-> this damage-loop-playing?) #f) + (set! (-> this damage-loop-index) (the-as uint 0)) + (set-time! (-> this snd-cmd-time)) + (dotimes (v1-18 4) + (set! (-> this fire-time v1-18) (+ (current-time) (seconds -4))) + ) + (set-time! (-> this l1-fire-time)) + (set-time! (-> this l1-recharge-time)) + (set! *war-factory-vehicle-mask* (-> this draw seg-mask)) + (set! *war-factory-effects-mask* (-> this draw effect-mask)) + 0 + (none) + ) + +;; definition for method 46 of type h-warf +(defmethod apply-damage ((this h-warf) (arg0 float) (arg1 rigid-body-impact)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 178 (seconds 0.25)) + (let ((s4-0 0.4)) + (set! *war-factory-vehicle-mask* (-> this draw seg-mask)) + (set! *war-factory-effects-mask* (-> this draw effect-mask)) + (call-parent-method this s4-0 arg1) + ) + (none) + ) + +;; definition for method 48 of type h-warf +;; WARN: Return type mismatch vehicle-flag vs none. +(defmethod on-impact ((this h-warf) (arg0 rigid-body-impact)) + (call-parent-method this arg0) + (set! (-> this bounce-state?) #t) + (set! (-> this bounce-angle) 0.0) + (when (< (-> this speed) 2048.0) + (if (time-elapsed? (-> this stop-time) (seconds 1)) + (set-time! (-> this stop-time)) + ) + (when (time-elapsed? (-> this stop-time) (seconds 0.5)) + (set! (-> this hit-points) -1.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + ) + ) + (none) + ) + +;; definition for method 97 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-97 ((this h-warf) (arg0 float) (arg1 vehicle-physics-work)) + (local-vars (v1-107 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s3-0 (-> this rbody))) + (mem-copy! (the-as pointer (-> arg1 mat)) (the-as pointer (-> s3-0 matrix)) 64) + (let* ((f28-0 (* -1.0 (-> this controls steering) (-> this info handling tire-steering-angle))) + (f30-0 (cos f28-0)) + (f0-2 (sin f28-0)) + ) + (set! (-> arg1 steering-axis x) f30-0) + (set! (-> arg1 steering-axis y) 0.0) + (set! (-> arg1 steering-axis z) f0-2) + ) + (vector-rotate*! (-> arg1 steering-axis) (-> arg1 steering-axis) (-> arg1 mat)) + (logior! (-> this v-flags) (vehicle-flag in-air)) + (logclear! (-> this v-flags) (vehicle-flag on-ground on-flight-level)) + (vector-reset! (-> arg1 ground-normal)) + (set! (-> arg1 ground-normal y) 1.0) + (let ((f30-1 (-> this info handling ground-probe-distance))) + (let ((s2-0 (new 'stack-no-clear 'collide-query))) + (vector-reset! (-> arg1 lift-dir)) + (set! (-> arg1 lift-dir y) -1.0) + (set! (-> arg1 speed-factor) + (fmax 0.0 (fmin 0.9 (* 0.000008138021 (+ -40960.0 (vector-length (-> s3-0 lin-velocity)))))) + ) + (when (logtest? (-> this info flags) 1) + (vector-float*! (-> arg1 tmp) (-> arg1 mat uvec) -1.0) + (let ((t9-4 vector-lerp!) + (a0-7 (-> arg1 lift-dir)) + (a1-4 (-> arg1 lift-dir)) + (a2-3 (-> arg1 tmp)) + (f0-8 (-> arg1 speed-factor)) + ) + (t9-4 a0-7 a1-4 a2-3 (* f0-8 f0-8)) + ) + (vector-normalize! (-> arg1 lift-dir) 1.0) + ) + (vector-float*! (-> s2-0 move-dist) (-> arg1 lift-dir) (the-as float f30-1)) + (let ((v1-26 s2-0)) + (set! (-> v1-26 radius) 409.6) + (set! (-> v1-26 collide-with) (collide-spec + backgnd + bot + obstacle + hit-by-player-list + hit-by-others-list + player-list + water + collectable + blocking-plane + pusher + vehicle-mesh-probeable + shield + vehicle-sphere-no-probe + ) + ) + (set! (-> v1-26 ignore-process0) #f) + (set! (-> v1-26 ignore-process1) #f) + (set! (-> v1-26 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nopilot #x1)) + (set! (-> v1-26 action-mask) (collide-action solid)) + ) + (dotimes (s1-0 (-> this info physics-model lift-thruster-count)) + (let ((v1-29 (-> this info physics-model lift-thruster-array s1-0)) + (s0-0 (-> arg1 probe-work-array s1-0)) + ) + (vector-reset! (-> s0-0 tire-force)) + (set! (-> s0-0 local-pos quad) (-> v1-29 local-pos quad)) + (set! (-> s0-0 local-normal quad) (-> v1-29 rot quad)) + (vector-matrix*! (-> s0-0 world-pos) (-> s0-0 local-pos) (-> arg1 mat)) + (let ((a1-9 (-> s0-0 probe-pos))) + (let ((v1-32 (-> s0-0 world-pos))) + (let ((a0-22 (-> arg1 mat uvec))) + (let ((a2-6 (-> this info handling ground-probe-offset))) + (.mov vf7 a2-6) + ) + (.lvf vf5 (&-> a0-22 quad)) + ) + (.lvf vf4 (&-> v1-32 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-9 quad) vf6) + ) + (rigid-body-control-method-23 s3-0 (-> s0-0 probe-pos) (-> s0-0 velocity)) + (set! (-> s0-0 wheel-axis quad) (-> (the-as vector (if (< 0.0 (-> s0-0 local-pos z)) + (-> arg1 steering-axis) + (the-as vector (-> arg1 mat)) + ) + ) + quad + ) + ) + (set! (-> s0-0 ground-pos quad) (-> s0-0 probe-pos quad)) + (set! (-> s0-0 ground-pos y) 0.0) + (vector-reset! (-> s0-0 ground-normal)) + (when (logtest? (-> this v-flags) (vehicle-flag enable-collision)) + (set! (-> s2-0 start-pos quad) (-> s0-0 probe-pos quad)) + (let ((f0-15 (probe-using-line-sphere *collide-cache* s2-0))) + (cond + ((and (>= f0-15 0.0) (!= (-> s2-0 best-other-tri pat mode) 1)) + (logclear! (-> this v-flags) (vehicle-flag in-air)) + (logior! (-> this v-flags) (vehicle-flag on-ground)) + (set! (-> s0-0 ground-pos y) (- (-> s0-0 probe-pos y) (* f0-15 f30-1))) + (set! (-> s0-0 ground-normal quad) (-> s2-0 best-other-tri normal quad)) + (set! (-> arg1 ground-normal quad) (-> s0-0 ground-normal quad)) + ) + (else + (set! (-> s0-0 ground-pos y) (+ -81920.0 (-> s3-0 position y))) + ) + ) + ) + 0 + ) + ) + ) + ) + (set! (-> this lift-thrust 0) 0.0) + (set! (-> this lift-thrust 1) 0.0) + (set! (-> this lift-thrust 2) 0.0) + (set! (-> this lift-thrust 3) 0.0) + (set! (-> this roll-thrust 0) 0.0) + (set! (-> this roll-thrust 1) 0.0) + (when (>= 1 (-> this force-level)) + (dotimes (s2-1 (-> this info physics-model lift-thruster-count)) + (let ((s1-1 (-> arg1 probe-work-array s2-1))) + (set! (-> arg1 world-pos quad) (-> s1-1 world-pos quad)) + (set! (-> arg1 velocity quad) (-> s1-1 velocity quad)) + (let* ((f1-12 (fmax 4096.0 (fmin (- (-> s1-1 probe-pos y) (-> s1-1 ground-pos y)) f30-1))) + (f28-1 (- 1.0 (/ (+ -4096.0 f1-12) (+ -4096.0 f30-1)))) + ) + (if (>= (-> this info handling cos-ground-effect-angle) (vector-dot (-> s1-1 ground-normal) (-> arg1 mat uvec))) + (set! f28-1 0.0) + ) + (set! (-> arg1 tmp y) 0.0) + (set! (-> arg1 tmp x) (-> arg1 velocity z)) + (set! (-> arg1 tmp z) (- (-> arg1 velocity x))) + (vector-normalize! (-> arg1 tmp) 1.0) + (vector+float*! + (-> arg1 normal) + (-> s1-1 ground-normal) + (-> arg1 tmp) + (- (vector-dot (-> s1-1 ground-normal) (-> arg1 tmp))) + ) + (let ((v1-80 (-> arg1 force)) + (a0-45 (-> arg1 normal)) + (f0-37 (* 2.0 f28-1)) + (f1-17 arg0) + ) + (vector-float*! v1-80 a0-45 (* f0-37 + (/ 1.0 f1-17) + (-> this info physics-model inv-lift-thruster-count) + (-> this info info mass) + (fmax 0.0 (- (vector-dot (-> arg1 velocity) (-> arg1 normal)))) + ) + ) + ) + (apply-impact! s3-0 (-> arg1 world-pos) (-> arg1 force)) + (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) + (let ((f0-51 (* 8.0 + (-> this info info mass) + (-> this info extra gravity) + (-> this info physics-model inv-lift-thruster-count) + (+ (* (-> this info handling spring-lift-factor) f28-1) + (* 0.75 (-> this jump-thrust) (-> this info handling jump-thrust-factor)) + ) + (- (+ 1.0 (* 2.0 (rand-vu) (-> this power-fluctuation-factor))) (-> this power-fluctuation-factor)) + ) + ) + ) + (+! (-> this lift-thrust s2-1) f0-51) + (vector-float*! (-> arg1 force) (-> arg1 lift-dir) (* -1.0 f0-51)) + ) + ) + (apply-impact! s3-0 (-> arg1 world-pos) (-> arg1 force)) + (vector+! (-> s1-1 tire-force) (-> s1-1 tire-force) (-> arg1 force)) + (when (and (< 0.0 (-> this info handling tire-friction-factor)) (let ((f0-54 0.0)) + (.lvf vf1 (&-> (-> s1-1 ground-normal) 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-107 vf1) + (< f0-54 v1-107) + ) + ) + (vector+float*! + (-> arg1 normal) + (-> s1-1 wheel-axis) + (-> s1-1 ground-normal) + (- (vector-dot (-> s1-1 wheel-axis) (-> s1-1 ground-normal))) + ) + (vector-normalize! (-> arg1 normal) 1.0) + (set! (-> arg1 world-pos quad) (-> s3-0 position quad)) + (set! (-> arg1 velocity quad) (-> s3-0 lin-velocity quad)) + (vector-! (-> arg1 p-body) (-> arg1 world-pos) (-> s3-0 position)) + (vector-cross! (-> arg1 tmp) (-> arg1 p-body) (-> arg1 normal)) + (vector-rotate*! (-> arg1 tmp) (-> arg1 tmp) (-> s3-0 inv-i-world)) + (vector-cross! (-> arg1 tmp) (-> arg1 tmp) (-> arg1 p-body)) + (set! (-> arg1 vel-dot-norm) (vector-dot (-> arg1 velocity) (-> arg1 normal))) + (let ((f0-61 (fabs (-> arg1 vel-dot-norm)))) + (set! (-> arg1 friction-coef) + (smooth-interp + (-> this info handling tire-static-friction) + (-> this info handling tire-dynamic-friction) + f0-61 + (-> this info handling tire-static-friction-speed) + (-> this info handling tire-dynamic-friction-speed) + ) + ) + ) + (set! (-> arg1 friction-coef) + (* (-> arg1 friction-coef) (+ 1.0 (* -0.75 (fmax 0.0 (fmin 1.0 (-> this engine-thrust)))))) + ) + (let ((f0-69 (* (-> arg1 friction-coef) + (-> this info handling tire-friction-factor) + (fmax 0.0 (vector-dot (-> s1-1 ground-normal) (-> s1-1 tire-force))) + ) + ) + ) + (set! (-> arg1 impulse) (/ (* -1.0 (-> arg1 vel-dot-norm)) + (* arg0 (+ (-> s3-0 info inv-mass) (vector-dot (-> arg1 normal) (-> arg1 tmp)))) + ) + ) + (set! (-> arg1 impulse) (fmax (fmin (-> arg1 impulse) f0-69) (- f0-69))) + ) + (vector-float*! (-> arg1 force) (-> arg1 normal) (-> arg1 impulse)) + (apply-impact! s3-0 (-> arg1 world-pos) (-> arg1 force)) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 163 of type h-warf +;; INFO: Used lq/sq +(defmethod h-warf-method-163 ((this h-warf) (arg0 vector)) + (let ((s3-0 (new 'stack-no-clear 'matrix)) + (s1-0 (new 'stack-no-clear 'matrix)) + (s2-0 (new 'stack-no-clear 'vector)) + (s5-0 (new 'stack-no-clear 'vector)) + ) + 0.0 + (forward-up->inv-matrix s1-0 arg0 *up-vector*) + (matrix-transpose! s1-0 s1-0) + (set! (-> s2-0 quad) (-> this rbody matrix fvec quad)) + (set! (-> s2-0 y) 0.0) + (vector-normalize! s2-0 1.0) + (vector-rotate*! s2-0 s2-0 s1-0) + (let ((f0-3 (vector-dot arg0 (-> this rbody matrix fvec)))) + (if (< (-> s2-0 x) 0.0) + (- f0-3) + ) + ) + (vector-! s5-0 *h-warf-center-of-level* (-> this root trans)) + (set! (-> s5-0 x) (fabs (-> s5-0 x))) + (set! (-> s5-0 y) 0.0) + (set! (-> s5-0 z) (fabs (-> s5-0 z))) + 0.0 + (let* ((f1-1 (atan (-> s2-0 x) (- (-> s2-0 z)))) + (f30-0 (fmax -1.0 (fmin 1.0 (* 0.000030517578 f1-1)))) + ) + (matrix-transpose! s3-0 (-> this rbody matrix)) + (vector-rotate*! arg0 (-> this forward) s3-0) + (set! f30-0 (cond + ((or (< 1187840.0 (-> s5-0 x)) (< 1187840.0 (-> s5-0 z))) + (if (or (= (-> this controls steering) 0.0) + (and (< 0.0 f30-0) (< 0.0 (-> this controls steering))) + (and (< f30-0 0.0) (< (-> this controls steering) 0.0)) + ) + (set! f30-0 (fmax -1.0 (fmin 1.0 (+ f30-0 (-> this controls steering))))) + ) + f30-0 + ) + (else + (-> this controls steering) + ) + ) + ) + f30-0 + ) + ) + ) + +;; definition for function world-to-local-vec! +(defun world-to-local-vec! ((arg0 vector) (arg1 vector) (arg2 matrix)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (matrix-transpose! s4-0 arg2) + (vector-rotate*! arg0 arg1 s4-0) + ) + ) + +;; definition for method 31 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod apply-gravity! ((this h-warf) (arg0 float)) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (when (movie?) + (logior! (-> this draw status) (draw-control-status no-draw)) + (disable-physics! this) + ) + (when (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (not (time-elapsed? (-> this birth) (seconds 1)))) + (set! (-> this rbody lin-momentum quad) (-> this rbody matrix fvec quad)) + (vector-normalize! (-> this rbody lin-momentum) 204800.0) + (vector-float*! (-> this rbody lin-momentum) (-> this rbody lin-momentum) (-> this rbody info mass)) + ) + (set! (-> this rbody angular-damping) 0.97) + (when (and (logtest? (-> this v-flags) (vehicle-flag dead)) (not (-> this deathspin))) + (set! (-> this rbody angular-damping) 1.0) + (set! (-> this hit-points) -1.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + (set! (-> this deathspin) #t) + (set-vector! s3-0 4096.0 0.0 0.0 1.0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! s4-0 (-> this rbody matrix uvec) (* 4096.0 (rand-vu-float-range -40000.0 40000.0))) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (let ((s2-2 (new 'stack-no-clear 'vehicle-physics-work))) + (set! (-> s2-2 world-pos w) (steer-attenuation (the-as int (-> this impact-time)))) + (set! (-> s2-2 world-pos x) 0.0) + (when (and (< 0.0 (-> this rbody matrix uvec y)) + (and (logtest? (-> this v-flags) (vehicle-flag riding)) (not (-> this bounce-state?))) + ) + (vector-! (the-as vector (-> s2-2 mat)) (-> this root trans) *h-warf-center-of-level*) + (set! (-> s2-2 mat rvec y) 0.0) + (vector-normalize! (the-as vector (-> s2-2 mat)) 1.0) + (set! (-> s2-2 world-pos x) (h-warf-method-163 this (the-as vector (-> s2-2 mat)))) + (set! (-> s2-2 world-normal x) (-> s2-2 world-pos x)) + (vector-reset! s3-0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (+! (-> s3-0 z) 4096.0) + (set! (-> s2-2 velocity quad) (-> *x-vector* quad)) + (let ((f0-19 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) + (set! (-> s2-2 world-pos z) (/ 1.0 f0-19)) + ) + (set! (-> s2-2 world-pos z) (fmin 0.1 (-> s2-2 world-pos z))) + (set! (-> s2-2 world-pos z) (* 49152000.0 (-> s2-2 world-pos z) (-> s2-2 world-pos x))) + (vector-float*! s4-0 (-> s2-2 velocity) (-> s2-2 world-pos z)) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (when (and (logtest? (-> this v-flags) (vehicle-flag riding)) (-> this bounce-state?)) + (let ((s0-0 (new 'stack-no-clear 'vector)) + (s1-1 (new 'stack-no-clear 'vector)) + ) + (set! (-> s0-0 quad) (-> this rbody matrix rvec quad)) + (set! (-> s0-0 y) 0.0000000001) + (vector-normalize! s0-0 1.0) + (set! (-> s2-2 world-pos x) (* 0.00024414062 (vector-dot (-> this rbody lin-velocity) s0-0))) + (world-to-local-vec! s1-1 (-> this rbody lin-velocity) (-> this rbody matrix)) + (set! (-> s2-2 world-pos x) (atan2-rad (-> s1-1 x) (-> s1-1 z))) + ) + (set! (-> s2-2 world-pos y) (- (-> s2-2 world-pos x) (-> this straighterr))) + (set! (-> this straighterr) (-> s2-2 world-pos x)) + (set-vector! s3-0 40960.0 0.0 0.0 1.0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! + s4-0 + (-> this rbody matrix fvec) + (- (+ (* 4096000.0 (-> s2-2 world-pos y)) (* 409600.0 (-> s2-2 world-pos x)))) + ) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + (if (= (-> this bounce-angle) 0.0) + (set! (-> this bounce-angle) (-> s2-2 world-pos x)) + ) + (when (or (< (fabs (-> s2-2 world-pos x)) 0.01) + (and (< (-> s2-2 world-pos x) 0.0) (< 0.0 (-> this bounce-angle))) + (and (< 0.0 (-> s2-2 world-pos x)) (< (-> this bounce-angle) 0.0)) + ) + (set! (-> this bounce-state?) #f) + (set! (-> this bounce-angle) 0.0) + (set! (-> this straighterr) 0.0) + ) + ) + 0.0 + 0.0 + (let ((f0-57 (-> this speed))) + (set! (-> s2-2 world-pos z) (-> s2-2 world-normal x)) + (if (< 1.0 (-> s2-2 world-pos z)) + (set! (-> s2-2 world-pos z) 1.0) + ) + (if (< (-> s2-2 world-pos z) -1.0) + (set! (-> s2-2 world-pos z) -1.0) + ) + (let ((f0-61 (fmax 0.0 (fmin 1.0 (* 0.000012207031 (+ -20480.0 f0-57)))))) + (matrix-rotate-z! (the-as matrix (-> s2-2 mat uvec)) (* 14563.556 (-> s2-2 world-pos z) f0-61)) + ) + ) + (matrix*! (the-as matrix (-> s2-2 mat uvec)) (the-as matrix (-> s2-2 mat uvec)) (-> this rbody matrix)) + (set! (-> s2-2 world-pos x) (- (-> s2-2 mat uvec y))) + (set! (-> s2-2 world-pos y) (- (-> s2-2 world-pos x) (-> this rollerr))) + (set! (-> this rollerr) (-> s2-2 world-pos x)) + (let ((f30-1 (+ (* 32768000.0 (-> s2-2 world-pos y)) (* 1638400.0 (-> s2-2 world-pos x))))) + (set-vector! s3-0 4096.0 0.0 0.0 1.0) + 0.0 + (let ((s1-2 (new 'stack-no-clear 'matrix))) + (let ((f0-76 (* 16384.0 (fmax -1.0 (fmin 1.0 (* 0.0000000012207031 (-> this rbody ang-velocity y) (fabs f30-1)))))) + ) + (matrix-rotate-y! s1-2 f0-76) + ) + (vector-rotate*! s3-0 s3-0 s1-2) + ) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! s4-0 (-> this rbody matrix uvec) f30-1) + ) + (if (and (>= 1 (-> this force-level)) (not (-> this rolling))) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (if (>= (-> this force-level) 1) + (set! (-> this curalt) (-> this rbody matrix trans y)) + ) + (set! (-> this speed) (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix fvec))) + 0.0 + (let* ((v1-138 (-> this rbody lin-velocity)) + (f28-0 (sqrtf (+ (* (-> v1-138 x) (-> v1-138 x)) (* (-> v1-138 z) (-> v1-138 z))))) + (f30-2 (fmax 0.0 (fmin 1.0 (* 0.000030517578 (+ -4096.0 f28-0))))) + ) + (set! (-> s2-2 world-pos x) + (* f30-2 (atan (-> this rbody lin-velocity y) (vector-length (-> this rbody lin-velocity)))) + ) + (if (< 15473.777 (-> s2-2 world-pos x)) + (set! (-> s2-2 world-pos x) 15473.777) + ) + (if (< (-> s2-2 world-pos x) -15473.777) + (set! (-> s2-2 world-pos x) -15473.777) + ) + (cond + ((< (vector-dot (-> this rbody matrix fvec) (-> this rbody lin-velocity)) -16384.0) + (set! (-> s2-2 world-pos x) (- (-> s2-2 world-pos x))) + (set! (-> this curalt) + (- (-> this curalt) + (* (-> this controls lean-z) (+ (* -8192.0 (seconds-per-frame)) (* -0.1 (seconds-per-frame) f28-0))) + ) + ) + ) + (else + (+! (-> this curalt) + (* (-> this controls lean-z) (+ (* -8192.0 (seconds-per-frame)) (* -0.1 (seconds-per-frame) f28-0))) + ) + ) + ) + (when #f + (set-vector! + s4-0 + 0.0 + (* 40.96 (-> this info info mass) (- 1.0 f30-2) (- (-> this curalt) (-> this rbody matrix trans y))) + 0.0 + 1.0 + ) + (add-force! (-> this rbody) s4-0) + ) + ) + (if (< (-> this maxalt) (-> this curalt)) + (set! (-> this curalt) (-> this maxalt)) + ) + (if (< (-> this curalt) (-> this minalt)) + (set! (-> this curalt) (-> this minalt)) + ) + (matrix-rotate-x! (the-as matrix (-> s2-2 mat uvec)) (-> s2-2 world-pos x)) + (matrix*! (the-as matrix (-> s2-2 mat uvec)) (the-as matrix (-> s2-2 mat uvec)) (-> this rbody matrix)) + (set! (-> s2-2 world-pos x) (-> s2-2 mat trans y)) + (set! (-> s2-2 world-pos y) (- (-> s2-2 world-pos x) (-> this pitcherr))) + (set! (-> this pitcherr) (-> s2-2 world-pos x)) + (set-vector! s3-0 0.0 0.0 4096.0 1.0) + (vector+! s3-0 s3-0 (-> this info info cm-offset-joint)) + (vector-matrix*! s3-0 s3-0 (-> this rbody matrix)) + (vector-float*! + s4-0 + (-> this rbody matrix uvec) + (- (+ (* 196608000.0 (-> s2-2 world-pos y)) (* 16384000.0 (-> s2-2 world-pos x)))) + ) + ) + (if (and (not (-> this rolling)) + (or (logtest? (-> this v-flags) (vehicle-flag dead)) (>= 1 (-> this force-level))) + (>= (-> this speed) 0.0) + ) + (rigid-body-control-method-22 (-> this rbody) s3-0 s4-0) + ) + (when (< (-> this maxalt) (-> this rbody matrix trans y)) + (vector-float*! s4-0 *up-vector* (* -2000.0 (- (-> this rbody matrix trans y) (-> this maxalt)))) + (add-force! (-> this rbody) s4-0) + ) + (when (and (< (-> this rbody matrix trans y) (-> this minalt)) + (not (logtest? (-> this v-flags) (vehicle-flag dead))) + ) + (when (< (-> this speed) 0.0) + (set! (-> this hit-points) -1.0) + (logior! (-> this v-flags) (vehicle-flag dead)) + ) + (vector-float*! s4-0 *up-vector* (* -2000.0 (- (-> this rbody matrix trans y) (-> this minalt)))) + (add-force! (-> this rbody) s4-0) + ) + (let ((f0-134 (-> this speed))) + (let ((f1-64 (-> this controls throttle)) + (f2-21 (-> this controls brake)) + ) + 0.0 + (if (= f1-64 0.0) + (set! f2-21 0.1) + ) + (let ((f1-66 (* 3276800.0 (- f1-64 (* 4.0 f2-21))))) + (if (and (< 204800.0 f0-134) (< 0.0 f1-66)) + (set! f1-66 0.0) + ) + (if (< f0-134 153600.0) + (set! f1-66 1638400.0) + ) + (vector-float*! s4-0 (-> this rbody matrix fvec) f1-66) + ) + ) + (set! (-> s4-0 y) 0.0) + (if (and (logtest? (-> this v-flags) (vehicle-flag riding)) + (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (or (not (-> this bounce-state?)) (< 0.0 f0-134))) + ) + (add-force! (-> this rbody) s4-0) + ) + ) + (vector-float*! s4-0 (-> this rbody lin-velocity) (- (-> this info handling drag-force-factor))) + (add-force! (-> this rbody) s4-0) + (let ((s3-1 (new 'stack-no-clear 'vector))) + 0.0 + (let ((f30-3 (impact-reduction (the-as int (-> this impact-time))))) + (set! (-> s3-1 quad) (-> this rbody matrix rvec quad)) + (set! (-> s3-1 y) 0.0000000001) + (vector-normalize! s3-1 1.0) + (vector-float*! + s4-0 + (the-as vector (-> this rbody matrix)) + (* -512.0 (vector-dot (-> this rbody lin-velocity) s3-1) f30-3) + ) + ) + ) + (set! (-> s4-0 y) 0.0) + (if (and (not (logtest? (-> this v-flags) (vehicle-flag dead))) (not (-> this bounce-state?))) + (add-force! (-> this rbody) s4-0) + ) + (when #f + (vector-float*! + s4-0 + (-> this rbody matrix uvec) + (* -128.0 (vector-dot (-> this rbody lin-velocity) (-> this rbody matrix uvec))) + ) + (add-force! (-> this rbody) s4-0) + ) + (vector-reset! s4-0) + 0.0 + (let ((v1-258 (ascention-atten! (-> this root trans y))) + (f0-149 (* -15.0 (-> this controls lean-z) (-> this speed))) + ) + (let ((f1-75 1.5) + (a0-104 (-> this rbody lin-velocity)) + ) + (if (< (* f1-75 (sqrtf (+ (* (-> a0-104 x) (-> a0-104 x)) (* (-> a0-104 z) (-> a0-104 z))))) + (fabs (-> this rbody lin-velocity y)) + ) + (set! f0-149 0.0) + ) + ) + (if (< 0.0 (-> this controls lean-z)) + (set! (-> s4-0 y) (+ (* -20.0 (-> this rbody lin-velocity y)) (* f0-149 (-> v1-258 y)))) + (set! (-> s4-0 y) (+ (* -20.0 (-> this rbody lin-velocity y)) (* f0-149 (-> v1-258 x)))) + ) + ) + (when #t + (let ((s3-2 (new 'stack-no-clear 'vector)) + (s2-3 (new 'stack-no-clear 'vector)) + ) + 0.0 + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (set! (-> s3-2 quad) (-> this rbody lin-velocity quad)) + (vector-normalize! s3-2 1.0) + (let ((f0-156 (vector-dot s3-2 s4-0))) + (vector-float*! s2-3 s3-2 f0-156) + ) + (vector-! s4-0 s4-0 s2-3) + (add-force! (-> this rbody) s4-0) + (when (or (< 81920.0 (-> this speed)) (< (-> this rbody lin-velocity y) 0.0)) + (vector-float*! s4-0 *up-vector* (* -1.0 (-> this info info mass) (-> this info extra gravity))) + (let ((f0-163 (vector-dot s3-2 s4-0))) + (vector-float*! s4-0 s3-2 f0-163) + ) + (add-force! (-> this rbody) s4-0) + ) + ) + ) + ) + (when (logtest? (-> this v-flags) (vehicle-flag dead)) + (let* ((f2-39 (fmax 1.0 (* 0.00024414062 (vector-length (-> this rbody lin-velocity))))) + (f0-166 (+ -1.5 (* 50.0 (/ 1.0 f2-39)))) + ) + (if (logtest? (-> this v-flags) (vehicle-flag dead)) + (set! f0-166 2.0) + ) + (when (< 0.0 f0-166) + (vector-float*! s4-0 *up-vector* (* -1.0 (-> this info info mass) (-> this info extra gravity) f0-166)) + (add-force! (-> this rbody) s4-0) + ) + ) + ) + ) + (let ((a2-15 (new 'stack-no-clear 'vehicle-physics-work))) + (vehicle-method-97 this arg0 a2-15) + ) + 0 + (none) + ) + +;; definition for method 94 of type h-warf +(defmethod vehicle-method-94 ((this h-warf)) + ((method-of-type vehicle vehicle-method-94) this) + (none) + ) + +;; definition for method 51 of type h-warf +;; INFO: Used lq/sq +(defmethod touch-handler ((this h-warf) (arg0 process-focusable) (arg1 touching-shapes-entry)) + (b! + (or (not (logtest? (process-mask target crate enemy guard civilian) (-> arg0 mask))) + (and (logtest? (-> arg0 mask) (process-mask target)) (focus-test? arg0 dangerous pilot)) + ) + cfg-32 + :delay (nop!) + ) + (let ((s5-0 (new 'stack-no-clear 'rigid-body-impact)) + (s2-0 (new 'stack-no-clear 'vector)) + (f30-0 (get-inv-mass arg0)) + ) + (init-rbody-impact-from-tshape! this s5-0 arg1) + (if (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (rigid-body-control-method-23 (-> this rbody) (-> s5-0 point) (-> s5-0 velocity)) + (set! (-> s5-0 velocity quad) (-> this root transv quad)) + ) + (let ((v1-17 (-> arg0 root))) + (set! (-> s2-0 quad) (-> v1-17 transv quad)) + (vector-! (-> s5-0 velocity) (-> v1-17 transv) (-> s5-0 velocity)) + ) + (let ((f0-1 (vector-dot (-> s5-0 velocity) (-> s5-0 normal)))) + (when (< f0-1 0.0) + (set! (-> s5-0 impulse) (* -1.0 (/ 1.0 (+ f30-0 (-> this info info inv-mass))) f0-1)) + (vector+float*! s2-0 s2-0 (-> s5-0 normal) (* 3.1 f30-0 (-> s5-0 impulse))) + (set! (-> s2-0 y) (fmax (* 49152.0 f30-0) (-> s2-0 y))) + (when (or (logtest? (vehicle-flag in-pursuit) (-> this v-flags)) (!= arg0 *target*)) + (when (>= (the-as uint (- (current-time) (the-as int (-> this sent-attack-time)))) (the-as uint 150)) + (set! (-> this sent-attack-time) (the-as uint (current-time))) + (let* ((v1-40 *game-info*) + (a0-18 (+ (-> v1-40 attack-id) 1)) + ) + (set! (-> v1-40 attack-id) a0-18) + (set! (-> this outgoing-attack-id) a0-18) + ) + ) + (let ((f0-10 (+ 0.5 (* 0.000024414063 (-> s5-0 impulse))))) + (when (send-event + arg0 + 'attack + arg1 + (static-attack-info :mask (vehicle-impulse-factor) ((id (-> this outgoing-attack-id)) + (damage f0-10) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (attacker (process->handle (vehicle-method-68 this))) + (mode 'vehicle) + (vector s2-0) + (penetrate-using (penetrate vehicle)) + ) + ) + ) + ) + ) + ) + (impulse-handler this) + (vector-float*! (new 'stack-no-clear 'vector) (-> s5-0 normal) (* -1.0 (-> s5-0 impulse))) + (rigid-body-control-method-12 (-> this rbody) 1.0) + (init-velocities! (-> this rbody)) + (when #f + (set-time! (-> *debug-vehicle-work* impact-time)) + (mem-copy! (the-as pointer (-> *debug-vehicle-work* impact)) (the-as pointer s5-0) 64) + (let ((v1-71 (-> arg1 head))) + (set! (-> *debug-vehicle-work* prim-sphere1 quad) (-> v1-71 prim1 cprim prim-core world-sphere quad)) + (set! (-> *debug-vehicle-work* prim-sphere2 quad) (-> v1-71 prim2 cprim prim-core world-sphere quad)) + ) + (add-debug-x #t (bucket-id debug-no-zbuf1) (-> s5-0 point) *color-blue*) + (add-debug-vector + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 point) + (-> s5-0 normal) + (-> s5-0 impulse) + *color-blue* + ) + ) + (on-impact this s5-0) + (if (and (-> this next-state) (= (-> this next-state name) 'idle)) + (go (method-of-object this waiting)) + ) + ) + ) + ) + (label cfg-32) + #t + ) + +;; definition for method 77 of type h-warf +(defmethod vehicle-method-77 ((this h-warf)) + (set! (-> *game-info* health-bar-vehicle) (-> this hit-points)) + (call-parent-method this) + (none) + ) + +;; definition for method 164 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod draw-thrusters ((this h-warf) (arg0 float) (arg1 vector) (arg2 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (when (not (logtest? (-> this v-flags) (vehicle-flag dead))) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> arg2 quad)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (quaternion->matrix s4-0 (-> this root quat)) + (let ((a2-1 (matrix-transpose! (new 'stack-no-clear 'matrix) s4-0))) + (vector-rotate*! (-> this langvel) (-> this rbody ang-velocity) a2-1) + ) + (cond + ((not (-> this bounce-state?)) + (vector-rotate-around-axis! s5-0 (the-as quaternion arg2) (* -2184.5334 (-> this langvel x)) (-> s4-0 rvec)) + (vector-rotate-around-axis! s5-0 (the-as quaternion s5-0) (* -1820.4445 (-> this langvel y)) (-> s4-0 uvec)) + (vector-rotate-around-axis! + s5-0 + (the-as quaternion s5-0) + (* 182.04445 (-> this langvel z) (* 5.0 arg0)) + (-> s4-0 rvec) + ) + ) + (else + (set! (-> s5-0 quad) (-> arg2 quad)) + ) + ) + (set! (-> s4-0 trans quad) (-> arg1 quad)) + (dotimes (s3-1 15) + (let* ((f28-0 (* 0.06666667 (- 15.0 (the float s3-1)))) + (f26-0 (* f28-0 (rand-vu-float-range 8192.0 9011.2))) + (f30-0 (* f28-0 (rand-vu-float-range 8192.0 12288.0))) + ) + (let ((a1-9 (-> s4-0 trans))) + (let ((v1-18 (-> s4-0 trans))) + (let ((a0-12 s5-0)) + (let ((a2-7 (+ (* 819.2 f28-0) (* 1024.0 (-> this engine-thrust) f28-0)))) + (.mov vf7 a2-7) + ) + (.lvf vf5 (&-> a0-12 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! (-> *part-id-table* 2761 init-specs 11 initial-valuef) + (+ (rand-vu-float-range 0.0 5.0) (* 60.0 f28-0 (-> this engine-thrust)) (* 40.0 f28-0)) + ) + (set! (-> *part-id-table* 2761 init-specs 8 initial-valuef) + (+ (* 215.0 (-> this engine-thrust)) (* 40.0 f28-0)) + ) + (set! (-> *part-id-table* 2761 init-specs 10 initial-valuef) + (the float (- 255 (the int (* 255.0 (-> this engine-thrust))))) + ) + (set! (-> *part-id-table* 2761 init-specs 3 initial-valuef) f26-0) + (set! (-> *part-id-table* 2761 init-specs 7 initial-valuef) f26-0) + (set! (-> *part-id-table* 2762 init-specs 4 initial-valuef) (* 255.0 f28-0 (-> this engine-thrust))) + (set! (-> *part-id-table* 2762 init-specs 5 initial-valuef) + (the float (- 28 (the int (* 28.0 f28-0 (-> this engine-thrust))))) + ) + (set! (-> *part-id-table* 2762 init-specs 6 initial-valuef) + (the float (- 255 (the int (* 255.0 f28-0 (-> this engine-thrust))))) + ) + (set! (-> *part-id-table* 2762 init-specs 7 initial-valuef) + (+ (rand-vu-float-range 0.0 (* 40.0 (-> this engine-thrust))) + (* 20.0 f28-0 (-> this engine-thrust)) + (the float (* 30 (the int f28-0))) + ) + ) + (set! (-> *part-id-table* 2762 init-specs 2 initial-valuef) f30-0) + (set! (-> *part-id-table* 2762 init-specs 3 initial-valuef) f30-0) + ) + (launch-particles (-> *part-id-table* 2761) s4-0 :origin-is-matrix #t) + (launch-particles (-> *part-id-table* 2762) s4-0 :origin-is-matrix #t) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 78 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod vehicle-method-78 ((this h-warf)) + (let ((t9-0 (method-of-type vehicle vehicle-method-78))) + (t9-0 this) + ) + (when (logtest? (-> this rbody flags) (rigid-body-flag enable-physics)) + (let ((s5-0 (new 'stack-no-clear 'h-warf-stack-var0))) + (quaternion->matrix (-> s5-0 mat) (-> this root quat)) + (set! (-> s5-0 mat trans quad) (-> this root trans quad)) + (set-vector! (-> s5-0 vec1) 0.0 0.0 -1.0 1.0) + (vector-rotate*! (-> s5-0 vec1) (-> s5-0 vec1) (-> s5-0 mat)) + (when (< 0.0 (-> this info particles thruster-flame-length)) + (let ((f30-0 (fmax 0.01 (* (-> this info particles thruster-flame-length) + (-> this power-level) + (-> this force-scale) + (-> this engine-thrust) + ) + ) + ) + ) + (fmin (-> this info particles thruster-flame-width) f30-0) + ) + (dotimes (s4-0 2) + (vector-matrix*! (-> s5-0 vec0) (-> this info particles thruster-local-pos s4-0) (-> s5-0 mat)) + (draw-thrusters + this + (if (zero? s4-0) + -1.0 + 1.0 + ) + (-> s5-0 vec0) + (-> s5-0 vec1) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 54 of type h-warf +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod rigid-body-object-method-54 ((this h-warf)) + (cond + ((logtest? (vehicle-flag tracking-mode) (-> this v-flags)) + (let ((a0-3 (the-as process-focusable (handle->process (-> this track-obj))))) + (when a0-3 + (let ((s5-0 (new 'stack-no-clear 'vehicle-physics-work))) + (let* ((v1-7 (-> s5-0 mat)) + (a3-0 (-> a0-3 node-list data (-> this track-joint) bone transform)) + (a0-9 (-> a3-0 rvec quad)) + (a1-3 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-7 rvec quad) a0-9) + (set! (-> v1-7 uvec quad) a1-3) + (set! (-> v1-7 fvec quad) a2-0) + (set! (-> v1-7 trans quad) a3-1) + ) + (set! (-> s5-0 velocity quad) (-> s5-0 mat trans quad)) + (matrix->quaternion (the-as quaternion (-> s5-0 force)) (-> s5-0 mat)) + (rigid-body-control-method-28 (-> this rbody) (-> s5-0 velocity) (the-as quaternion (-> s5-0 force))) + ) + (vector-reset! (-> this rbody lin-velocity)) + (vector-reset! (-> this rbody ang-velocity)) + ) + ) + (set! (-> this rbody time-remaining) 0.0) + ) + (else + (call-parent-method this) + ) + ) + (none) + ) + +;; definition for method 49 of type h-warf +(defmethod rbody-event-handler ((this h-warf) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('tracking-mode) + (let ((v1-1 (-> arg3 param 0)) + (a0-2 (-> arg3 param 1)) + ) + (set! (-> this track-obj) (the-as handle v1-1)) + (set! (-> this track-joint) (the-as int a0-2)) + ) + (let ((v0-0 (the-as object (logior (vehicle-flag tracking-mode) (-> this v-flags))))) + (set! (-> this v-flags) (the-as vehicle-flag v0-0)) + v0-0 + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/factory/hover-nav-factoryc_REF.gc b/test/decompiler/reference/jak3/levels/factory/hover-nav-factoryc_REF.gc new file mode 100644 index 0000000000..96e1ee4652 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/hover-nav-factoryc_REF.gc @@ -0,0 +1,406 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *factoryc-adjacency*, type nav-network-data +(define *factoryc-adjacency* + (new 'static 'nav-network-data + :node-array (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :parent #f) + :pos (new 'static 'vector :x 1172152.4 :y 1784913.9 :z 86958.08 :w 1.0) + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 1 :dist 37765.12) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :pos (new 'static 'vector :x 1174282.2 :y 1822597.1 :z 86466.56 :w 1.0) + :index 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :dist 37765.12) + (new 'static 'nav-network-adjacency :index 2 :dist 23388.16) + (new 'static 'nav-network-adjacency :index 6 :dist 128450.56) + (new 'static 'nav-network-adjacency :index 29 :dist 53288.96) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :pos (new 'static 'vector :x 1165393.9 :y 1801912.4 :z 80158.72 :w 1.0) + :index 2 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 1 :dist 23388.16) + (new 'static 'nav-network-adjacency :index 3 :dist 101130.24) + (new 'static 'nav-network-adjacency :index 4 :dist 58941.44) + (new 'static 'nav-network-adjacency :index 5 :dist 70901.76) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :pos (new 'static 'vector :x 1188167.6 :y 1801912.4 :z -18350.08 :w 1.0) + :index 3 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 2 :dist 101130.24) + (new 'static 'nav-network-adjacency :index 29 :dist 66314.24) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 4 :parent #f) + :pos (new 'static 'vector :x 1170923.5 :y 1801912.4 :z 138813.44 :w 1.0) + :index 4 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 2 :dist 58941.44) + (new 'static 'nav-network-adjacency :index 5 :dist 55418.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 5 :parent #f) + :pos (new 'static 'vector :x 1222737.9 :y 1793761.2 :z 120995.84 :w 1.0) + :index 5 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 2 :dist 70901.76) + (new 'static 'nav-network-adjacency :index 4 :dist 55418.88) + (new 'static 'nav-network-adjacency :index 6 :dist 74055.68) + (new 'static 'nav-network-adjacency :index 29 :dist 77660.16) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 6 :parent #f) + :pos (new 'static 'vector :x 1296465.9 :y 1793761.2 :z 113786.88 :w 1.0) + :index 6 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 1 :dist 128450.56) + (new 'static 'nav-network-adjacency :index 5 :dist 74055.68) + (new 'static 'nav-network-adjacency :index 7 :dist 166297.6) + (new 'static 'nav-network-adjacency :index 8 :dist 153681.92) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 7 :parent #f) + :pos (new 'static 'vector :x 1353728.0 :y 1793761.2 :z -42311.68 :w 1.0) + :index 7 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 6 :dist 166297.6) + (new 'static 'nav-network-adjacency :index 9 :dist 169246.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 8 :parent #f) + :pos (new 'static 'vector :x 1265664.0 :y 1793761.2 :z -36741.12 :w 1.0) + :index 8 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 6 :dist 153681.92) + (new 'static 'nav-network-adjacency :index 9 :dist 171335.69) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 9 :parent #f) + :pos (new 'static 'vector :x 1303429.1 :y 1776681.0 :z -202997.77 :w 1.0) + :index 9 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 7 :dist 169246.72) + (new 'static 'nav-network-adjacency :index 8 :dist 171335.69) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 10 :parent #f) + :pos (new 'static 'vector :x 825303.06 :y 1806049.2 :z -787783.7 :w 1.0) + :index 10 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 16 :dist 126853.12) + (new 'static 'nav-network-adjacency :index 17 :dist 61849.6) + (new 'static 'nav-network-adjacency :index 27 :dist 85647.36) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 11 :parent #f) + :pos (new 'static 'vector :x 686530.56 :y 1806049.2 :z -810557.44 :w 1.0) + :index 11 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 12 :dist 79626.24) + (new 'static 'nav-network-adjacency :index 15 :dist 55992.32) + (new 'static 'nav-network-adjacency :index 20 :dist 53248.0) + (new 'static 'nav-network-adjacency :index 28 :dist 108666.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 12 :parent #f) + :pos (new 'static 'vector :x 628285.44 :y 1806049.2 :z -756285.44 :w 1.0) + :index 12 + :sub-graph 1 + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 11 :dist 79626.24) + (new 'static 'nav-network-adjacency :index 13 :dist 42844.16) + (new 'static 'nav-network-adjacency :index 16 :dist 106004.48) + (new 'static 'nav-network-adjacency :index 20 :dist 44441.6) + (new 'static 'nav-network-adjacency :index 28 :dist 62218.24) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 13 :parent #f) + :pos (new 'static 'vector :x 585441.25 :y 1806049.2 :z -755752.94 :w 1.0) + :index 13 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 12 :dist 42844.16) + (new 'static 'nav-network-adjacency :index 20 :dist 68075.52) + (new 'static 'nav-network-adjacency :index 21 :dist 58654.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 14 :parent #f) + :pos (new 'static 'vector :x 722124.8 :y 1790730.2 :z -716349.44 :w 1.0) + :index 14 + :sub-graph 1 + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 16 :dist 43499.52) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 15 :parent #f) + :pos (new 'static 'vector :x 724131.8 :y 1834147.9 :z -841072.6 :w 1.0) + :index 15 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 11 :dist 55992.32) + (new 'static 'nav-network-adjacency :index 16 :dist 122961.92) + (new 'static 'nav-network-adjacency :index 17 :dist 60702.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 16 :parent #f) + :pos (new 'static 'vector :x 723107.8 :y 1834147.9 :z -718110.75 :w 1.0) + :index 16 + :sub-graph 1 + :count 6 + :adjacency (new 'static 'inline-array nav-network-adjacency 6 + (new 'static 'nav-network-adjacency :index 10 :dist 126853.12) + (new 'static 'nav-network-adjacency :index 12 :dist 106004.48) + (new 'static 'nav-network-adjacency :index 14 :dist 43499.52) + (new 'static 'nav-network-adjacency :index 15 :dist 122961.92) + (new 'static 'nav-network-adjacency :index 27 :dist 66846.72) + (new 'static 'nav-network-adjacency :index 28 :dist 82329.6) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 17 :parent #f) + :pos (new 'static 'vector :x 775045.1 :y 1806049.2 :z -823828.5 :w 1.0) + :index 17 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 10 :dist 61849.6) + (new 'static 'nav-network-adjacency :index 15 :dist 60702.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 18 :parent #f) + :pos (new 'static 'vector :x 539729.94 :y 1821532.1 :z -807403.5 :w 1.0) + :index 18 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 19 :dist 81592.32) + (new 'static 'nav-network-adjacency :index 21 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 22 :dist 76677.12) + (new 'static 'nav-network-adjacency :index 23 :dist 39034.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 19 :parent #f) + :pos (new 'static 'vector :x 618045.44 :y 1821532.1 :z -830218.25 :w 1.0) + :index 19 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 18 :dist 81592.32) + (new 'static 'nav-network-adjacency :index 20 :dist 38543.36) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 20 :parent #f) + :pos (new 'static 'vector :x 637460.5 :y 1821532.1 :z -796917.75 :w 1.0) + :index 20 + :sub-graph 1 + :count 5 + :adjacency (new 'static 'inline-array nav-network-adjacency 5 + (new 'static 'nav-network-adjacency :index 11 :dist 53248.0) + (new 'static 'nav-network-adjacency :index 12 :dist 44441.6) + (new 'static 'nav-network-adjacency :index 13 :dist 68075.52) + (new 'static 'nav-network-adjacency :index 19 :dist 38543.36) + (new 'static 'nav-network-adjacency :index 21 :dist 111493.12) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 21 :parent #f) + :pos (new 'static 'vector :x 530022.4 :y 1821532.1 :z -767098.9 :w 1.0) + :index 21 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 13 :dist 58654.72) + (new 'static 'nav-network-adjacency :index 18 :dist 41451.52) + (new 'static 'nav-network-adjacency :index 20 :dist 111493.12) + (new 'static 'nav-network-adjacency :index 22 :dist 101867.52) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 22 :parent #f) + :pos (new 'static 'vector :x 480501.75 :y 1821532.1 :z -856104.94 :w 1.0) + :index 22 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 18 :dist 76677.12) + (new 'static 'nav-network-adjacency :index 21 :dist 101867.52) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 23 :parent #f) + :pos (new 'static 'vector :x 538214.4 :y 1782538.2 :z -808099.8 :w 1.0) + :index 23 + :sub-graph 1 + :count 1 + :adjacency (new 'static 'inline-array nav-network-adjacency 1 + (new 'static 'nav-network-adjacency :index 18 :dist 39034.88) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 24 :parent #f) + :pos (new 'static 'vector :x 777953.25 :y 1680793.6 :z -723394.56 :w 1.0) + :index 24 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 25 :dist 75038.72) + (new 'static 'nav-network-adjacency :index 27 :dist 176578.56) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 25 :parent #f) + :pos (new 'static 'vector :x 719093.75 :y 1680793.6 :z -769966.06 :w 1.0) + :index 25 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 24 :dist 75038.72) + (new 'static 'nav-network-adjacency :index 26 :dist 70983.68) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 26 :parent #f) + :pos (new 'static 'vector :x 664739.8 :y 1680793.6 :z -724336.6 :w 1.0) + :index 26 + :sub-graph 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 25 :dist 70983.68) + (new 'static 'nav-network-adjacency :index 28 :dist 177438.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 27 :parent #f) + :pos (new 'static 'vector :x 784179.2 :y 1857044.5 :z -732569.6 :w 1.0) + :index 27 + :sub-graph 1 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 10 :dist 85647.36) + (new 'static 'nav-network-adjacency :index 16 :dist 66846.72) + (new 'static 'nav-network-adjacency :index 24 :dist 176578.56) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 28 :parent #f) + :pos (new 'static 'vector :x 644259.8 :y 1857044.5 :z -724418.56 :w 1.0) + :index 28 + :sub-graph 1 + :count 4 + :adjacency (new 'static 'inline-array nav-network-adjacency 4 + (new 'static 'nav-network-adjacency :index 11 :dist 108666.88) + (new 'static 'nav-network-adjacency :index 12 :dist 62218.24) + (new 'static 'nav-network-adjacency :index 16 :dist 82329.6) + (new 'static 'nav-network-adjacency :index 26 :dist 177438.72) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 29 :parent #f) + :pos (new 'static 'vector :x 1200906.2 :y 1799249.9 :z 46653.44 :w 1.0) + :index 29 + :count 3 + :adjacency (new 'static 'inline-array nav-network-adjacency 3 + (new 'static 'nav-network-adjacency :index 1 :dist 53288.96) + (new 'static 'nav-network-adjacency :index 3 :dist 66314.24) + (new 'static 'nav-network-adjacency :index 5 :dist 77660.16) + ) + ) + ) + :edge-array (new 'static 'boxed-array :type nav-network-edge + (new 'static 'nav-network-edge :end-index 1 :radius 16384.0) + (new 'static 'nav-network-edge :start-index 2 :end-index 1 :radius 16384.0) + (new 'static 'nav-network-edge :start-index 2 :end-index 3 :radius 41902.08) + (new 'static 'nav-network-edge :start-index 2 :end-index 4 :radius 30515.2) + (new 'static 'nav-network-edge :start-index 4 :end-index 5 :radius 25067.52) + (new 'static 'nav-network-edge :start-index 5 :end-index 2 :radius 26705.92) + (new 'static 'nav-network-edge :start-index 5 :end-index 6 :radius 36659.2) + (new 'static 'nav-network-edge :start-index 6 :end-index 1 :radius 37806.08) + (new 'static 'nav-network-edge :start-index 6 :end-index 7 :radius 34160.64) + (new 'static 'nav-network-edge :start-index 8 :end-index 6 :radius 31907.84) + (new 'static 'nav-network-edge :start-index 9 :end-index 7 :radius 42844.16) + (new 'static 'nav-network-edge :start-index 9 :end-index 8 :radius 23920.64) + (new 'static 'nav-network-edge :start-index 10 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 10 :end-index 27 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 11 :end-index 12 :radius 37355.52 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 11 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 11 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 13 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 12 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 13 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 13 :end-index 21 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 14 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 15 :end-index 11 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 15 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 16 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 17 :end-index 10 :radius 26378.24 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 17 :end-index 15 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 18 :end-index 19 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 18 :end-index 21 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 19 :end-index 20 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 20 :end-index 21 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 21 :end-index 22 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 22 :end-index 18 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 23 :end-index 18 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 24 :end-index 25 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 24 :end-index 27 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 25 :end-index 26 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 26 :end-index 28 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 27 :end-index 16 :radius 16384.0 :sub-graph 1) + (new 'static 'nav-network-edge :start-index 29 :end-index 1 :radius 25067.52) + (new 'static 'nav-network-edge :start-index 29 :end-index 3 :radius 30064.64) + (new 'static 'nav-network-edge :start-index 29 :end-index 5 :radius 32194.56) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/hover-nav-factoryd_REF.gc b/test/decompiler/reference/jak3/levels/factory/hover-nav-factoryd_REF.gc new file mode 100644 index 0000000000..94be56f356 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/hover-nav-factoryd_REF.gc @@ -0,0 +1,58 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *factoryd-adjacency*, type nav-network-data +(define *factoryd-adjacency* (new 'static 'nav-network-data + :node-array (new 'static 'boxed-array :type nav-network-info + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :parent #f) + :pos (new 'static 'vector :x 1078640.6 :y 2171125.8 :z -394813.44 :w 1.0) + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 1 :dist 93962.24) + (new 'static 'nav-network-adjacency :index 3 :dist 110755.84) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 1 :parent #f) + :pos (new 'static 'vector :x 1072537.6 :y 2171125.8 :z -488570.88 :w 1.0) + :index 1 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :dist 93962.24) + (new 'static 'nav-network-adjacency :index 2 :dist 110346.24) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 2 :parent #f) + :pos (new 'static 'vector :x 962273.25 :y 2171125.8 :z -492912.62 :w 1.0) + :index 2 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :index 1 :dist 110346.24) + (new 'static 'nav-network-adjacency :index 3 :dist 102604.8) + ) + ) + (new 'static 'nav-network-info + :path-node (new 'static 'nav-network-path-node :row-index 3 :parent #f) + :pos (new 'static 'vector :x 967966.75 :y 2171125.8 :z -390471.7 :w 1.0) + :index 3 + :count 2 + :adjacency (new 'static 'inline-array nav-network-adjacency 2 + (new 'static 'nav-network-adjacency :dist 110755.84) + (new 'static 'nav-network-adjacency :index 2 :dist 102604.8) + ) + ) + ) + :edge-array (new 'static 'boxed-array :type nav-network-edge + (new 'static 'nav-network-edge :end-index 1 :radius 36331.52) + (new 'static 'nav-network-edge :start-index 1 :end-index 2 :radius 38830.08) + (new 'static 'nav-network-edge :start-index 2 :end-index 3 :radius 35184.64) + (new 'static 'nav-network-edge :start-index 3 :radius 39485.44) + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc new file mode 100644 index 0000000000..53eef8ea89 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/lfacrm1-mood_REF.gc @@ -0,0 +1,202 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type lfacrm1-states +(deftype lfacrm1-states (structure) + ((door-current-interp float) + (door-target-interp float) + (blink float) + ) + ) + +;; definition for method 3 of type lfacrm1-states +(defmethod inspect ((this lfacrm1-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lfacrm1-states) + (format #t "~1Tdoor-current-interp: ~f~%" (-> this door-current-interp)) + (format #t "~1Tdoor-target-interp: ~f~%" (-> this door-target-interp)) + (format #t "~1Tblink: ~f~%" (-> this blink)) + (label cfg-4) + this + ) + +;; definition for function update-lfacrm1-lights +(defun update-lfacrm1-lights ((arg0 mood-context)) + (let ((v1-0 (the-as object (-> arg0 state))) + (a1-0 (-> arg0 light-group)) + (a2-1 (-> *level* level-default mood-context light-group)) + ) + (let ((a0-2 (-> a1-0 0))) + (set! (-> a0-2 dir0 direction x) -0.372) + (set! (-> a0-2 dir0 direction y) 0.853) + (set! (-> a0-2 dir0 direction z) 0.363) + (set! (-> a0-2 dir0 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir0 color) 0.65 0.855 0.82 1.0) + (let ((a0-4 (-> a1-0 0 dir1))) + (set! (-> a0-4 direction x) 0.372) + (set! (-> a0-4 direction y) 0.853) + (set! (-> a0-4 direction z) -0.363) + (set! (-> a0-4 direction w) 0.0) + ) + (set-vector! (-> a1-0 0 dir1 color) 0.65 0.855 0.82 1.0) + (set-vector! (-> a1-0 0 ambi color) 0.627 0.718 1.0 1.0) + (set! (-> a1-0 0 dir0 extra x) 0.85) + (set! (-> a1-0 0 dir1 extra x) 0.3) + (set! (-> a1-0 0 dir2 extra x) 0.0) + (set! (-> a1-0 0 ambi extra x) 0.3) + (light-group-lerp! + (the-as light-group a1-0) + (the-as (pointer light-group) a1-0) + (the-as light-group a2-1) + (-> (the-as lfacrm1-states v1-0) door-current-interp) + ) + ) + (none) + ) + +;; definition for function update-mood-lfacrm1 +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-lfacrm1 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #t) + (update-lfacrm1-lights arg0) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (let ((gp-0 (the-as object (-> arg0 state)))) + (vector4-lerp! + (the-as vector (-> arg0 times)) + (the-as vector (-> arg0 times)) + (the-as vector (-> *level* level-default mood-context times)) + (-> (the-as lfacrm1-states gp-0) door-current-interp) + ) + (set! (-> arg0 times 1 w) 1.0) + (set! (-> arg0 times 2 w) (-> (the-as lfacrm1-states gp-0) blink)) + (set! (-> arg0 times 3 w) 1.0) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + (when (not (paused?)) + (seek! + (-> (the-as lfacrm1-states gp-0) door-current-interp) + (-> (the-as lfacrm1-states gp-0) door-target-interp) + (* 0.3745 (seconds-per-frame)) + ) + (let ((v1-14 (-> *display* part-clock frame-counter))) + (if (< (* 0.2 (the float (mod v1-14 600))) 60.0) + (seek! (-> (the-as lfacrm1-states gp-0) blink) 0.0 (* 0.5 (seconds-per-frame))) + (seek! (-> (the-as lfacrm1-states gp-0) blink) 1.0 (* 0.5 (seconds-per-frame))) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for function set-lfacrm1-door! +;; WARN: Return type mismatch float vs none. +(defun set-lfacrm1-door! ((arg0 float)) + (let ((v1-1 (level-get *level* 'lfacrm1))) + (when v1-1 + (let ((v1-2 (-> v1-1 mood-context state))) + (set! (-> v1-2 1) (the-as uint arg0)) + (if (= arg0 0.0) + (set! (-> v1-2 0) (the-as uint arg0)) + ) + ) + ) + ) + (let ((v1-4 (level-get *level* 'factorya))) + (when v1-4 + (let ((v1-5 (the-as object (-> v1-4 mood-context state)))) + (set! (-> (the-as lfacrm1-states v1-5) door-target-interp) arg0) + (if (= arg0 0.0) + (set! (-> (the-as lfacrm1-states v1-5) door-current-interp) arg0) + ) + ) + ) + ) + (none) + ) + +;; definition of type lfac-hanger-door +(deftype lfac-hanger-door (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type lfac-hanger-door +(defmethod inspect ((this lfac-hanger-door)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-lfac-hanger-door lfac-hanger-door lfac-hanger-door-lod0-jg lfac-hanger-door-idle-ja + ((lfac-hanger-door-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 25) + ) + +;; failed to figure out what this is: +(defstate idle (lfac-hanger-door) + :virtual #t + :code (behavior () + (until #f + (ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post ja-post + ) + +;; definition for method 11 of type lfac-hanger-door +(defmethod init-from-entity! ((this lfac-hanger-door) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-lfac-hanger-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +;; definition for function lfac-hanger-door-init-by-other +;; INFO: Used lq/sq +(defbehavior lfac-hanger-door-init-by-other lfac-hanger-door ((arg0 vector) (arg1 entity-actor)) + (process-entity-set! self arg1) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-lfac-hanger-door" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go-virtual idle) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc b/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc new file mode 100644 index 0000000000..9f30d7c421 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/lfacrm2-mood_REF.gc @@ -0,0 +1,244 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type fac-elevator-a +(deftype fac-elevator-a (elevator) + ((mysound sound-id) + ) + ) + +;; definition for method 3 of type fac-elevator-a +(defmethod inspect ((this fac-elevator-a)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type elevator inspect))) + (t9-0 this) + ) + (format #t "~2Tmysound: ~D~%" (-> this mysound)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-fac-elevator-a fac-elevator-a fac-elevator-a-lod0-jg fac-elevator-a-idle-ja + ((fac-elevator-a-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 11) + ) + +;; failed to figure out what this is: +(defstate running (fac-elevator-a) + :virtual #t + :enter (behavior () + (set! (-> self mysound) (sound-play "elevator-a")) + (let ((t9-3 (-> (find-parent-state) enter))) + (if t9-3 + (t9-3) + ) + ) + ) + :exit (behavior () + (sound-stop (-> self mysound)) + (set! (-> self mysound) (sound-play "elevator-hit")) + (let ((t9-4 (-> (find-parent-state) exit))) + (if t9-4 + (t9-4) + ) + ) + ) + :trans (behavior () + (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 mysound)) + (let ((a1-0 (target-pos 0))) + (let ((s5-0 self)) + (when (= a1-0 #t) + (if (and s5-0 (type? s5-0 process-drawable) (nonzero? (-> s5-0 root))) + (set! a1-0 (-> s5-0 root 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) + ) + ) + (let ((t9-5 (-> (find-parent-state) trans))) + (if t9-5 + (t9-5) + ) + ) + ) + :code (behavior () + (when (not (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0))) + (ja-no-eval :group! fac-elevator-a-gate_up-ja :num! (seek! max 1.333) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 1.333)) + ) + ) + (let ((t9-5 (-> (find-parent-state) code))) + (if t9-5 + ((the-as (function none) t9-5)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate arrived (fac-elevator-a) + :virtual #t + :code (behavior () + (go-virtual dormant) + ) + ) + +;; failed to figure out what this is: +(defstate waiting (fac-elevator-a) + :virtual #t + :code (behavior () + (format #t "~I~%" (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0)) + (if (nonzero? (res-lump-value (-> self entity) 'start-gate-up uint128 :time -1000000000.0)) + (ja :group! fac-elevator-a-gate_up-ja :num! max) + (ja :group! fac-elevator-a-gate_up-ja :num! min) + ) + (sleep-code) + ) + ) + +;; failed to figure out what this is: +(defstate dormant (fac-elevator-a) + :virtual #t + :code (behavior () + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1.5)) + '() + (suspend) + ) + ) + (ja-no-eval :group! fac-elevator-a-gate_down-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (sleep-code) + ) + ) + +;; definition for method 31 of type fac-elevator-a +(defmethod get-art-group ((this fac-elevator-a)) + (art-group-get-by-name *level* "skel-fac-elevator-a" (the-as (pointer level) #f)) + ) + +;; definition for method 32 of type fac-elevator-a +;; WARN: Return type mismatch collide-shape-moving vs none. +(defmethod init-collision! ((this fac-elevator-a)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s4-0 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> s4-0 prim-core action) (collide-action solid rideable)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 45056.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (pusher-init s5-0) + (let ((v1-15 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec pusher)) + (set! (-> v1-15 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-15 prim-core action) (collide-action solid rideable)) + (set! (-> v1-15 transform-index) 3) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-17 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-17 prim-core collide-as) (collide-spec obstacle pusher)) + (set! (-> v1-17 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-17 prim-core action) (collide-action solid rideable)) + (set! (-> v1-17 transform-index) 4) + (set-vector! (-> v1-17 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 2) (the-as uint (shl #xfe00 16))))) + (set! (-> v1-20 prim-core action) (collide-action solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 0.0 45056.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-23 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-23 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-23 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + (none) + ) + +;; definition for method 34 of type fac-elevator-a +;; WARN: Return type mismatch sound-spec vs none. +(defmethod base-plat-method-34 ((this fac-elevator-a)) + (set! (-> this bounce-scale) 0.0) + (set! (-> this sound-running-loop) (static-sound-spec "fac-elevator-a" :group 0)) + (none) + ) + +;; definition of type lfacrm2-states +(deftype lfacrm2-states (structure) + () + ) + +;; definition for method 3 of type lfacrm2-states +(defmethod inspect ((this lfacrm2-states)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'lfacrm2-states) + (label cfg-4) + this + ) + +;; definition for function update-mood-lfacrm2 +;; WARN: Return type mismatch int vs none. +(defbehavior update-mood-lfacrm2 time-of-day-proc ((arg0 mood-context) (arg1 float) (arg2 int)) + (update-mood-interior arg0 #f) + (cond + ((< (the-as uint 8) (the-as uint (-> *time-of-day-context* mode))) + (palette-select-special arg0) + ) + (else + (-> arg0 state) + (set! (-> arg0 times 0 w) 1.0) + (set! (-> arg0 times 1 w) 1.0) + (let* ((a0-5 (-> *display* part-clock frame-counter)) + (v1-8 (mod a0-5 300)) + (s5-0 (mod a0-5 900)) + ) + (set! (-> arg0 times 2 w) (+ 0.85 (* 0.35 (sin (* 218.45334 (the float v1-8)))))) + (set! (-> arg0 times 3 w) (if (< 450 s5-0) + 1.0 + 0.5 + ) + ) + ) + (set! (-> arg0 times 4 w) 1.0) + (set! (-> arg0 times 5 w) 1.0) + (set! (-> arg0 times 6 w) 1.0) + (set! (-> arg0 times 7 w) 1.0) + ) + ) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc b/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc new file mode 100644 index 0000000000..3191a582f2 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/missile-bot_REF.gc @@ -0,0 +1,1372 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-missile-bot missile-bot missile-bot-lod0-jg missile-bot-idle-ja + ((missile-bot-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 3) + :shadow missile-bot-shadow-mg + :origin-joint-index 3 + ) + +;; definition of type missile-bot +(deftype missile-bot (nav-enemy) + ((parent (pointer factory-boss) :override) + (traj trajectory :inline) + (initial-y float) + (top-spin-jm joint-mod) + (top-angle float) + (main-jm joint-mod) + (height-bob bouncing-float :inline) + (height-bob-rand delayed-rand-float :inline) + (main-wobble oscillating-vector :inline) + (main-wobble-rand delayed-rand-vector :inline) + (thruster-part sparticle-launch-control) + (lightning lightning-control 6) + (lightning-wobble oscillating-vector 3 :inline) + (lightning-wobble-rand delayed-rand-vector 3 :inline) + (lightning-mode uint64) + (lightning-timer time-frame) + (lightning-sound sound-id) + (lightning-sound-playing symbol) + (glows-on symbol) + (spin float) + (engine-sound sound-id) + (engine-sound-playing symbol) + (explosion-sound-index int8) + (spin-whoosh-timer time-frame) + (will-hit-errol symbol) + (spark-part sparticle-launch-control) + (spark-part-on symbol) + (spark-timer time-frame) + ) + (:state-methods + fizzle + kicked + lift-off + explode + ) + (:methods + (toggle-glow-sprites (_type_ symbol) none) + ) + ) + +;; definition for method 3 of type missile-bot +(defmethod inspect ((this missile-bot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Ttraj: #~%" (-> this traj)) + (format #t "~2Tinitial-y: ~f~%" (-> this initial-y)) + (format #t "~2Ttop-spin-jm: ~A~%" (-> this top-spin-jm)) + (format #t "~2Ttop-angle: ~f~%" (-> this top-angle)) + (format #t "~2Tmain-jm: ~A~%" (-> this main-jm)) + (format #t "~2Theight-bob: #~%" (-> this height-bob)) + (format #t "~2Theight-bob-rand: #~%" (-> this height-bob-rand)) + (format #t "~2Tmain-wobble: #~%" (-> this main-wobble)) + (format #t "~2Tmain-wobble-rand: #~%" (-> this main-wobble-rand)) + (format #t "~2Tthruster-part: ~A~%" (-> this thruster-part)) + (format #t "~2Tlightning[6] @ #x~X~%" (-> this lightning)) + (format #t "~2Tlightning-wobble[3] @ #x~X~%" (-> this lightning-wobble)) + (format #t "~2Tlightning-wobble-rand[3] @ #x~X~%" (-> this lightning-wobble-rand)) + (format #t "~2Tlightning-mode: ~D~%" (-> this lightning-mode)) + (format #t "~2Tlightning-timer: ~D~%" (-> this lightning-timer)) + (format #t "~2Tlightning-sound: ~D~%" (-> this lightning-sound)) + (format #t "~2Tlightning-sound-playing: ~A~%" (-> this lightning-sound-playing)) + (format #t "~2Tglows-on: ~A~%" (-> this glows-on)) + (format #t "~2Tspin: ~f~%" (-> this spin)) + (format #t "~2Tengine-sound: ~D~%" (-> this engine-sound)) + (format #t "~2Tengine-sound-playing: ~A~%" (-> this engine-sound-playing)) + (format #t "~2Texplosion-sound-index: ~D~%" (-> this explosion-sound-index)) + (format #t "~2Tspin-whoosh-timer: ~D~%" (-> this spin-whoosh-timer)) + (format #t "~2Twill-hit-errol: ~A~%" (-> this will-hit-errol)) + (format #t "~2Tspark-part: ~A~%" (-> this spark-part)) + (format #t "~2Tspark-part-on: ~A~%" (-> this spark-part-on)) + (format #t "~2Tspark-timer: ~D~%" (-> this spark-timer)) + (label cfg-4) + this + ) + +;; definition for symbol *missile-bot-nav-enemy-info*, type nav-enemy-info +(define *missile-bot-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #t + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 100 + :param1 100 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim 3 + :jump-wind-up-anim 3 + :jump-in-air-anim 3 + :jump-land-anim 3 + :neck-joint -1 + :look-at-joint 3 + :bullseye-joint 3 + :notice-distance (meters 150) + :notice-distance-delta (meters 20) + :proximity-notice-distance (meters 30) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd obstacle hit-by-others-list) + :overlaps-others-collide-with-filter (collide-spec jak bot enemy hit-by-others-list player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.5 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 0.5) + :jump-height-factor 0.1 + :knocked-seek-ry-clamp 6371.5557 + :knocked-soft-vxz-lo 20480.0 + :knocked-soft-vxz-hi 28672.0 + :knocked-soft-vy-lo 36864.0 + :knocked-soft-vy-hi 45056.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 49152.0 + :knocked-hard-vxz-hi 57344.0 + :knocked-hard-vy-lo 49152.0 + :knocked-hard-vy-hi 57344.0 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 20480.0 + :knocked-yellow-vxz-hi 28672.0 + :knocked-yellow-vy-lo 36864.0 + :knocked-yellow-vy-hi 4096.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 114688.0 + :knocked-red-vy-lo 53248.0 + :knocked-red-vy-hi 69632.0 + :knocked-blue-vxz-lo 16384.0 + :knocked-blue-vxz-hi 20480.0 + :knocked-blue-vy-lo 16384.0 + :knocked-blue-vy-hi 32768.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim 3 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 8) + :run-acceleration (meters 2) + :run-turning-acceleration (meters 30) + :walk-travel-speed (meters 3) + :walk-acceleration (meters 1) + :walk-turning-acceleration (meters 8) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 16) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *missile-bot-nav-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for function stunned? +(defbehavior stunned? missile-bot () + (and (-> self next-state) (let ((v1-2 (-> self next-state name))) + (or (= v1-2 'fizzle) (= v1-2 'kicked) (= v1-2 'lift-off)) + ) + ) + ) + +;; definition for method 82 of type missile-bot +(defmethod event-handler ((this missile-bot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('lift-off) + (go (method-of-object this lift-off)) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 63 of type missile-bot +(defmethod enemy-method-63 ((this missile-bot) (arg0 float)) + (fmax 0.0 (fmin arg0 (-> this hit-points))) + ) + +;; definition for method 194 of type missile-bot +;; WARN: Return type mismatch connection vs none. +(defmethod toggle-glow-sprites ((this missile-bot) (arg0 symbol)) + (cond + ((stunned?) + (when (-> this glows-on) + (set! (-> this glows-on) #f) + (set! arg0 #t) + ) + ) + ((not (-> this glows-on)) + (set! (-> this glows-on) #t) + (set! arg0 #t) + ) + ) + (when arg0 + (remove-from-process *part-engine* this) + (when (-> this glows-on) + (add-connection *part-engine* this 7 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 8 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 10 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 9 this 4557 (new 'static 'vector :w 163840.0)) + (add-connection *part-engine* this 11 this 4556 (new 'static 'vector :w 163840.0)) + ) + ) + (none) + ) + +;; definition for function missile-bot-get-kick-time +(defbehavior missile-bot-get-kick-time missile-bot ((arg0 float)) + (fmax 30.0 (* 0.0018310547 arg0)) + ) + +;; definition for function missile-bot-find-dest +;; INFO: Used lq/sq +(defbehavior missile-bot-find-dest missile-bot ((arg0 vector)) + (local-vars (v1-22 float) (a2-3 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg main)))) + (set! (-> arg0 quad) (-> s4-0 quad)) + (let* ((s5-1 (vector-! (new 'stack-no-clear 'vector) s4-0 (target-pos 0))) + (s2-0 (ppointer->process (-> self parent))) + (s3-1 (if (type? s2-0 factory-boss) + s2-0 + ) + ) + (s0-0 (new 'stack-no-clear 'vector)) + (s2-1 (new 'stack-no-clear 'vector)) + (s1-0 (new 'stack-no-clear 'vector)) + ) + (when s3-1 + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 1.0) + (vector-! s0-0 (-> s3-1 center) s4-0) + (set! (-> s0-0 y) 0.0) + (vector-float*! s2-1 s5-1 (vector-dot s5-1 s0-0)) + (vector-! s1-0 s2-1 s0-0) + (let* ((v1-10 arg0) + (a0-11 s2-1) + (a1-7 s5-1) + (f0-4 110592.0) + (f0-6 (* f0-4 f0-4)) + ) + (.lvf vf1 (&-> s1-0 quad)) + (.add.w.vf vf2 vf0 vf0 :mask #b1) + (.mul.vf vf1 vf1 vf1) + (.mul.x.vf acc vf2 vf1 :mask #b1) + (.add.mul.y.vf acc vf2 vf1 acc :mask #b1) + (.add.mul.z.vf vf1 vf2 vf1 acc :mask #b1) + (.mov a2-3 vf1) + (vector+float*! v1-10 a0-11 a1-7 (sqrtf (- f0-6 a2-3))) + ) + (if (< (vector-dot s5-1 arg0) 0.0) + (vector-reset! arg0) + ) + (vector+! s2-1 s2-1 s4-0) + (vector+! arg0 arg0 s4-0) + (let ((s2-3 (vector-! (new 'stack-no-clear 'vector) (-> s3-1 root trans) arg0))) + 0.0 + (let ((f0-13 (* -0.5 (vector-vector-distance arg0 s4-0)))) + (set! (-> s2-3 y) 0.0) + (.lvf vf1 (&-> s2-3 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-22 vf1) + (let ((f1-3 v1-22) + (f2-0 20480.0) + ) + (if (< (* f2-0 f2-0) f1-3) + (vector-float*! s2-3 s2-3 (/ 20480.0 (sqrtf f1-3))) + ) + ) + (let ((f1-7 (vector-dot s2-3 s5-1))) + (if (< f1-7 f0-13) + (vector-float*! s2-3 s2-3 (/ f0-13 f1-7)) + ) + ) + ) + (vector+! arg0 arg0 s2-3) + ) + ) + ) + ) + arg0 + ) + ) + +;; failed to figure out what this is: +(defstate jump (missile-bot) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + #f + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate knocked (missile-bot) + :virtual #t + :enter (behavior () + (let* ((v1-1 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-2 (the-as number (logior #x3f800000 v1-1))) + ) + (if (< (+ -1.0 (the-as float v1-2)) 0.5) + (set! (-> self spin) 7281.778) + (set! (-> self spin) -7281.778) + ) + ) + (set! (-> self lightning-timer) 0) + (set! (-> self lightning-mode) (the-as uint 0)) + (set! (-> self spin-whoosh-timer) 0) + (let ((t9-1 (-> (method-of-type nav-enemy knocked) enter))) + (if t9-1 + (t9-1) + ) + ) + ) + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy knocked) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (>= (- (current-time) (-> self spin-whoosh-timer)) 0) + (sound-play "mb-spin-whoosh" :position (-> self root trans)) + (let* ((gp-1 (current-time)) + (f30-0 300.0) + (f28-0 0.2) + (f26-0 0.049999997) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> self spin-whoosh-timer) + (+ gp-1 (the int (* f30-0 (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-15))))))) + ) + ) + ) + ) + :post (behavior () + (quaternion-rotate-local-y! (-> self root quat) (-> self root quat) (-> self spin)) + (let ((t9-1 (-> (method-of-type nav-enemy knocked) post))) + (if t9-1 + ((the-as (function none) t9-1)) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate notice (missile-bot) + :virtual #t + :code (behavior () + (ja-no-eval :group! missile-bot-idle-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (go-best-state self) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (missile-bot) + :virtual #t + :trans (behavior () + (nav-enemy-method-172 self) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-virtual active) + ) + ) + ((or (>= 2 (the-as int gp-0)) (not (get-focus! self))) + (go-stare self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + (when (and (-> self enemy-info use-frustration) (logtest? (enemy-flag ef40) (-> self enemy-flags))) + (if (-> self enemy-info use-stop-chase) + (go-virtual stop-chase) + (go-stare self) + ) + ) + ) + (let ((f30-0 (vector-vector-xz-distance-squared (-> self root trans) (target-pos 0)))) + (let* ((gp-2 (-> self nav)) + (t9-11 lerp-scale) + (a0-13 0.0) + (a1-2 (-> self enemy-info run-travel-speed)) + (a2-0 f30-0) + (f0-1 12288.0) + (a3-0 (* f0-1 f0-1)) + (f0-3 16384.0) + ) + (set! (-> gp-2 target-speed) (t9-11 a0-13 a1-2 a2-0 a3-0 (* f0-3 f0-3))) + ) + 0 + (let ((f0-6 16384.0)) + (cond + ((< f30-0 (* f0-6 f0-6)) + (when (zero? (-> self lightning-timer)) + (set! (-> self lightning-mode) (the-as uint 1)) + (set-time! (-> self lightning-timer)) + ) + ) + ((let ((f0-9 24576.0)) + (and (< (* f0-9 f0-9) f30-0) (>= (+ (current-time) (seconds -1)) (-> self lightning-timer))) + ) + (set! (-> self lightning-mode) (the-as uint 0)) + (set! (-> self lightning-timer) 0) + 0 + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (missile-bot) + :virtual #t + :code (behavior () + (go-virtual fizzle) + ) + ) + +;; failed to figure out what this is: +(defstate fizzle (missile-bot) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('attack) + (when (= (-> proc type) target) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (let ((t9-0 missile-bot-find-dest) + (a0-2 gp-0) + ) + 360 + (t9-0 a0-2) + ) + (vector-! gp-0 gp-0 (-> self root trans)) + (let ((s5-0 missile-bot-find-dest) + (s4-0 gp-0) + ) + (+ (the int (missile-bot-get-kick-time (vector-length gp-0))) 360) + (s5-0 s4-0) + ) + (vector-! gp-0 gp-0 (-> self root trans)) + (let* ((f0-2 (vector-length gp-0)) + (f30-0 (fmin 16384.0 (* 0.2 f0-2))) + (f0-3 (missile-bot-get-kick-time f0-2)) + ) + (vector+! gp-0 gp-0 (-> self root trans)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-0 f0-3 f30-0) + ) + ) + (go-virtual kicked) + ) + ) + (('lift-off) + (go-virtual lift-off) + ) + ) + ) + :enter (behavior () + (local-vars (v1-11 enemy-flag) (v1-13 enemy-flag) (v1-15 enemy-flag)) + (set! (-> self root penetrate-using) + (the-as penetrate (logclear (-> self root penetrate-using) (penetrate knocked))) + ) + (enemy-method-50 self 2) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-10 (-> self enemy-flags))) + (if (logtest? v1-10 (enemy-flag vulnerable-backup)) + (set! v1-11 (logior v1-10 (enemy-flag vulnerable))) + (set! v1-11 (logclear v1-10 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-11) + (let ((v1-12 (-> self enemy-flags))) + (if (logtest? v1-12 (enemy-flag attackable-backup)) + (set! v1-13 (logior v1-12 (enemy-flag attackable))) + (set! v1-13 (logclear v1-12 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-13) + (let ((v1-14 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-14) + (set! v1-15 (logior (enemy-flag trackable) v1-14)) + (set! v1-15 (logclear v1-14 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-15) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (set-time! (-> self state-time)) + (let ((v1-23 (-> self root root-prim))) + (set! (-> v1-23 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-23 prim-core collide-with) (-> self root backup-collide-with)) + ) + (set! (-> self lightning-mode) (the-as uint 0)) + (set! (-> self lightning-timer) 0) + (if (send-event (ppointer->process (-> self parent)) 'round? 3) + (factory-boss-play-speech 7 (the-as factory-boss self)) + ) + ) + :trans (behavior () + (spawn + (-> self part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg rotating_ring)) + ) + (cond + ((-> self spark-part-on) + (format *stdebug* "spark-on~%") + (spawn + (-> self spark-part) + (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node missile-bot-lod0-jg rotating_ring)) + ) + (when (>= (- (current-time) (-> self spark-timer)) 0) + (let* ((gp-2 (current-time)) + (f30-0 300.0) + (s5-2 lerp-scale) + (s4-0 0.3) + (s3-0 0.5) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (set! (-> self spark-timer) + (+ gp-2 (the int (* f30-0 (s5-2 s4-0 s3-0 (+ -1.0 (the-as float v1-16)) 0.0 1.0)))) + ) + ) + (set! (-> self spark-part-on) #f) + ) + ) + ((>= (- (current-time) (-> self spark-timer)) 0) + (let* ((gp-3 (current-time)) + (f30-1 300.0) + (s5-3 lerp-scale) + (s4-1 0.2) + (s3-1 0.4) + (v1-27 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-28 (the-as number (logior #x3f800000 v1-27))) + ) + (set! (-> self spark-timer) + (+ gp-3 (the int (* f30-1 (s5-3 s4-1 s3-1 (+ -1.0 (the-as float v1-28)) 0.0 1.0)))) + ) + ) + (set! (-> self spark-part-on) #t) + ) + ) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-virtual lift-off) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate kicked (missile-bot) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('lift-off) + (go-virtual lift-off) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (if (time-elapsed? (-> self state-time) (the int (-> self traj time))) + (go-virtual lift-off) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate lift-off (missile-bot) + :virtual #t + :enter (behavior () + (set! (-> self state-time) 0) + (set! (-> self traj time) 0.0) + (set! (-> self initial-y) (-> self root trans y)) + (set! (-> self explosion-sound-index) 0) + (set! (-> self will-hit-errol) #f) + (let* ((gp-0 (ppointer->process (-> self parent))) + (v1-3 (if (type? gp-0 factory-boss) + gp-0 + ) + ) + ) + (when v1-3 + (let ((f0-2 (vector-vector-xz-distance-squared (-> self root trans) (-> v1-3 root trans))) + (f1-0 20480.0) + ) + (set! (-> self will-hit-errol) (< f0-2 (* f1-0 f1-0))) + ) + ) + ) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (the int (-> self traj time))) + (let ((gp-0 (new 'stack-no-clear 'vector)) + (f30-0 (rand-vu-float-range 1228.8 2048.0)) + (f28-0 (rand-vu-float-range 30.0 120.0)) + ) + (set! (-> gp-0 quad) (-> self root trans quad)) + (+! (-> gp-0 y) (rand-vu-float-range 6144.0 10240.0)) + (setup-from-to-duration-and-height! (-> self traj) (-> self root trans) gp-0 f28-0 f30-0) + ) + (cond + ((logtest? (-> *part-group-id-table* 219 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 219)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 219)) + ) + ) + (when (not (send-event (ppointer->process (-> self parent)) 'in-cutscene?)) + (let ((v1-46 (-> self explosion-sound-index))) + (cond + ((zero? v1-46) + (sound-play "mb-expl-1") + ) + ((= v1-46 1) + (sound-play "mb-expl-2") + ) + ((= v1-46 2) + (sound-play "mb-expl-3") + ) + ((= v1-46 3) + (sound-play "mb-expl-4") + ) + (else + (sound-play "mb-expl-4") + ) + ) + ) + ) + (+! (-> self explosion-sound-index) 1) + (set-time! (-> self state-time)) + ) + (compute-trans-at-time + (-> self traj) + (fmin (-> self traj time) (the float (- (current-time) (-> self state-time)))) + (-> self root trans) + ) + (if (and (-> self will-hit-errol) (< (+ 40960.0 (-> self initial-y)) (-> self root trans y))) + (send-event (ppointer->process (-> self parent)) 'gonna-getcha) + ) + (if (< (+ 49152.0 (-> self initial-y)) (-> self root trans y)) + (go-virtual explode) + ) + ) + :code sleep-code + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate explode (missile-bot) + :virtual #t + :enter (behavior () + (if (not (send-event (ppointer->process (-> self parent)) 'in-cutscene?)) + (sound-play "mb-expl-4") + ) + (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 + (logior! (-> self draw status) (draw-control-status no-draw)) + (set! (-> self root root-prim local-sphere w) 491520.0) + (cond + ((logtest? (-> *part-group-id-table* 217 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 217)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 217)) + ) + ) + (when (-> self will-hit-errol) + (send-event (ppointer->process (-> self parent)) 'gonna-getcha) + (send-event (ppointer->process (-> self parent)) 'gotcha) + ) + ) + :trans (behavior () + (when (not (-> self child)) + (cleanup-for-death self) + (deactivate self) + ) + ) + :code sleep-code + ) + +;; definition for method 59 of type missile-bot +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod enemy-common-post ((this missile-bot)) + (local-vars (sv-272 vector) (sv-288 vector) (sv-304 vector)) + (with-pp + (cond + ((stunned?) + (when (-> this engine-sound-playing) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound-playing) #f) + ) + ) + (else + (+! (-> this top-angle) (* 1747.6267 (-> pp clock time-adjust-ratio))) + (if (< 65536.0 (-> this top-angle)) + (+! (-> this top-angle) -65536.0) + ) + (sound-play "mb-engine-loop" :id (-> this engine-sound) :position (-> this root trans)) + (set! (-> this engine-sound-playing) #t) + ) + ) + (quaternion-axis-angle! (-> this top-spin-jm quat) 0.0 1.0 0.0 (-> this top-angle)) + (update! (-> this height-bob-rand)) + (cond + ((stunned?) + (set! (-> this height-bob osc target) 0.0) + (set! (-> this height-bob osc max-vel) 0.1) + (update! (-> this height-bob) 0.0) + ) + (else + (set! (-> this height-bob osc target) 1.0) + (set! (-> this height-bob osc max-vel) 0.05) + (update! (-> this height-bob) (-> this height-bob-rand value)) + ) + ) + (set! (-> this main-jm trans y) (* 8192.0 (-> this height-bob osc value))) + (update-with-delay! (-> this main-wobble-rand)) + (when (not (stunned?)) + (let ((a1-4 (new 'stack-no-clear 'vector))) + (set! (-> a1-4 quad) (-> this main-wobble-rand value quad)) + (vector+! a1-4 a1-4 (new 'static 'vector :y 1.0)) + (update! (-> this main-wobble) a1-4) + ) + ) + (let ((a2-5 (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this main-wobble)) 1.0))) + (quaternion-from-two-vectors! (-> this main-jm quat) (new 'static 'vector :y 1.0) a2-5) + ) + (let ((t9-13 (method-of-type nav-enemy enemy-common-post))) + (t9-13 this) + ) + (toggle-glow-sprites this #f) + (cond + ((stunned?) + (set! (-> this lightning-timer) 0) + (set! (-> this lightning-mode) (the-as uint 0)) + 0 + ) + (else + (set! (-> *part-id-table* 4558 init-specs 12 initial-valuef) 0.0) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 7)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 8)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 10)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 9)) + (set! (-> *part-id-table* 4558 init-specs 12 initial-valuef) 10922.667) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 7)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 8)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 10)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 9)) + (set! (-> *part-id-table* 4558 init-specs 12 initial-valuef) 21845.334) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 7)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 8)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 10)) + (spawn-from-cspace (-> this thruster-part) (-> this node-list data 9)) + ) + ) + (dotimes (s5-0 3) + (update-with-delay! (-> this lightning-wobble-rand s5-0)) + (let ((a1-20 (new 'stack-no-clear 'vector))) + (set! (-> a1-20 quad) + (-> (the-as (pointer uint128) (+ (the-as uint (-> this lightning-wobble-rand 0 value)) (* 48 s5-0)))) + ) + (update! (-> this lightning-wobble s5-0) a1-20) + ) + ) + (let ((s5-1 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + (s3-0 (new 'stack-no-clear 'vector)) + (s2-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 5))) + (s1-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data 6))) + ) + (dotimes (s0-0 6) + (let ((v1-85 s0-0)) + (cond + ((zero? v1-85) + (vector<-cspace! s5-1 (-> this node-list data 3)) + (+! (-> s5-1 y) 8192.0) + (let ((v0-33 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this lightning-wobble)) 819.2) + ) + ) + (vector+! s5-1 s5-1 v0-33) + ) + (set! sv-304 s4-0) + (let ((v1-90 (-> s2-0 quad))) + (set! (-> sv-304 quad) v1-90) + ) + ) + ((= v1-85 1) + (set! sv-304 s4-0) + (let ((v1-92 (-> s1-0 quad))) + (set! (-> sv-304 quad) v1-92) + ) + ) + ((= v1-85 2) + (set! sv-272 s3-0) + (let ((v1-93 (-> (target-pos 8) quad))) + (set! (-> sv-272 quad) v1-93) + ) + (vector-! s5-1 s3-0 s2-0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 4096.0) + (vector+! s5-1 s5-1 s2-0) + (+! (-> s5-1 y) 4096.0) + (let ((v0-36 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this lightning-wobble 1)) 819.2) + ) + ) + (vector+! s5-1 s5-1 v0-36) + ) + (set! sv-304 s4-0) + (let ((v1-99 (-> s2-0 quad))) + (set! (-> sv-304 quad) v1-99) + ) + ) + ((= v1-85 3) + (set! sv-304 s4-0) + (let ((v1-101 (-> s3-0 quad))) + (set! (-> sv-304 quad) v1-101) + ) + ) + ((= v1-85 4) + (set! sv-288 s3-0) + (let ((v1-102 (-> (target-pos 8) quad))) + (set! (-> sv-288 quad) v1-102) + ) + (vector-! s5-1 s3-0 s1-0) + (set! (-> s5-1 y) 0.0) + (vector-normalize! s5-1 4096.0) + (vector+! s5-1 s5-1 s1-0) + (+! (-> s5-1 y) 4096.0) + (let ((v0-39 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (the-as vector (-> this lightning-wobble 2)) 819.2) + ) + ) + (vector+! s5-1 s5-1 v0-39) + ) + (set! sv-304 s4-0) + (let ((v1-108 (-> s1-0 quad))) + (set! (-> sv-304 quad) v1-108) + ) + ) + (else + (set! sv-304 s4-0) + (let ((v1-109 (-> (target-pos 6) quad))) + (set! (-> sv-304 quad) v1-109) + ) + ) + ) + ) + (let ((a0-64 (-> this lightning s0-0)) + (v1-112 s5-1) + ) + (set! (-> a0-64 state meet data 0 quad) (-> v1-112 quad)) + ) + (let ((a0-67 (-> this lightning s0-0)) + (v1-116 s4-0) + ) + (set! (-> a0-67 state meet data (+ (-> a0-67 state points-to-draw) -1) quad) (-> v1-116 quad)) + ) + (cond + ((or (= (-> this lightning-mode) 2) (and (= (-> this lightning-mode) 1) (< s0-0 2))) + (let ((v1-126 (-> this lightning s0-0 state mode))) + (when (or (zero? v1-126) (= v1-126 3)) + (let ((v1-130 (-> this lightning s0-0)) + (a0-74 1) + ) + (let ((a1-45 (!= a0-74 (-> v1-130 state mode)))) + (case a0-74 + ((3) + (if a1-45 + (set! (-> v1-130 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-130 state start-color) (-> v1-130 spec start-color)) + (set! (-> v1-130 state end-color) (-> v1-130 spec end-color)) + ) + ) + ) + (set! (-> v1-130 state mode) (the-as uint a0-74)) + ) + ) + ) + ) + (else + (let ((v1-134 (-> this lightning s0-0 state mode))) + (cond + ((or (zero? v1-134) (= v1-134 3)) + ) + (else + (let ((v1-138 (-> this lightning s0-0)) + (a0-77 3) + ) + (let ((a1-55 (!= a0-77 (-> v1-138 state mode)))) + (case a0-77 + ((3) + (if a1-55 + (set! (-> v1-138 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-138 state start-color) (-> v1-138 spec start-color)) + (set! (-> v1-138 state end-color) (-> v1-138 spec end-color)) + ) + ) + ) + (set! (-> v1-138 state mode) (the-as uint a0-77)) + ) + ) + ) + ) + ) + ) + (cond + ((or (zero? (-> this lightning-timer)) (zero? (-> this lightning-mode))) + (when (-> this lightning-sound-playing) + (sound-stop (-> this lightning-sound)) + (set! (-> this lightning-sound-playing) #f) + ) + ) + (else + (let ((f0-26 (if (= (-> this lightning-mode) 1) + 0.5 + 1.0 + ) + ) + ) + (sound-play-by-name + (static-sound-name "mb-arc") + (-> this lightning-sound) + (the int (* 1024.0 f0-26)) + 0 + 0 + (sound-group) + (-> this root trans) + ) + ) + (set! (-> this lightning-sound-playing) #t) + (cond + ((>= (+ (current-time) (seconds -4)) (-> this lightning-timer)) + (set! (-> this lightning-timer) 0) + (set! (-> this lightning-mode) (the-as uint 0)) + 0 + ) + ((>= (+ (current-time) (seconds -3.4)) (-> this lightning-timer)) + (send-event + *target* + '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 'shock) + (shove-up (meters 2)) + (shove-back (meters 4)) + ) + ) + ) + ) + ((>= (+ (current-time) (seconds -3)) (-> this lightning-timer)) + (set! (-> this lightning-mode) (the-as uint 2)) + ) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 67 of type missile-bot +(defmethod coin-flip? ((this missile-bot)) + #f + ) + +;; definition for method 7 of type missile-bot +;; WARN: Return type mismatch nav-enemy vs missile-bot. +(defmethod relocate ((this missile-bot) (offset int)) + (if (nonzero? (-> this top-spin-jm)) + (&+! (-> this top-spin-jm) offset) + ) + (if (nonzero? (-> this main-jm)) + (&+! (-> this main-jm) offset) + ) + (if (nonzero? (-> this thruster-part)) + (&+! (-> this thruster-part) offset) + ) + (if (nonzero? (-> this spark-part)) + (&+! (-> this spark-part) offset) + ) + (dotimes (v1-16 6) + (if (nonzero? (-> this lightning v1-16)) + (&+! (-> this lightning v1-16) offset) + ) + ) + (the-as missile-bot ((method-of-type nav-enemy relocate) this offset)) + ) + +;; definition for method 10 of type missile-bot +(defmethod deactivate ((this missile-bot)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (when (-> this engine-sound-playing) + (sound-stop (-> this engine-sound)) + (set! (-> this engine-sound-playing) #f) + ) + (when (-> this lightning-sound-playing) + (sound-stop (-> this lightning-sound)) + (set! (-> this lightning-sound-playing) #f) + ) + (if (nonzero? (-> this thruster-part)) + (kill-particles (-> this thruster-part)) + ) + (if (nonzero? (-> this spark-part)) + (kill-particles (-> this spark-part)) + ) + ((method-of-type nav-enemy deactivate) this) + (none) + ) + +;; definition for method 50 of type missile-bot +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this missile-bot) (arg0 int)) + (let ((v1-3 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 0)) + (a0-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1)) + ) + (cond + ((or (zero? arg0) (= arg0 2)) + (set! (-> v1-3 prim-core action) (collide-action)) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + (set! (-> a0-4 prim-core action) (collide-action solid no-standon)) + (set! (-> a0-4 prim-core collide-as) (collide-spec enemy)) + (set! (-> a0-4 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + ) + ((= arg0 1) + (set! (-> v1-3 prim-core action) (collide-action solid)) + (set! (-> v1-3 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-3 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list)) + (set! (-> a0-4 prim-core action) (collide-action)) + (set! (-> a0-4 prim-core collide-as) (collide-spec)) + (set! (-> a0-4 prim-core collide-with) (collide-spec)) + 0 + ) + ) + ) + (none) + ) + +;; definition for method 120 of type missile-bot +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this missile-bot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 3) 0))) + (set! (-> s5-0 total-prims) (the-as uint 4)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy los-blocker)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 8192.0 0.0 12288.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-12 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-12 prim-core collide-as) (collide-spec)) + (set! (-> v1-12 prim-core collide-with) (collide-spec)) + (set! (-> v1-12 prim-core action) (collide-action solid)) + (set-vector! (-> v1-12 local-sphere) 0.0 5734.4 0.0 5734.4) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) + (collide-spec backgnd jak bot enemy obstacle hit-by-others-list player-list) + ) + (set! (-> v1-14 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-14 transform-index) 3) + (set-vector! (-> v1-14 local-sphere) 0.0 0.0 0.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec los-blocker)) + (set! (-> v1-16 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-16 local-sphere) 0.0 8192.0 0.0 11468.8) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 121 of type missile-bot +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this missile-bot)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-missile-bot" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> this enemy-flags) + (the-as enemy-flag (logior (enemy-flag no-initial-move-to-ground) (-> this enemy-flags))) + ) + (init-enemy-defaults! this *missile-bot-nav-enemy-info*) + (set! (-> this top-angle) 0.0) + (set! (-> this top-spin-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 4)) + (set! (-> this top-spin-jm track-mode) (track-mode no-trans no-scale)) + (set! (-> this main-jm) (new 'process 'joint-mod (joint-mod-mode joint-set*) this 3)) + (set! (-> this main-jm track-mode) (track-mode no-scale)) + (set-params! (-> this height-bob) 0.0 2.0 0.0 0.7 0.08 0.1 0.9) + (set-params! (-> this height-bob-rand) 90 180 0.02) + (set-params! (-> this main-wobble) (the-as vector #f) 0.01 0.1 0.9) + (set-params! (-> this main-wobble-rand) 30 60 0.1 0.1) + (dotimes (s5-1 3) + (set-params! (-> this lightning-wobble s5-1) (the-as vector #f) 0.1 0.2 0.7) + (set-params! (-> this lightning-wobble-rand s5-1) 3 15 0.1 0.1) + ) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1368) this)) + (set! (-> this thruster-part) (create-launch-control (-> *part-group-id-table* 1370) this)) + (set! (-> this spark-part) (create-launch-control (-> *part-group-id-table* 1369) this)) + (logior! (-> this skel status) (joint-control-status sync-math)) + (set! (-> this glows-on) #f) + (toggle-glow-sprites this #t) + (set! (-> this lightning-mode) (the-as uint 0)) + (set! (-> this lightning-timer) 0) + (dotimes (s5-2 6) + (set! (-> this lightning s5-2) (new + 'process + 'lightning-control + (new 'static 'lightning-spec + :name #f + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :end-color (new 'static 'rgba :r #x80 :g #x80 :b #x80 :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :fade-time 120.0 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 8 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 512.0 + :duration -1.0 + :sound #f + ) + this + 0.0 + ) + ) + (let ((v1-50 (-> this lightning s5-2)) + (a0-21 0) + ) + (let ((a1-17 (!= a0-21 (-> v1-50 state mode)))) + (case a0-21 + ((3) + (if a1-17 + (set! (-> v1-50 state counter) 0.0) + ) + ) + ((1) + (set! (-> v1-50 state start-color) (-> v1-50 spec start-color)) + (set! (-> v1-50 state end-color) (-> v1-50 spec end-color)) + ) + ) + ) + (set! (-> v1-50 state mode) (the-as uint a0-21)) + ) + ) + (set! (-> this engine-sound) (new-sound-id)) + (set! (-> this engine-sound-playing) #f) + (set! (-> this lightning-sound) (new-sound-id)) + (set! (-> this lightning-sound-playing) #f) + (set! (-> this event-hook) enemy-event-handler) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc new file mode 100644 index 0000000000..5d9f546f5a --- /dev/null +++ b/test/decompiler/reference/jak3/levels/factory/warf-projectile_REF.gc @@ -0,0 +1,1657 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 2893 + :init-specs ((:texture (gun-yellow-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 30)) + (:r 0.0) + (:g 255.0) + (:b 255.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:fade-a -3.2) + (:timer (seconds 0.1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 2894 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 8) (meters 1)) + (:rot-x (degrees 4.5)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 255.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.067)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 2895 + :init-specs ((:texture (radial-gradient-yellow level-default-sprite)) + (:num 4.0 8.0) + (:z (meters 0) (meters -4)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.6) + (:fade-g 0.8) + (:fade-b 1.6) + (:timer (seconds 0.535)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2896 + :init-specs ((:texture (gun-yellow-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters 0.05)) + (:fade-r -3.6571429) + (:fade-b -3.6571429) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-gun-warf-shot-hit + :id 776 + :duration (seconds 1.5) + :linger-duration (seconds 0.5) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2897 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2898 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2899 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2900 :period (seconds 30) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 2897 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2898 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0 10.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 120.0) + (:g 255.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.016666668)) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.4) + (:fade-b -0.13333334) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.93) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2899 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 60.0) + (:g 128.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2900 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 5.0) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 80.0 20.0) + (:g 128.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.26666668) + (:fade-b -0.1) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.99) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition of type warf-explosion-sphere +(deftype warf-explosion-sphere (process-drawable) + ((current-alpha float) + (expanding? symbol :offset 216) + ) + (:state-methods + active + ) + (:methods + (warf-explosion-sphere-method-21 (_type_) none) + (warf-explosion-sphere-method-22 (_type_) none) + ) + ) + +;; definition for method 3 of type warf-explosion-sphere +(defmethod inspect ((this warf-explosion-sphere)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tcurrent-alpha: ~f~%" (-> this current-alpha)) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Texpanding?: ~A~%" (-> this expanding?)) + (label cfg-4) + this + ) + +;; definition of type warf-explosion-sphere-init-params +(deftype warf-explosion-sphere-init-params (structure) + ((pos vector :inline) + ) + ) + +;; definition for method 3 of type warf-explosion-sphere-init-params +(defmethod inspect ((this warf-explosion-sphere-init-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'warf-explosion-sphere-init-params) + (format #t "~1Tpos: #~%" (-> this pos)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-warf-explosion-sphere hemisplosion hemisplosion-lod0-jg hemisplosion-idle-ja + ((hemisplosion-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 4) + ) + +;; definition for function warf-explosion-sphere-init-by-other +;; INFO: Used lq/sq +(defbehavior warf-explosion-sphere-init-by-other warf-explosion-sphere ((arg0 warf-explosion-sphere-init-params)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self level) (level-get *level* 'factoryb)) + (initialize-skeleton + self + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-warf-explosion-sphere" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> self root trans quad) (-> arg0 pos quad)) + (quaternion-identity! (-> self root quat)) + (set! (-> self draw lod-set lod 0 dist) 14336000.0) + (set! (-> self expanding?) #t) + (go-virtual active) + ) + +;; definition for function warf-explosion-sphere-event-handler +;; WARN: Return type mismatch symbol vs object. +(defbehavior warf-explosion-sphere-event-handler warf-explosion-sphere ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('dissapate) + (set! (-> self expanding?) #f) + #f + ) + ) + ) + +;; failed to figure out what this is: +(defstate active (warf-explosion-sphere) + :virtual #t + :event warf-explosion-sphere-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set-vector! (-> self root scale) 1.0 1.0 1.0 1.0) + ) + :trans (behavior () + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let* ((a2-0 (math-camera-matrix)) + (v1-0 (-> a2-0 rvec quad)) + (a0-0 (-> a2-0 uvec quad)) + (a1-0 (-> a2-0 fvec quad)) + (a2-1 (-> a2-0 trans quad)) + ) + (set! (-> gp-0 rvec quad) v1-0) + (set! (-> gp-0 uvec quad) a0-0) + (set! (-> gp-0 fvec quad) a1-0) + (set! (-> gp-0 trans quad) a2-1) + ) + (let ((a1-1 (-> gp-0 fvec)) + (v1-1 (-> gp-0 rvec)) + ) + (vector-float*! a1-1 a1-1 -1.0) + (vector-float*! v1-1 v1-1 -1.0) + ) + (matrix->quat gp-0 (-> self root quat)) + ) + (set! (-> self current-alpha) (* 0.008333334 (the float (- (current-time) (-> self state-time))))) + (let ((f0-4 (-> self root scale x))) + (if (-> self expanding?) + (+! f0-4 (* 120.0 (seconds-per-frame))) + ) + (set-vector! (-> self root scale) f0-4 f0-4 f0-4 1.0) + (set! (-> self draw bounds w) (* 4505.6 f0-4)) + ) + (set-vector! (-> self draw color-mult) 0.0 0.0 0.0 1.0) + (set-vector! (-> self draw color-emissive) 1.0 1.0 1.0 1.0) + ) + :code (behavior () + (while (-> self expanding?) + (suspend) + ) + (let ((f30-0 1.0)) + (while (< 0.0 f30-0) + (set! f30-0 (seek f30-0 0.0 (* 2.0 (seconds-per-frame)))) + (set-vector! (-> self draw color-emissive) f30-0 f30-0 f30-0 1.0) + (suspend) + ) + ) + (deactivate self) + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition of type warf-projectile +(deftype warf-projectile (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + (hit-pos vector :inline) + (last-hit-time time-frame) + (snd-whoosh sound-id) + (muzzle-flash-part sparticle-launch-control :offset 576) + ) + (:methods + (warf-projectile-method-41 (_type_) none) + (warf-projectile-method-42 (_type_ vector) none) + (warf-projectile-method-43 (_type_) none) + (send-attack (_type_ process-focusable) none) + (warf-projectile-method-45 (_type_) none) + ) + ) + +;; definition for method 3 of type warf-projectile +(defmethod inspect ((this warf-projectile)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tsnd-whoosh: ~D~%" (-> this snd-whoosh)) + (format #t "~2Tattack-id: ~D~%" (-> this attack-id)) + (format #t "~2Tmuzzle-flash-part: ~A~%" (-> this muzzle-flash-part)) + (label cfg-4) + this + ) + +;; definition of type fac-gun-tower-projectile +(deftype fac-gun-tower-projectile (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + ) + ) + +;; definition for method 3 of type fac-gun-tower-projectile +(defmethod inspect ((this fac-gun-tower-projectile)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (label cfg-4) + this + ) + +;; definition for function spawn-warf-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-warf-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-14 *game-info*) + (a1-11 (+ (-> a0-14 attack-id) 1)) + ) + (set! (-> a0-14 attack-id) a1-11) + (set! (-> gp-0 attack-id) a1-11) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 1.0) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-damage-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po15)) + (set! (-> gp-0 vehicle-impulse-factor) 2.0) + (logior! (-> gp-0 options) (projectile-options po16)) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (set! (-> gp-0 timeout) (the-as time-frame (the int (* 300.0 (/ 2457600.0 arg3))))) + (the-as projectile (spawn-projectile warf-projectile gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; definition for function spawn-fac-gun-tower-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs projectile. +(defun spawn-fac-gun-tower-projectile ((arg0 process) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((v1-1 (vector-! (new 'stack-no-clear 'vector) arg2 arg1))) + (set! (-> gp-0 ent) (-> arg0 entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> arg1 quad)) + (set! (-> gp-0 notify-handle) (process->handle arg0)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle arg0)) + (let* ((a0-14 *game-info*) + (a1-11 (+ (-> a0-14 attack-id) 1)) + ) + (set! (-> a0-14 attack-id) a1-11) + (set! (-> gp-0 attack-id) a1-11) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (vector-normalize-copy! (-> gp-0 vel) v1-1 arg3) + ) + (set! (-> gp-0 timeout) (the-as time-frame (the int (* 300.0 (/ 2457600.0 arg3))))) + (the-as projectile (spawn-projectile fac-gun-tower-projectile gp-0 arg0 *default-dead-pool*)) + ) + ) + +;; definition for method 25 of type warf-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this warf-projectile)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((gp-0 (-> this root trans)) + (v1-1 (-> this tail-pos)) + (s5-1 (vector-! (new 'stack-no-clear 'vector) gp-0 v1-1)) + (f30-0 (vector-length s5-1)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((a0-4 s5-1)) + (let ((a1-2 0.8)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-4 quad)) + ) + (.lvf vf4 (&-> v1-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-0 quad) vf6) + (vector-normalize! s5-1 1.0) + (warf-projectile-method-42 this s3-0) + ) + (let ((s4-1 (new 'stack-no-clear 'matrix))) + (fmin 1.0 (* 0.0000061035157 f30-0)) + (-> *part-id-table* 2895 init-specs 3 initial-valuef) + (forward-up->inv-matrix s4-1 s5-1 *up-vector*) + (set! (-> s4-1 trans quad) (-> gp-0 quad)) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 30 of type warf-projectile +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this warf-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) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd bot crate civilian obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec backgnd bot crate civilian obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 45 of type warf-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod warf-projectile-method-45 ((this warf-projectile)) + (when (time-elapsed? (-> this spawn-time) (seconds 0.5)) + (set! (-> this hit-pos quad) (-> this root trans quad)) + (go (method-of-object this impact)) + ) + 0 + (none) + ) + +;; definition for function warf-projectile-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun warf-projectile-move ((arg0 warf-projectile)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 163840.0 f0-0) + (vector-normalize! s4-0 163840.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (warf-projectile-method-45 arg0) + (when (and (logtest? (-> s5-0 status) (collide-status touch-surface)) + (not (vector= (-> arg0 hit-pos) (-> arg0 root trans))) + ) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (let ((v1-19 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-6 (-> arg0 hit-pos)) + ) + (set! (-> a1-6 quad) (-> s5-0 trans quad)) + (vector+! a1-6 a1-6 v1-19) + (move-to-point! (-> arg0 root) a1-6) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 44 of type warf-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod send-attack ((this warf-projectile) (arg0 process-focusable)) + (with-pp + (let* ((v1-1 (get-trans arg0 3)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) v1-1 (-> this root trans))) + ) + (when (< (vector-length s4-1) (-> this hit-pos w)) + (when (not (type? arg0 h-warf)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) (process->ppointer pp)) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'attack) + (set! (-> a1-3 param 0) (the-as uint #f)) + (let ((v1-9 (new 'static 'attack-info :mask (attack-mask + trans + mode + id + penetrate-using + attacker-velocity + damage + vehicle-damage-factor + vehicle-impulse-factor + ) + ) + ) + ) + (set! (-> v1-9 id) (-> this attack-id)) + (set! (-> v1-9 damage) 128.0) + (set! (-> v1-9 vehicle-damage-factor) 1.0) + (set! (-> v1-9 vehicle-impulse-factor) 0.0) + (set! (-> v1-9 mode) 'explode) + (set! (-> v1-9 attacker-velocity quad) (-> s4-1 quad)) + (set! (-> v1-9 trans quad) (-> this root trans quad)) + (set! (-> v1-9 penetrate-using) (penetrate explode enemy-yellow-shot)) + (set! (-> a1-3 param 1) (the-as uint v1-9)) + ) + (send-event-function arg0 a1-3) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 43 of type warf-projectile +;; WARN: Return type mismatch int vs none. +(defmethod warf-projectile-method-43 ((this warf-projectile)) + (let ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s4-0 (fill-actor-list-for-box *actor-hash* (-> this hit-pos) s5-0 384)) + (let* ((s3-0 (-> s5-0 s4-0)) + (v1-3 (if (type? s3-0 collide-shape) + s3-0 + ) + ) + ) + (when v1-3 + (let* ((s3-1 (-> v1-3 process)) + (a1-3 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when a1-3 + (if (and (!= *target* a1-3) + (not (logtest? (-> (the-as process-focusable a1-3) focus-status) (focus-status disable dead inactive))) + ) + (send-attack this (the-as process-focusable a1-3)) + ) + ) + ) + ) + ) + ) + ) + (let* ((s4-1 *target*) + (s5-1 (if (type? s4-1 process-focusable) + s4-1 + ) + ) + ) + (when (and s5-1 (< (vector-vector-distance (get-trans s5-1 0) (-> this hit-pos)) (-> this hit-pos w))) + (if (and (!= *target* s5-1) (not (logtest? (-> s5-1 focus-status) (focus-status disable dead inactive)))) + (send-attack this s5-1) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 40 of type warf-projectile +(defmethod projectile-method-40 ((this warf-projectile)) + 128 + ) + +;; failed to figure out what this is: +(defstate impact (warf-projectile) + :virtual #t + :enter (behavior () + (local-vars (sv-32 int)) + (set! (-> self hit-pos w) 0.0) + (kill-particles (-> self part)) + (let ((gp-0 (new 'stack-no-clear 'warf-explosion-sphere-init-params))) + (set! (-> gp-0 pos quad) (-> self hit-pos quad)) + (let ((s5-0 sound-play-by-name) + (sname (static-sound-name "impact-trigger2")) + (s3-0 (new-sound-id)) + (s2-0 1024) + (s1-0 0) + (s0-0 0) + ) + (set! sv-32 0) + (let ((t2-0 (target-pos 0))) + (s5-0 (the-as sound-name sname) s3-0 s2-0 s1-0 s0-0 (the-as sound-group sv-32) t2-0) + ) + ) + (process-spawn warf-explosion-sphere gp-0 :name "warf-explosion-sphere" :to self) + ) + (let ((t9-8 (-> (find-parent-state) enter))) + (if t9-8 + (t9-8) + ) + ) + ) + :code (behavior () + (while (< (-> self hit-pos w) 245760.0) + (warf-projectile-method-43 self) + (seek! (-> self hit-pos w) 245760.0 (* 491520.0 (seconds-per-frame))) + (suspend) + ) + (send-event (ppointer->process (-> self child)) 'dissapate) + (while (-> self child) + (suspend) + ) + ) + ) + +;; definition for function spt-func-factory-move +;; WARN: Return type mismatch float vs none. +(defun spt-func-factory-move ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (let* ((v1-1 (-> arg1 key proc)) + (v1-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> v1-1 root quat))) + ) + (vector-float*! v1-3 v1-3 (* (-> arg1 user-float) (seconds-per-frame))) + (+! (-> arg2 x-y-z-sx x) (-> v1-3 x)) + (+! (-> arg2 x-y-z-sx y) (-> v1-3 y)) + (+! (-> arg2 x-y-z-sx z) (-> v1-3 z)) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-fac-guntower-particle + :id 777 + :duration (seconds 4) + :linger-duration (seconds 4) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 2901 :flags (sp7)) + (sp-item 2902 :flags (sp7)) + (sp-item 2903 :flags (sp7)) + (sp-item 2904 :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 2901 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 80.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2902 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 15)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 10.0) + (:b 10.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2903 + :init-specs ((:texture (splash-foam level-default-sprite)) + (:num 3.0) + (:scale-x (meters 2) (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 40.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpart 2904 + :init-specs ((:texture (diamond-star level-default-sprite)) + (:num 20.0) + (:x (meters -2) (meters 4)) + (:y (meters -2) (meters 4)) + (:z (meters 0) (meters -20)) + (:scale-x (meters 0.5) (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 30.0 30.0) + (:b 10.0) + (:a 128.0) + (:scalevel-x (meters -0.002) (meters -0.002)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters 0) (meters -0.00016666666)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 launch-along-z)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-factory-vehicle-shot + :id 778 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 100) + :parts ((sp-item 2905 :flags (sp3 sp7)) + (sp-item 2906 :flags (sp3 sp7)) + (sp-item 2907 :flags (sp7)) + (sp-item 2908 :flags (sp7)) + ) + ) + +;; definition for method 31 of type warf-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this warf-projectile)) + (set! (-> this hit-actor?) #f) + (set! (-> this hit-pos quad) (the-as uint128 0)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'guard-shot) + (set! (-> this max-speed) 327680.0) + (set! (-> this move) warf-projectile-move) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this muzzle-flash-part) (the-as sparticle-launch-control (-> *part-id-table* 2896))) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 778) this)) + (let* ((v1-12 *game-info*) + (a0-6 (+ (-> v1-12 attack-id) 1)) + ) + (set! (-> v1-12 attack-id) a0-6) + (set! (-> this attack-id) a0-6) + ) + 0 + (none) + ) + +;; definition for method 24 of type warf-projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this warf-projectile)) + (draw-beam + (the-as sparticle-launcher (-> this muzzle-flash-part)) + (-> this tail-pos) + (-> this starting-dir) + #f + ) + 0 + (none) + ) + +;; definition for method 41 of type warf-projectile +;; WARN: Return type mismatch int vs none. +(defmethod warf-projectile-method-41 ((this warf-projectile)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpart 2909 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 4) (meters 0.2)) + (:rot-x (degrees 4.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0) + (:b 128.0) + (:a 196.0) + (:omega (degrees 6763.5)) + (:fade-a -0.3) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:userdata 0.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2905 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -0.1)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-factory-move) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2906 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 2.0) + (:scale-x (meters 3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees 0.1)) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-factory-move) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2907 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 8.0) + (:x (meters 9)) + (:scale-x (meters 9)) + (:scale-y (meters 2)) + (:r 80.0) + (:g 80.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters -0.03)) + (:accel-x (meters -0.0016666667)) + (:friction 0.98 0.01) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-part-crystal-torpedo-in) + (:next-time (seconds 0.017)) + (:next-launcher 2910) + (:rotate-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2910 + :init-specs ((:fade-a 1.28) (:next-time (seconds 0.167)) (:next-launcher 2911)) + ) + +;; failed to figure out what this is: +(defpart 2911 + :init-specs ((:fade-a -1.28)) + ) + +;; definition for function spt-func-part-crystal-torpedo-in +(defun spt-func-part-crystal-torpedo-in ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (spt-func-factory-move arg0 arg1 arg2) + (sparticle-2d-spline-align-instant arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpart 2908 + :init-specs ((:texture (colorflash level-default-sprite)) + (:num 4.0) + (:x (meters 1)) + (:scale-x (meters 0.1)) + (:scale-y (meters 2)) + (:r 80.0) + (:g 80.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0)) + (:accel-x (meters 0.006666667)) + (:friction 0.99 0.01) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 0.0) + (:func 'spt-func-part-crystal-torpedo-out) + (:next-time (seconds 0.017)) + (:next-launcher 2912) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-x (degrees 0) (degrees 3600)) + (:rotate-y (degrees 0) (degrees 3600)) + (:rotate-z (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2912 + :init-specs ((:scalevel-x (meters 0.033333335)) + (:fade-a 1.28) + (:friction 0.93 0.01) + (:next-time (seconds 0.167)) + (:next-launcher 2913) + ) + ) + +;; failed to figure out what this is: +(defpart 2913 + :init-specs ((:fade-a -1.28)) + ) + +;; definition for function spt-func-part-crystal-torpedo-out +(defun spt-func-part-crystal-torpedo-out ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sprite-vec-data-2d)) + (spt-func-factory-move arg0 arg1 arg2) + (sparticle-2d-spline-align-instant arg0 arg1 arg2) + (none) + ) + +;; definition for method 42 of type warf-projectile +;; WARN: Return type mismatch int vs none. +(defmethod warf-projectile-method-42 ((this warf-projectile) (arg0 vector)) + (the int (* 255.0 (/ (the float (- (current-time) (-> this spawn-time))) (the float (-> this timeout))))) + (set! (-> *part-id-table* 2905 init-specs 12 initial-valuef) (vector-length (-> this root transv))) + (set! (-> *part-id-table* 2906 init-specs 12 initial-valuef) (vector-length (-> this root transv))) + (set! (-> *part-id-table* 2907 init-specs 14 initial-valuef) (vector-length (-> this root transv))) + (set! (-> *part-id-table* 2908 init-specs 14 initial-valuef) (vector-length (-> this root transv))) + (spawn (-> this part) arg0) + 0 + (none) + ) + +;; definition for method 37 of type warf-projectile +(defmethod deal-damage! ((this warf-projectile) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition of type gun-warf-shot +(deftype gun-warf-shot (projectile) + ((hit-actor? symbol) + (tail-pos vector :inline) + (hit-pos vector :inline) + (last-hit-time time-frame) + (snd-whoosh sound-id) + (muzzle-flash-part sparticle-launch-control) + (main-shot-part sparticle-launch-control) + (shot-aim-part sparticle-launch-control) + ) + (:methods + (gun-warf-shot-method-41 (_type_ vector vector) none) + (gun-warf-shot-method-42 (_type_ float float matrix) none) + (launch-part (_type_ vector) none) + ) + ) + +;; definition for method 3 of type gun-warf-shot +(defmethod inspect ((this gun-warf-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Thit-actor?: ~A~%" (-> this hit-actor?)) + (format #t "~2Ttail-pos: #~%" (-> this tail-pos)) + (format #t "~2Thit-pos: #~%" (-> this hit-pos)) + (format #t "~2Tlast-hit-time: ~D~%" (-> this last-hit-time)) + (format #t "~2Tsnd-whoosh: ~D~%" (-> this snd-whoosh)) + (format #t "~2Tmuzzle-flash-part: ~A~%" (-> this muzzle-flash-part)) + (format #t "~2Tmain-shot-part: ~A~%" (-> this main-shot-part)) + (format #t "~2Tshot-aim-part: ~A~%" (-> this shot-aim-part)) + (label cfg-4) + this + ) + +;; definition for method 24 of type gun-warf-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-24 ((this gun-warf-shot)) + (draw-beam + (the-as sparticle-launcher (-> this muzzle-flash-part)) + (-> this tail-pos) + (-> this starting-dir) + #f + ) + 0 + (none) + ) + +;; definition for method 25 of type gun-warf-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this gun-warf-shot)) + (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 (-> this root trans)) + (a1-0 (-> this tail-pos)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-0 a1-0)) + (f30-0 (vector-length s4-1)) + ) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (let ((v1-4 a1-0)) + (let ((a0-2 s4-1)) + (let ((a2-1 0.8)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a0-2 quad)) + ) + (.lvf vf4 (&-> v1-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s3-0 quad) vf6) + (gun-warf-shot-method-41 this a1-0 s4-1) + (vector-normalize! s4-1 1.0) + (launch-part this s3-0) + ) + (let ((s3-1 (new 'stack-no-clear 'matrix)) + (f30-1 (fmin 1.0 (* 0.000008138021 f30-0))) + (f28-0 (-> *part-id-table* 2895 init-specs 3 initial-valuef)) + ) + (forward-up->inv-matrix s3-1 s4-1 *up-vector*) + (set! (-> s3-1 trans quad) (-> s5-0 quad)) + (gun-warf-shot-method-42 this f30-1 f28-0 s3-1) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 37 of type gun-warf-shot +(defmethod deal-damage! ((this gun-warf-shot) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition for method 37 of type fac-gun-tower-projectile +(defmethod deal-damage! ((this fac-gun-tower-projectile) (arg0 process) (arg1 event-message-block)) + (let ((t9-0 (method-of-type projectile deal-damage!))) + (when (t9-0 this arg0 arg1) + (set! (-> this hit-actor?) #t) + #t + ) + ) + ) + +;; definition for function fac-gun-tower-projectile-move +;; WARN: Return type mismatch int vs none. +(defun fac-gun-tower-projectile-move ((arg0 fac-gun-tower-projectile)) + (projectile-move-fill-line-sphere arg0) + (let ((s4-0 (-> arg0 root)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (vector-! gp-0 (-> arg0 tail-pos) (-> s4-0 trans)) + (let ((f0-0 (vector-length gp-0))) + (when (< 65536.0 f0-0) + (vector-normalize! gp-0 65536.0) + (vector+! (-> arg0 tail-pos) (-> s4-0 trans) gp-0) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate impact (fac-gun-tower-projectile) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type projectile impact) enter))) + (if t9-0 + (t9-0) + ) + ) + ) + :code (behavior () + '() + ) + ) + +;; definition for method 25 of type fac-gun-tower-projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this fac-gun-tower-projectile)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let* ((a1-0 (-> this root trans)) + (v1-1 (-> this tail-pos)) + (a2-1 (vector-! (new 'stack-no-clear 'vector) a1-0 v1-1)) + (a1-1 (new 'stack-no-clear 'vector)) + ) + (let ((a3-2 0.8)) + (.mov vf7 a3-2) + ) + (.lvf vf5 (&-> a2-1 quad)) + (.lvf vf4 (&-> v1-1 quad)) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-1 quad) vf6) + (spawn (-> this part) a1-1) + ) + 0 + (none) + ) + ) + +;; definition for method 28 of type fac-gun-tower-projectile +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this fac-gun-tower-projectile) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "gtower-fire") + ) + ((= v1-0 (projectile-options po0 po1)) + (let ((f0-0 (doppler-pitch-shift (-> this root trans) (-> this root transv))) + (a0-7 (static-sound-spec "tower-doppler" :group 0 :volume 0.0 :mask (pitch reg0))) + ) + (set! (-> a0-7 volume) 1024) + (set! (-> a0-7 pitch-mod) (the int (* 1524.0 f0-0))) + (sound-play-by-spec a0-7 (-> this sound-id) (-> this root trans)) + ) + ) + ((= v1-0 (projectile-options po0)) + (sound-play "laser-ricochets") + ) + ) + ) + 0 + (none) + ) + +;; definition for method 26 of type fac-gun-tower-projectile +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this fac-gun-tower-projectile)) + (let ((s4-1 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this tail-pos))) + (s3-0 + (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> this tail-pos) (-> this root trans)) 2048.0) + ) + (gp-0 (new 'stack-no-clear 'matrix)) + ) + (forward-up->inv-matrix gp-0 s4-1 *up-vector*) + (vector+! (-> gp-0 trans) (-> this root trans) s3-0) + (cond + ((-> this hit-actor?) + (if (logtest? (-> *part-group-id-table* 734 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 734) + :mat-joint gp-0 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 734) :mat-joint gp-0) + ) + ) + ((logtest? (-> *part-group-id-table* 735 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 735) + :mat-joint gp-0 + ) + ) + (else + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 735) :mat-joint gp-0) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type fac-gun-tower-projectile +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this fac-gun-tower-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) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 2457.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec + backgnd + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec + jak + bot + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type fac-gun-tower-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this fac-gun-tower-projectile)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) #t) + (set! (-> this max-speed) 327680.0) + (set! (-> this move) fac-gun-tower-projectile-move) + (set! (-> this damage) 1.0) + (set! (-> this sound-id) (new-sound-id)) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 777) this)) + (let* ((v1-10 *game-info*) + (a0-6 (+ (-> v1-10 attack-id) 1)) + ) + (set! (-> v1-10 attack-id) a0-6) + (set! (-> this attack-id) a0-6) + ) + 0 + (none) + ) + +;; definition for method 26 of type gun-warf-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-26 ((this gun-warf-shot)) + (when (not (-> this hit-actor?)) + (let ((v1-10 + (cond + ((-> this hit-actor?) + (cond + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ((logtest? (-> *part-group-id-table* 776 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> this root trans quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 776)) + ) + ) + ) + ) + (send-event (ppointer->process v1-10) 'clock this) + ) + ) + 0 + (none) + ) + +;; definition for method 28 of type gun-warf-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this gun-warf-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "yellow-shot-fir") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "yellow-gun-burn") + ) + ((= v1-0 (projectile-options po1)) + (sound-play "yellow-shot-fiz") + ) + (else + (sound-play "yellow-shot-std" :id (-> this sound-id) :position (-> this root trans)) + ) + ) + ) + (none) + ) + +;; definition for method 38 of type gun-warf-shot +(defmethod made-impact? ((this gun-warf-shot)) + (let ((v1-0 (-> this root)) + (t1-0 (new 'stack-no-clear 'collide-query)) + ) + (let ((a0-1 t1-0)) + (set! (-> a0-1 radius) (-> v1-0 root-prim prim-core world-sphere w)) + (set! (-> a0-1 collide-with) (-> v1-0 root-prim prim-core collide-with)) + (set! (-> a0-1 ignore-process0) this) + (set! (-> a0-1 ignore-process1) (ppointer->process (-> this parent))) + (set! (-> a0-1 ignore-pat) (-> v1-0 pat-ignore-mask)) + (set! (-> a0-1 action-mask) (collide-action solid)) + ) + (when (fill-and-try-snap-to-surface v1-0 (-> v1-0 transv) -10240.0 12697.6 -4096.0 t1-0) + (if (logtest? (-> this root status) (collide-status touch-actor)) + (set! (-> this hit-actor?) #t) + ) + #t + ) + ) + ) + +;; definition for function gun-warf-shot-move +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun gun-warf-shot-move ((arg0 gun-warf-shot)) + (projectile-move-fill-line-sphere arg0) + (let ((s5-0 (-> arg0 root))) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (vector-! s4-0 (-> arg0 tail-pos) (-> s5-0 trans)) + (let ((f0-0 (vector-length s4-0))) + (when (< 122880.0 f0-0) + (vector-normalize! s4-0 122880.0) + (vector+! (-> arg0 tail-pos) (-> s5-0 trans) s4-0) + ) + ) + ) + (when (logtest? (-> s5-0 status) (collide-status touch-surface)) + (if (logtest? (-> arg0 root status) (collide-status touch-actor)) + (set! (-> arg0 hit-actor?) #t) + ) + (let ((v1-14 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> arg0 tail-pos) (-> s5-0 trans)) 2048.0)) + (a1-5 (-> arg0 hit-pos)) + ) + (set! (-> a1-5 quad) (-> s5-0 trans quad)) + (vector+! a1-5 a1-5 v1-14) + (move-to-point! (-> arg0 root) a1-5) + ) + (go (method-of-object arg0 impact)) + ) + ) + 0 + (none) + ) + +;; definition for method 30 of type gun-warf-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this gun-warf-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate jak-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 4096.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set! (-> v1-13 prim-core action) (collide-action solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list pusher shield) + ) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 4096.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + 0 + (none) + ) + +;; definition for method 31 of type gun-warf-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this gun-warf-shot)) + (set! (-> this hit-actor?) #f) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1)) + (set! (-> this attack-mode) 'eco-yellow) + (set! (-> this max-speed) 1638400.0) + (set! (-> this move) gun-warf-shot-move) + (set! (-> this timeout) (seconds 2)) + (set! (-> this sound-id) (new-sound-id)) + (logior! (-> this options) (projectile-options po13)) + (set! (-> this muzzle-flash-part) (the-as sparticle-launch-control (-> *part-id-table* 2896))) + (set! (-> this main-shot-part) (the-as sparticle-launch-control (-> *part-id-table* 2893))) + (set! (-> this shot-aim-part) (the-as sparticle-launch-control (-> *part-id-table* 2895))) + 0 + (none) + ) + +;; definition for method 41 of type gun-warf-shot +;; WARN: Return type mismatch int vs none. +(defmethod gun-warf-shot-method-41 ((this gun-warf-shot) (arg0 vector) (arg1 vector)) + (let ((f30-0 (-> *part-id-table* 2893 init-specs 4 initial-valuef))) + (set! (-> *part-id-table* 2893 init-specs 4 initial-valuef) (fmin f30-0 (vector-length arg1))) + (draw-beam (the-as sparticle-launcher (-> this main-shot-part)) arg0 arg1 #f) + (set! (-> *part-id-table* 2893 init-specs 4 initial-valuef) f30-0) + ) + 0 + (none) + ) + +;; definition for method 42 of type gun-warf-shot +;; WARN: Return type mismatch int vs none. +(defmethod gun-warf-shot-method-42 ((this gun-warf-shot) (arg0 float) (arg1 float) (arg2 matrix)) + (set! (-> *part-id-table* 2895 init-specs 3 initial-valuef) (* arg0 arg1)) + (launch-particles (-> *part-id-table* 2895) arg2 :origin-is-matrix #t) + (set! (-> *part-id-table* 2895 init-specs 3 initial-valuef) arg1) + 0 + (none) + ) + +;; definition for method 43 of type gun-warf-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod launch-part ((this gun-warf-shot) (arg0 vector)) + (launch-particles (-> *part-id-table* 2894) arg0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc b/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc index ac642b459c..785169ba8c 100644 --- a/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc +++ b/test/decompiler/reference/jak3/levels/forest/neo-spawner_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Return type mismatch int vs none. (defun foresta-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 128 10) + (alloc-nav-network-for-level! *nav-network* 128 10) 0 (none) ) @@ -684,21 +684,11 @@ ) :trans (-> (method-of-type neo-spawner open) trans) :code (behavior () - (local-vars (a2-1 (function joint-control-channel float float float float :behavior process))) (ja-channel-push! 1 (seconds 0.1)) (ja-no-eval :group! neo-spawner-spit-start-ja :num! (seek!) :frame-num 0.0) (until (ja-done? 0) (suspend) - (let ((a0-2 (-> self skel root-channel 0))) - (set! (-> a0-2 param 0) (the float (+ (-> a0-2 frame-group frames num-frames) -1))) - (set! (-> a0-2 param 1) 1.0) - (let ((t9-2 joint-control-channel-group-eval!) - (a1-2 #f) - ) - (set! a2-1 num-func-seek!) - (t9-2 a0-2 (the-as art-joint-anim a1-2) a2-1) - ) - ) + (ja :num! (seek!)) ) (spawn-neo self) (let ((a1-3 (new 'stack-no-clear 'event-message-block))) @@ -719,7 +709,7 @@ ) (let ((gp-0 (new 'stack-no-clear 'matrix))) (let ((a1-5 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) - (matrix-f-compose gp-0 a1-5 (the-as float a2-1)) + (matrix-f-compose gp-0 a1-5) ) (set! (-> gp-0 trans quad) (-> self root trans quad)) (if (logtest? (-> *part-group-id-table* 566 flags) (sp-group-flag sp13)) @@ -959,7 +949,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc new file mode 100644 index 0000000000..7607191123 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/mhcity/destroy-dark-eco_REF.gc @@ -0,0 +1,1649 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-dark-eco-tower mhcity-eco-dark-tower mhcity-eco-dark-tower-lod0-jg mhcity-eco-dark-tower-idle-ja + ((mhcity-eco-dark-tower-lod0-mg (meters 999999))) + :bounds (static-spherem 0 10 0 12) + ) + +;; definition of type hud-eco-egg +(deftype hud-eco-egg (hud) + () + ) + +;; definition for method 3 of type hud-eco-egg +(defmethod inspect ((this hud-eco-egg)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type hud-eco-egg +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-eco-egg)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 462.0 (* 130.0 (-> this offset)))) + 165 + ) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -20 50) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-eco-egg +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-eco-egg)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-eco-egg +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-eco-egg)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-center-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) + (the-as texture-id (lookup-texture-by-id (new 'static 'texture-id :page #xc7d))) + ) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 1.0) + (set! (-> this strings 0 flags) (font-flags shadow kerning middle large)) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-part-dark-egg-mist-active + :id 1449 + :flags (sp0 sp4) + :bounds (static-bspherem 0 5 0 10) + :parts ((sp-item 4749) (sp-item 4750)) + ) + +;; failed to figure out what this is: +(defpart 4749 + :init-specs ((:texture (flame01 level-default-sprite)) + (:birth-func 'birth-func-flip-based-on-scale) + (:num 1.0 1.0) + (:x (meters 0) (meters 2)) + (:y (meters 4) (meters 15)) + (:scale-x (meters -4) (meters 8)) + (:rot-z (degrees -10) (degrees 20)) + (:scale-y (meters 3) (meters 1)) + (:r 0.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y (meters 0.0033333334)) + (:fade-r 0.128 0.128) + (:fade-g 0.08533333) + (:fade-a 0.10666667 0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 5)) + (:flags (sp-cpuinfo-flag-3)) + (:func 'check-drop-group-center) + (:conerot-x (degrees -50.000004) (degrees 100.00001)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4750 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:y (meters 4)) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 0.0 64.0) + (:b 128.0) + (:a 0.0) + (:vel-y (meters -0.033333335)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.4) (degrees 0.8)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.10666667 0.21333334) + (:fade-g -0.053333335 -0.053333335) + (:fade-b 0.10666667 0.10666667) + (:fade-a 0.21333334 0.21333334) + (:accel-x (meters -0.00066666666) (meters 0.0013333333)) + (:accel-z (meters -0.00066666666) (meters 0.0013333333)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 1)) + (:next-launcher 4751) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 4751 + :init-specs ((:fade-a -0.42666668 -0.42666668)) + ) + +;; definition for symbol *initial-orb-pos*, type vector +(define *initial-orb-pos* (new 'static 'vector :x -1552384.0 :y 39813.12 :z 4849664.0 :w 1.0)) + +;; definition of type lightning-bolt-tower +(deftype lightning-bolt-tower (lightning-bolt) + () + ) + +;; definition for method 3 of type lightning-bolt-tower +(defmethod inspect ((this lightning-bolt-tower)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tcurrent-points: ~A~%" (-> this current-points)) + (format #t "~1Tdesired-points: ~A~%" (-> this desired-points)) + (format #t "~1Tspan-pts-start: ~A~%" (-> this span-pts-start)) + (format #t "~1Tspans: ~A~%" (-> this spans)) + (format #t "~1Tspans-internal: ~A~%" (-> this spans-internal)) + (format #t "~1Tstrip1: ~A~%" (-> this strip1)) + (format #t "~1Tstrip2: ~A~%" (-> this strip2)) + (format #t "~1Tinner-point-travel-time: ~D~%" (-> this inner-point-travel-time)) + (format #t "~1Tstart-fade-time: ~D~%" (-> this start-fade-time)) + (format #t "~1Tnew-inner-point-generate-time: ~D~%" (-> this new-inner-point-generate-time)) + (format #t "~1Tlast-generate-time: ~D~%" (-> this last-generate-time)) + (format #t "~1Tbase-width: ~f~%" (-> this base-width)) + (format #t "~1Tcurrent-uv-shift: ~f~%" (-> this current-uv-shift)) + (format #t "~1Tcurrent-fade-scalar: ~f~%" (-> this current-fade-scalar)) + (format #t "~1Tfractal-reduction: ~f~%" (-> this fractal-reduction)) + (format #t "~1Tappearance: #~%" (-> this appearance)) + (format #t "~1Tfade-mode: ~D~%" (-> this fade-mode)) + (format #t "~1Tgenerate-mode: ~D~%" (-> this generate-mode)) + (format #t "~1Tsnap-inner-points?: ~A~%" (-> this snap-inner-points?)) + (format #t "~1Tspan-data[2] @ #x~X~%" (-> this span-data)) + (format #t "~1Tnum-active-spans: ~D~%" (-> this num-active-spans)) + (format #t "~1Tnum-spans: ~D~%" (-> this num-spans)) + (format #t "~1Tbase-color: ~D~%" (-> this base-color)) + (label cfg-4) + this + ) + +;; definition of type tower-lightning-disc +(deftype tower-lightning-disc (structure) + ((bolt lightning-bolt-tower) + (orient quaternion :inline) + (cur-state symbol) + (last-spawn-time time-frame) + (pts vector 8 :inline) + (last-rot-angle float) + ) + ) + +;; definition for method 3 of type tower-lightning-disc +(defmethod inspect ((this tower-lightning-disc)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tower-lightning-disc) + (format #t "~1Tbolt: ~A~%" (-> this bolt)) + (format #t "~1Torient: #~%" (-> this orient)) + (format #t "~1Tcur-state: ~A~%" (-> this cur-state)) + (format #t "~1Tlast-spawn-time: ~D~%" (-> this last-spawn-time)) + (format #t "~1Tpts[8] @ #x~X~%" (-> this pts)) + (format #t "~1Tlast-rot-angle: ~f~%" (-> this last-rot-angle)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 46) (new 'static 'lightning-spec + :name "orb-elec-lightning" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #x40 :b #xff :a #x80) + :end-color (new 'static 'rgba :g #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 1.5 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3b :page #x4) + :reduction 0.52 + :num-points 64 + :box-size 40960.0 + :merge-factor 0.8 + :merge-count 2 + :radius 2048.0 + :duration 45.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-dark-eco-orb mhcity-de-tower-egg mhcity-de-tower-egg-lod0-jg mhcity-de-tower-egg-idle-ja + ((mhcity-de-tower-egg-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +;; definition of type dark-eco-orb +(deftype dark-eco-orb (process-focusable) + ((last-attack-id uint32) + (hit-points float) + (alt-actor entity-actor) + (movie? symbol) + (minimap connection-minimap) + (discs tower-lightning-disc 2 :inline) + (shock-sound sound-id) + (plasma-sound sound-id) + (shock-spawn-time time-frame) + ) + (:state-methods + active + hit + die + die-movie + ) + ) + +;; definition for method 3 of type dark-eco-orb +(defmethod inspect ((this dark-eco-orb)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tlast-attack-id: ~D~%" (-> this last-attack-id)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Talt-actor: ~A~%" (-> this alt-actor)) + (format #t "~2Tmovie?: ~A~%" (-> this movie?)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tdiscs[2] @ #x~X~%" (-> this discs)) + (format #t "~2Tshock-sound: ~D~%" (-> this shock-sound)) + (format #t "~2Tplasma-sound: ~D~%" (-> this plasma-sound)) + (format #t "~2Tshock-spawn-time: ~D~%" (-> this shock-spawn-time)) + (label cfg-4) + this + ) + +;; definition for function dark-eco-orb-event-handler +(defbehavior dark-eco-orb-event-handler dark-eco-orb ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die-fast) + (deactivate self) + ) + (('touched) + (send-event (ppointer->process (-> self parent)) 'child-touched) + #t + ) + (('attack) + (let ((gp-0 (the-as attack-info (-> arg3 param 1)))) + (when (and (!= (-> gp-0 id) (-> self last-attack-id)) + (logtest? (-> gp-0 penetrate-using) (penetrate flop punch spin uppercut)) + (not (logtest? (penetrate dark-bomb) (-> gp-0 penetrate-using))) + ) + (sound-play "egg-gethit") + (set! (-> self last-attack-id) (-> gp-0 id)) + (let ((f0-1 (if (logtest? (attack-mask damage) (-> gp-0 mask)) + (-> gp-0 damage) + (penetrate-using->damage (-> gp-0 penetrate-using)) + ) + ) + ) + (set! (-> self hit-points) (- (-> self hit-points) f0-1)) + ) + (go-virtual hit) + (return #t) + ) + ) + #f + ) + ) + ) + +;; failed to figure out what this is: +(defstate die-movie (dark-eco-orb) + :virtual #t + :code (behavior () + (until (process-grab? *target* #f) + (suspend) + ) + (process-spawn scene-player :init scene-player-init "city-get-dark-punch" #t #f :name "scene-player") + (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 + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((gp-1 (current-time))) + (until (time-elapsed? gp-1 (seconds 1)) + (suspend) + ) + ) + (while *scene-player* + (suspend) + ) + (task-node-close! (game-task-node city-destroy-darkeco-dark-punch) 'event) + (set-setting! 'airlock #f 0.0 0) + (suspend) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0 ds9)) + ) + ) + +;; failed to figure out what this is: +(defstate die (dark-eco-orb) + :virtual #t + :enter (behavior () + (if (-> self movie?) + (go-virtual die-movie) + ) + ) + :code (behavior () + (sound-play "egg-explode") + (let ((v1-2 (-> self root root-prim))) + (set! (-> v1-2 prim-core collide-as) (collide-spec)) + (set! (-> v1-2 prim-core collide-with) (collide-spec)) + ) + 0 + (let ((gp-1 (quaternion->matrix (new 'stack-no-clear 'matrix) (-> self root quat)))) + (set! (-> gp-1 trans quad) (-> self root trans quad)) + (if (logtest? (-> *part-group-id-table* 325 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to *entity-pool* + :group (-> *part-group-id-table* 325) + :mat-joint gp-1 + ) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 325) :mat-joint gp-1) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 0.1)) + (suspend) + ) + ) + (logior! (-> self draw status) (draw-control-status no-draw)) + (let ((t0-2 (res-lump-struct (-> self entity) 'camera-name structure))) + (if t0-2 + (persist-with-delay *setting-control* #f (seconds 2) 'entity-name (the-as symbol t0-2) 0.0 0) + ) + ) + (toggle-status (-> self entity) (entity-perm-status dead) #t) + ) + :post (behavior () + (ja-post) + ) + ) + +;; definition for function spawn-shock-effect +;; INFO: Used lq/sq +;; WARN: Stack slot offset 656 signed mismatch +;; WARN: Stack slot offset 656 signed mismatch +;; WARN: Stack slot offset 656 signed mismatch +;; WARN: Stack slot offset 656 signed mismatch +;; WARN: Return type mismatch int vs none. +(defun spawn-shock-effect ((arg0 dark-eco-orb) + (arg1 vector) + (arg2 lightning-spec) + (arg3 (function lightning-tracker none)) + (arg4 sparticle-launcher) + (arg5 time-frame) + (arg6 float) + ) + (local-vars + (sv-640 (pointer lightning-tracker)) + (sv-656 float) + (sv-672 matrix) + (sv-688 collide-query) + (sv-704 symbol) + (sv-720 vector) + (sv-736 int) + (sv-752 process) + (sv-768 vector) + ) + (set! sv-656 arg6) + (let ((s5-0 *lightning-probe-vars*)) + (set! sv-672 (new 'stack-no-clear 'matrix)) + (set! sv-688 (new 'stack-no-clear 'collide-query)) + (set! sv-704 (the-as symbol #f)) + (set! sv-768 (new 'stack-no-clear 'vector)) + (set! (-> sv-688 start-pos quad) (-> arg1 quad)) + (set! sv-720 (-> sv-688 move-dist)) + (set! (-> sv-720 x) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 y) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 z) (rand-vu-float-range 0.0 65536.0)) + (set! (-> sv-720 w) 1.0) + (matrix-rotate-zyx! sv-672 (-> sv-688 move-dist)) + (set! sv-736 6) + (while (nonzero? sv-736) + (set! sv-736 (+ sv-736 -1)) + (vector-rotate*! (-> sv-688 move-dist) (-> s5-0 probe-dirs sv-736) sv-672) + (vector-normalize! (-> sv-688 move-dist) sv-656) + (let ((v1-19 sv-688)) + (set! (-> v1-19 radius) 409.6) + (set! (-> v1-19 collide-with) (collide-spec backgnd crate obstacle hit-by-others-list pusher)) + (set! (-> v1-19 ignore-process0) arg0) + (set! (-> v1-19 ignore-process1) #f) + (set! (-> v1-19 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-19 action-mask) (collide-action solid)) + ) + (when (>= (fill-and-probe-using-line-sphere *collide-cache* sv-688) 0.0) + (set-time! (-> s5-0 last-valid-time)) + (set! (-> sv-768 quad) (-> sv-688 best-other-tri intersect quad)) + (when (< 16384.0 (vector-vector-distance sv-768 (-> sv-688 start-pos))) + (set! sv-704 #t) + (goto cfg-7) + ) + ) + ) + (label cfg-7) + (when sv-704 + (set! sv-752 (get-process *default-dead-pool* lightning-tracker #x4000 0)) + (set! sv-640 + (the-as + (pointer lightning-tracker) + (when sv-752 + (let ((t9-9 (method-of-type lightning-tracker activate))) + (t9-9 (the-as lightning-tracker sv-752) arg0 "lightning-tracker" (the-as pointer #x70004000)) + ) + (run-now-in-process sv-752 lightning-tracker-init arg2 arg5 arg3 arg0 arg1 sv-768) + (-> sv-752 ppointer) + ) + ) + ) + (when sv-640 + (set! (-> sv-640 0 user-time 0) 0) + (when arg4 + (let ((v1-47 (get-field-spec-by-id arg4 (sp-field-id spt-timer)))) + (if v1-47 + (set! (-> v1-47 initial-valuef) (the-as float (-> sv-640 0 duration))) + ) + ) + (let ((t9-12 sp-launch-particles-var) + (a0-26 *sp-particle-system-2d*) + (a2-5 *launch-matrix*) + ) + (set! (-> a2-5 trans quad) (-> s5-0 end-pos quad)) + (t9-12 a0-26 arg4 a2-5 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 47) (new 'static 'lightning-spec + :name "lightning-dark-attack-tower" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.5 + :fade-time 30.0 + :texture (new 'static 'texture-id :index #x3a :page #x4) + :reduction 0.42 + :num-points 4 + :box-size 8192.0 + :merge-factor 0.6 + :merge-count 2 + :radius 3276.8 + :duration 45.0 + :duration-rand 60.0 + :sound #f + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *dark-lightning-width* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 0.5 :y 4.5 :z 5.5 :w 6.5) + :one-over-x-deltas (new 'static 'vector :x 4.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if (or (zero? *dark-tower-lightning*) (!= loading-level global)) + (set! *dark-tower-lightning* (new 'loading-level 'lightning-appearance)) + ) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* base-alpha) 0.5) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* tex-id) (the-as uint #x403a00)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* alpha-1-curve) *curve-unity*) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* alpha-1-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* alpha-1-repeat-dist) 262144.0) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* alpha-2-curve) #f) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* alpha-2-mode) (the-as uint 3)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* alpha-2-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* width-curve) *dark-lightning-width*) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* width-repeat-dist) 4096.0) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* uv-repeat-dist) 28672.0) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* regenerate-time-start) (seconds 0.167)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* regenerate-time-end) (seconds 0.25)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* width-range-start) 4096.0) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* width-range-end) 6144.0) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* fade-time) (seconds 0.1)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* uv-shift?) #f) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* uv-shift-speed) (seconds 0.1)) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* use-sprite-bucket?) #t) + +;; failed to figure out what this is: +(set! (-> *dark-tower-lightning* use-accurate-interp?) #t) + +;; failed to figure out what this is: +(defstate active (dark-eco-orb) + :virtual #t + :event dark-eco-orb-event-handler + :exit (behavior () + (sound-stop (-> self shock-sound)) + (sound-stop (-> self plasma-sound)) + ) + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (if (>= 0.0 (-> self hit-points)) + (go-virtual die) + ) + (when (and (< (vector-vector-xz-distance (-> self root trans) (camera-pos)) 614400.0) + (time-elapsed? (-> self shock-spawn-time) (seconds 0.017)) + ) + (new 'stack-no-clear 'vector) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set-vector! + gp-1 + (rand-vu-float-range -8192.0 8192.0) + (rand-vu-float-range 0.0 12288.0) + (rand-vu-float-range -8192.0 8192.0) + 1.0 + ) + (set-time! (-> self shock-spawn-time)) + (spawn-shock-effect + self + (vector+! (new 'stack-no-clear 'vector) (-> self root trans) gp-1) + (-> *lightning-spec-id-table* 46) + lightning-probe-callback + (the-as sparticle-launcher #f) + 0 + 409600.0 + ) + ) + (sound-play "de-tower-zap" :id (-> self plasma-sound) :position (-> self root trans)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> self root trans quad)) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-2 (new 'stack-no-clear 'vector)) + (gp-2 (new 'stack-no-clear 'vector)) + ) + (let ((f0-6 -28672.0) + (f1-3 (* 70.0 (the float (current-time)))) + (f2-3 (- -40960.0 (-> self root trans y))) + ) + (set! (-> s3-0 y) (+ f0-6 (- f1-3 (* (the float (the int (/ f1-3 f2-3))) f2-3)))) + ) + (set! (-> gp-2 quad) (-> s3-0 quad)) + (sound-play "tree-shocker" :id (-> self shock-sound) :position gp-2) + (+! (-> s3-0 x) 28672.0) + (set! (-> s4-0 start-pos quad) (-> s3-0 quad)) + (vector-float*! (-> s4-0 move-dist) *x-vector* -40960.0) + (let ((v1-39 s4-0)) + (set! (-> v1-39 radius) 2048.0) + (set! (-> v1-39 collide-with) (collide-spec crate obstacle hit-by-others-list pusher)) + (set! (-> v1-39 ignore-process0) self) + (set! (-> v1-39 ignore-process1) #f) + (set! (-> v1-39 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-39 action-mask) (collide-action solid)) + ) + (let ((f0-12 (fill-and-probe-using-line-sphere *collide-cache* s4-0)) + (s3-1 (-> self discs)) + ) + (when (>= f0-12 0.0) + (set! (-> s5-2 quad) (-> s4-0 best-other-tri intersect quad)) + (let ((s4-1 *x-vector*) + (f30-0 9362.286) + (s2-0 (vector-y-quaternion! (new 'stack-no-clear 'vector) (-> s3-1 0 orient))) + (s1-0 (new 'stack-no-clear 'vector)) + (f28-0 0.0) + (f26-0 (vector-vector-distance gp-2 s5-2)) + ) + (dotimes (s5-3 8) + (vector-rotate-around-axis! s1-0 (the-as quaternion s4-1) f28-0 s2-0) + (vector-float*! s1-0 s1-0 f26-0) + (vector+! (-> s3-1 0 pts s5-3) gp-2 s1-0) + (+! f28-0 f30-0) + ) + ) + ) + ) + ) + ) + (let* ((a0-27 0) + (v1-55 (-> self discs a0-27)) + (gp-3 (-> self discs a0-27 bolt)) + ) + (set! (-> gp-3 base-color) (new 'static 'rgba :r #x78 :g #x78 :b #xff :a #xff)) + (set! (-> gp-3 inner-point-travel-time) (seconds 1)) + (set! (-> gp-3 snap-inner-points?) #t) + (set! (-> gp-3 fractal-reduction) 0.4) + (set! (-> gp-3 generate-mode) (the-as uint 1)) + (set! (-> gp-3 appearance) *dark-tower-lightning*) + (set! (-> gp-3 num-active-spans) 7) + (dotimes (a0-37 8) + (set! (-> gp-3 spans data a0-37 random-offset-size-start) 4096.0) + (set! (-> gp-3 spans-internal data a0-37 num-inner-points) 2) + (set! (-> gp-3 spans data a0-37 inner-random-offset-size) 4096.0) + (set! (-> gp-3 span-pts-start data a0-37 quad) (-> v1-55 pts a0-37 quad)) + ) + (set! (-> gp-3 spans data 0 random-offset-size-start) 0.0) + (set! (-> gp-3 spans data 7 random-offset-size-start) 0.0) + (set! (-> gp-3 spans-internal data 7 num-inner-points) 0) + (case (-> v1-55 cur-state) + (('inactive) + (if (zero? (lightning-bolt-method-14 gp-3)) + (lightning-bolt-method-13 gp-3 2) + ) + ) + (('active) + (if (and (!= (lightning-bolt-method-14 gp-3) 0) (!= (lightning-bolt-method-14 gp-3) 1)) + (lightning-bolt-method-13 gp-3 1) + ) + ) + ) + (lightning-bolt-method-11 gp-3) + (lightning-bolt-method-12 gp-3) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (until #f + (let* ((f30-0 0.15) + (f28-0 0.19999999) + (v1-3 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-4 (the-as number (logior #x3f800000 v1-3))) + (f30-1 (+ f30-0 (* f28-0 (+ -1.0 (the-as float v1-4))))) + ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! (seek! max f30-1) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max f30-1)) + ) + ) + ) + #f + ) + :post (behavior () + (transform-post) + ) + ) + +;; failed to figure out what this is: +(defstate hit (dark-eco-orb) + :virtual #t + :event dark-eco-orb-event-handler + :trans (behavior () + (if (>= 0.0 (-> self hit-points)) + (go-virtual die) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! (-> self draw art-group data 3) :num! (seek! max 0.5) :frame-num 5.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 0.5)) + ) + (go-virtual active) + ) + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for method 7 of type dark-eco-orb +(defmethod relocate ((this dark-eco-orb) (offset int)) + (dotimes (v1-0 2) + (if (nonzero? (-> this discs v1-0 bolt)) + (&+! (-> this discs v1-0 bolt) offset) + ) + ) + (call-parent-method this offset) + ) + +;; definition for function dark-eco-orb-init-by-other +;; INFO: Used lq/sq +(defbehavior dark-eco-orb-init-by-other dark-eco-orb ((arg0 entity-actor)) + (set! (-> self level) (level-get *level* 'lctydest)) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 81920.0) + (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! (-> self root) s5-0) + ) + (set! (-> self shock-sound) (new-sound-id)) + (set! (-> self plasma-sound) (new-sound-id)) + (set! (-> self entity) arg0) + (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-orb" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self last-attack-id) (the-as uint 0)) + (set! (-> self hit-points) 1.0) + (set! (-> self movie?) #f) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1449) self)) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (-> arg0 extra trans) 0)) + (dotimes (gp-1 2) + (quaternion-identity! (the-as quaternion (+ (the-as uint (-> self discs 0 orient)) (* 192 gp-1)))) + (set! (-> self discs gp-1 bolt) (new 'process 'lightning-bolt-tower)) + (set! (-> self discs gp-1 cur-state) 'active) + (init! (-> self discs gp-1 bolt) 8 4 *dark-tower-lightning*) + ) + (go-virtual active) + ) + +;; definition for function dark-eco-orb-init-by-other-pos-scale +;; INFO: Used lq/sq +(defbehavior dark-eco-orb-init-by-other-pos-scale dark-eco-orb ((arg0 vector) (arg1 float)) + (set! (-> self level) (level-get *level* 'lctydest)) + (let ((s4-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-0 penetrate-using) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0)))) + (set! (-> s3-0 prim-core collide-as) (collide-spec pusher)) + (set! (-> s3-0 prim-core collide-with) (collide-spec jak player-list projectile)) + (set! (-> s3-0 prim-core action) (collide-action solid no-standon)) + (set! (-> s3-0 transform-index) 0) + (set-vector! (-> s3-0 local-sphere) 0.0 8192.0 0.0 24576.0) + (set! (-> s4-0 total-prims) (the-as uint 1)) + (set! (-> s4-0 root-prim) s3-0) + ) + (pusher-init s4-0) + (set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w))) + (let ((v1-18 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> s4-0 max-iteration-count) (the-as uint 2)) + (set! (-> self root) s4-0) + ) + (quaternion-identity! (-> self root quat)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set-vector! (-> self root scale) arg1 arg1 arg1 1.0) + (set! (-> self shock-sound) (new-sound-id)) + (set! (-> self plasma-sound) (new-sound-id)) + (set! (-> self last-attack-id) (the-as uint 0)) + (set! (-> self hit-points) 1.0) + (set! (-> self movie?) #t) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-orb" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 13) (the-as int #f) (the-as vector #t) 0)) + (dotimes (gp-2 2) + (quaternion-identity! (the-as quaternion (+ (the-as uint (-> self discs 0 orient)) (* 192 gp-2)))) + (set! (-> self discs gp-2 bolt) (new 'process 'lightning-bolt-tower)) + (set! (-> self discs gp-2 cur-state) 'inactive) + (init! (-> self discs gp-2 bolt) 8 4 *dark-tower-lightning*) + ) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1449) self)) + (go-virtual active) + ) + +;; definition of type dark-eco-tower +(deftype dark-eco-tower (process-drawable) + ((puffer? symbol) + (puffer-h handle) + (jump-y float) + (jump-z float) + (creak-sound ambient-sound) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type dark-eco-tower +(defmethod inspect ((this dark-eco-tower)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tpuffer?: ~A~%" (-> this puffer?)) + (format #t "~2Tpuffer-h: ~D~%" (-> this puffer-h)) + (format #t "~2Tjump-y: ~f~%" (-> this jump-y)) + (format #t "~2Tjump-z: ~f~%" (-> this jump-z)) + (format #t "~2Tcreak-sound: ~A~%" (-> this creak-sound)) + (label cfg-4) + this + ) + +;; definition of type tower-wave +(deftype tower-wave (structure) + ((start float) + (end float) + (freq float) + (amp float) + ) + ) + +;; definition for method 3 of type tower-wave +(defmethod inspect ((this tower-wave)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'tower-wave) + (format #t "~1Tstart: ~f~%" (-> this start)) + (format #t "~1Tend: ~f~%" (-> this end)) + (format #t "~1Tfreq: ~f~%" (-> this freq)) + (format #t "~1Tamp: ~f~%" (-> this amp)) + (label cfg-4) + this + ) + +;; definition for symbol *dark-eco-tower-waves*, type (array tower-wave) +(define *dark-eco-tower-waves* (new 'static 'boxed-array :type tower-wave + (new 'static 'tower-wave :end 0.5 :freq 0.5 :amp 0.2) + (new 'static 'tower-wave :end 0.2 :freq 0.2 :amp 0.1) + ) + ) + +;; definition for function dark-eco-tower-callback +;; WARN: Return type mismatch int vs none. +(defun dark-eco-tower-callback ((arg0 cspace) (arg1 transformq)) + (-> arg0 param1) + (-> arg0 param2) + (let ((f30-0 1.0)) + (cspace<-parented-transformq-joint! arg0 arg1) + (dotimes (s4-0 (length *dark-eco-tower-waves*)) + (let* ((s3-0 (-> *dark-eco-tower-waves* s4-0)) + (f0-2 (- (* 0.000012207031 (-> arg0 bone transform trans y)) + (* 0.0033333334 (the float (current-time)) (-> s3-0 freq)) + ) + ) + ) + 0.0 + (let* ((f0-8 (lerp-scale 0.0 1.0 (fabs (- f0-2 (the float (the int f0-2)))) (-> s3-0 start) (-> s3-0 end))) + (f0-10 (sin (* 32768.0 f0-8))) + ) + (+! f30-0 (* (-> s3-0 amp) f0-10)) + ) + ) + ) + (set! (-> arg1 scale x) f30-0) + (set! (-> arg1 scale z) f30-0) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate idle (dark-eco-tower) + :virtual #t + :trans (behavior () + (update-trans! (-> self creak-sound) (-> self root trans)) + (set-falloff-far! (-> self creak-sound) 163840.0) + (update! (-> self creak-sound)) + ) + :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 transform-post + ) + +;; definition for method 11 of type dark-eco-tower +(defmethod init-from-entity! ((this dark-eco-tower) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-tower" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (go (method-of-object this idle)) + ) + +;; definition for method 10 of type dark-eco-tower +(defmethod deactivate ((this dark-eco-tower)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (-> this puffer-h) + (deactivate (-> this puffer-h process 0)) + ) + (call-parent-method this) + (none) + ) + +;; definition for method 7 of type dark-eco-tower +(defmethod relocate ((this dark-eco-tower) (offset int)) + (if (nonzero? (-> this creak-sound)) + (&+! (-> this creak-sound) offset) + ) + (call-parent-method this offset) + ) + +;; definition for function dark-eco-tower-init-by-other +;; INFO: Used lq/sq +(defbehavior dark-eco-tower-init-by-other dark-eco-tower ((arg0 entity-actor)) + (set! (-> self level) (level-get *level* 'lctydest)) + (let ((s5-0 (new 'process 'collide-shape-moving self (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (let ((v1-8 (new 'process 'collide-shape-prim-mesh s5-0 (the-as uint 1) (the-as uint 0)))) + (set! (-> v1-8 prim-core collide-as) (collide-spec crate camera-blocker)) + (set! (-> v1-8 prim-core collide-with) (collide-spec jak player-list tobot)) + (set! (-> v1-8 prim-core action) (collide-action solid rideable)) + (set! (-> v1-8 transform-index) 3) + (set-vector! (-> v1-8 local-sphere) 0.0 0.0 0.0 81920.0) + (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! (-> self root) s5-0) + ) + (set! (-> self root trans quad) (-> arg0 extra trans quad)) + (quaternion-copy! (-> self root quat) (-> arg0 quat)) + (set! (-> self root scale quad) (-> (res-lump-struct arg0 'scale vector) quad)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-dark-eco-tower" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (ja-no-eval :group! (-> self draw art-group data 2) :num! zero) + (transform-post) + (let ((a0-20 (-> self node-list data 4))) + (set! (-> a0-20 param0) dark-eco-tower-callback) + (set! (-> a0-20 param1) self) + (set! (-> a0-20 param2) (the-as basic 0)) + ) + (let ((v1-34 (-> self node-list data 5))) + (set! (-> v1-34 param0) dark-eco-tower-callback) + (set! (-> v1-34 param1) self) + (set! (-> v1-34 param2) (the-as basic 1)) + ) + (let ((v1-36 (-> self node-list data 6))) + (set! (-> v1-36 param0) dark-eco-tower-callback) + (set! (-> v1-36 param1) self) + (set! (-> v1-36 param2) (the-as basic 2)) + ) + (let ((v1-38 (-> self node-list data 7))) + (set! (-> v1-38 param0) dark-eco-tower-callback) + (set! (-> v1-38 param1) self) + (set! (-> v1-38 param2) (the-as basic 3)) + ) + (let ((v1-40 (-> self node-list data 8))) + (set! (-> v1-40 param0) dark-eco-tower-callback) + (set! (-> v1-40 param1) self) + (set! (-> v1-40 param2) (the-as basic 4)) + ) + (let ((v1-42 (-> self node-list data 9))) + (set! (-> v1-42 param0) dark-eco-tower-callback) + (set! (-> v1-42 param1) self) + (set! (-> v1-42 param2) (the-as basic 5)) + ) + (let ((v1-44 (-> self node-list data 10))) + (set! (-> v1-44 param0) dark-eco-tower-callback) + (set! (-> v1-44 param1) self) + (set! (-> v1-44 param2) (the-as basic 6)) + ) + (set! (-> self jump-y) (* 4096.0 (res-lump-float arg0 'jump-y :default 13.0))) + (set! (-> self jump-z) (* 4096.0 (res-lump-float arg0 'jump-z :default 6.0))) + (set! (-> self creak-sound) (new 'process 'ambient-sound "creak-loop" *zero-vector* 0.0)) + (set-falloff-far! (-> self creak-sound) 163840.0) + (update-vol! (-> self creak-sound) 1.0) + (update-pitch-mod! (-> self creak-sound) 0.0) + (set! (-> self puffer?) #f) + (let ((v1-57 (res-lump-value arg0 'extra-id uint128 :default (the-as uint128 -1) :time -1000000000.0))) + (if (= (the-as uint v1-57) 1) + (set! (-> self puffer?) #t) + ) + ) + (cond + ((not (-> self puffer?)) + (setup-masks (-> self draw) 0 8) + (set! (-> self puffer-h) (the-as handle #f)) + ) + (else + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s5-3 (new 'stack-no-clear 'puffer-init-by-other-params))) + (set! (-> s5-3 scale) 0.8) + (set! (-> s5-3 jump-y) (* (-> self root scale x) (-> self jump-y))) + (set! (-> s5-3 jump-z) (* (-> self root scale x) (-> self jump-z))) + (vector<-cspace! (-> s5-3 pos) (-> self node-list data 13)) + (matrix->quaternion (-> s5-3 orient) (-> self node-list data 13 bone transform)) + (quaternion-copy! (-> s5-3 orient) (-> self root quat)) + (let ((v1-73 (entity-actor-lookup arg0 'alt-actor 0))) + (when v1-73 + (quaternion-copy! (-> s5-3 orient) (-> v1-73 quat)) + (set! (-> s5-3 jump-y) (-> self jump-y)) + (set! (-> s5-3 jump-z) (-> self jump-z)) + ) + ) + (set! (-> self puffer-h) + (ppointer->handle + (process-spawn mhcity-puffer :init puffer-init-by-other s5-3 :name "mhcity-puffer" :to self) + ) + ) + ) + ) + ) + (set! (-> self draw light-index) (the-as uint 10)) + (go-virtual idle) + ) + +;; definition of type task-manager-destroy-darkeco +(deftype task-manager-destroy-darkeco (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (handles handle 64) + (orb-handles handle 8) + (orb-status uint32 8) + (counter uint32) + (initial-orb handle) + ) + ) + +;; definition for method 3 of type task-manager-destroy-darkeco +(defmethod inspect ((this task-manager-destroy-darkeco)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Thandles[64] @ #x~X~%" (-> this handles)) + (format #t "~2Torb-handles[8] @ #x~X~%" (-> this orb-handles)) + (format #t "~2Torb-status[8] @ #x~X~%" (-> this orb-status)) + (format #t "~2Tcounter: ~D~%" (-> this counter)) + (format #t "~2Tinitial-orb: ~D~%" (-> this initial-orb)) + (label cfg-7) + this + ) + +;; definition for method 21 of type task-manager-destroy-darkeco +;; INFO: Used lq/sq +(defmethod set-time-limit ((this task-manager-destroy-darkeco)) + (local-vars (sv-16 res-tag)) + (let ((a0-2 (entity-by-name "tmanager-7"))) + (when a0-2 + (set! (-> this entity) (the-as entity-actor a0-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-2 (res-lump-data a0-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-2 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-2)) + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (dotimes (v1-5 64) + (set! (-> this handles v1-5) (the-as handle #f)) + ) + (dotimes (v1-8 8) + (set! (-> this orb-handles v1-8) (the-as handle #f)) + (set! (-> this orb-status v1-8) (the-as uint 0)) + ) + (set-setting! 'city-sound '(darkeco1) 0.0 2) + (set! (-> this initial-orb) (the-as handle #f)) + (set! (-> this counter) (the-as uint 5)) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-eco-egg :init hud-init-by-other :name "hud-eco-egg" :to this)) + ) + (set-setting! 'music 'dstrdeco 0.0 0) + ((method-of-type task-manager set-time-limit) this) + (none) + ) + +;; definition for method 26 of type task-manager-destroy-darkeco +;; WARN: Return type mismatch int vs none. +(defmethod task-manager-method-26 ((this task-manager-destroy-darkeco)) + (when (task-node-open? (game-task-node city-destroy-darkeco-dark-punch)) + (when (< (vector-vector-distance *initial-orb-pos* (target-pos 0)) 409600.0) + (let ((a1-1 (new 'stack-no-clear 'array 'symbol 10))) + (set! (-> a1-1 9) #f) + (set! (-> a1-1 8) #f) + (set! (-> a1-1 7) #f) + (set! (-> a1-1 6) #f) + (set! (-> a1-1 5) #f) + (set! (-> a1-1 4) #f) + (set! (-> a1-1 3) #f) + (set! (-> a1-1 2) 'mhctycst) + (set! (-> a1-1 1) 'mhcitya) + (set! (-> a1-1 0) 'ctywide-mh) + (want-levels *load-state* a1-1) + ) + (if (not (movie?)) + (gui-control-method-12 + *gui-control* + this + (gui-channel art-load) + (gui-action queue) + "city-get-dark-punch" + 0 + -99.0 + (new 'static 'sound-id) + ) + ) + ) + (when (not (-> this initial-orb)) + (let ((s5-1 (get-process *default-dead-pool* dark-eco-orb #x4000 1))) + (set! (-> this initial-orb) + (process->handle + (-> (when s5-1 + (let ((t9-7 (method-of-type dark-eco-orb activate))) + (t9-7 (the-as dark-eco-orb s5-1) this "dark-eco-orb" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-1 dark-eco-orb-init-by-other-pos-scale *initial-orb-pos* #x3f800000) + (-> s5-1 ppointer) + ) + 0 + ) + ) + ) + ) + ) + ) + (when (nonzero? (-> this actor-group)) + (let ((s5-2 0)) + (dotimes (s4-1 (length (-> this actor-group 1))) + (let ((a0-15 (-> this actor-group 1 data s4-1))) + (if (and (-> a0-15 actor) (logtest? (-> a0-15 actor extra perm status) (entity-perm-status dead))) + (+! s5-2 1) + ) + ) + ) + (set! (-> this counter) (the-as uint (- (length (-> this actor-group 1)) s5-2))) + (cond + ((zero? (-> this counter)) + (when (-> this hud-counter) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (set! (-> this hud-counter) (the-as handle #f)) + ) + ) + (else + (set! (-> *game-info* counter) (the float (-> this counter))) + ) + ) + (if (= s5-2 (length (-> this actor-group 1))) + (task-node-close! (game-task-node city-destroy-darkeco-orbs) 'event) + ) + ) + ) + (when (not (and *target* (focus-test? *target* grabbed))) + (when (nonzero? (-> this actor-group)) + (dotimes (s5-3 (length (-> this actor-group 0))) + (let ((s4-2 (-> this actor-group 0 data s5-3))) + (cond + ((and (-> s4-2 actor) + (= (-> s4-2 actor extra level display?) 'display) + (is-object-visible? (-> s4-2 actor extra level) (-> s4-2 actor vis-id)) + ) + (if (not (-> this handles s5-3)) + (set! (-> this handles s5-3) + (ppointer->handle (process-spawn dark-eco-tower (-> s4-2 actor) :name "dark-eco-tower" :to this)) + ) + ) + ) + (else + (when (-> this handles s5-3) + (deactivate (-> this handles s5-3 process 0)) + (set! (-> this handles s5-3) (the-as handle #f)) + ) + ) + ) + ) + ) + (dotimes (s5-4 (length (-> this actor-group 1))) + (let ((s4-3 (-> this actor-group 1 data s5-4))) + (when (-> s4-3 actor) + (if (logtest? (-> s4-3 actor extra perm status) (entity-perm-status dead)) + (set! (-> this orb-status s5-4) (the-as uint 1)) + ) + (cond + ((and (is-object-visible? (-> s4-3 actor extra level) (-> s4-3 actor vis-id)) + (zero? (-> this orb-status s5-4)) + ) + (if (not (-> this orb-handles s5-4)) + (set! (-> this orb-handles s5-4) + (ppointer->handle (process-spawn dark-eco-orb (-> s4-3 actor) :name "dark-eco-orb" :to this)) + ) + ) + ) + (else + (when (-> this orb-handles s5-4) + (deactivate (-> this orb-handles s5-4 process 0)) + (set! (-> this orb-handles s5-4) (the-as handle #f)) + ) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition of type task-manager-dark-punch-training +(deftype task-manager-dark-punch-training (task-manager) + ((gui-id sound-id) + ) + (:methods + (print-text (_type_ text-id) none) + ) + ) + +;; definition for method 3 of type task-manager-dark-punch-training +(defmethod inspect ((this task-manager-dark-punch-training)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tgui-id: ~D~%" (-> this gui-id)) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-dark-punch-training +;; WARN: Return type mismatch float vs none. +(defmethod print-text ((this task-manager-dark-punch-training) (arg0 text-id)) + (when (= (get-status *gui-control* (-> this gui-id)) (gui-status active)) + (let ((s5-1 + (new 'stack 'font-context *font-default-matrix* 32 290 0.0 (font-color default) (font-flags shadow kerning)) + ) + ) + (set! (-> s5-1 flags) (font-flags shadow kerning middle middle-vert large)) + (let ((v1-4 s5-1)) + (set! (-> v1-4 width) (the float 440)) + ) + (let ((v1-5 s5-1)) + (set! (-> v1-5 height) (the float 80)) + ) + (let ((v1-6 s5-1)) + (set! (-> v1-6 scale) 0.7) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* arg0 #f)) + (s4-0 *temp-string* s5-1 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-dark-punch-training) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self gui-id) + (add-process *gui-control* self (gui-channel message) (gui-action play) (-> self name) 81920.0 0) + ) + ) + :exit (behavior () + (send-event *target* 'end-mode 'darkjak) + ) + :trans (behavior () + (print-text self (text-id text-05e7)) + (if (and (time-elapsed? (-> self state-time) (seconds 5)) + *target* + (not (logtest? (focus-status dark) (-> *target* focus-status))) + ) + (send-event *target* 'change-mode 'darkjak #f (darkjak-stage force-on bomb0)) + ) + (let ((t9-3 (-> (find-parent-state) trans))) + (if t9-3 + (t9-3) + ) + ) + ) + ) + +;; definition of type grind-electricity +(deftype grind-electricity (process-drawable) + () + (:state-methods + idle + ) + ) + +;; definition for method 3 of type grind-electricity +(defmethod inspect ((this grind-electricity)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(set! (-> *lightning-spec-id-table* 48) (new 'static 'lightning-spec + :name "grind-elec-lightning" + :flags (lightning-spec-flags lsf0) + :start-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :end-color (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) + :fade-to-color (new 'static 'rgba :r #xbf :b #x8f :a #x5) + :fade-start-factor 0.2 + :texture (new 'static 'texture-id :index #x3f :page #x4) + :reduction 0.42 + :num-points 16 + :box-size 8192.0 + :merge-factor 0.5 + :merge-count 2 + :radius 2048.0 + :duration 30.0 + :sound (static-sound-spec "shock" :group 0) + ) + ) + +;; failed to figure out what this is: +(defstate idle (grind-electricity) + :virtual #t + :trans (behavior () + (local-vars (sv-48 (pointer lightning-tracker)) (sv-52 sparticle-launcher)) + (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)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self root trans quad)) + (set! (-> gp-0 quad) (-> self root trans quad)) + (let ((s2-0 s5-0)) + (let ((s4-0 s5-0)) + (let ((s3-0 *x-vector*)) + (let ((v1-2 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-2) + ) + (.lvf vf5 (&-> s3-0 quad)) + ) + (.lvf vf4 (&-> s4-0 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-0 quad) vf6) + ) + (let ((s2-1 s5-0)) + (let ((s4-1 s5-0)) + (let ((s3-1 *y-vector*)) + (let ((v1-3 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-3) + ) + (.lvf vf5 (&-> s3-1 quad)) + ) + (.lvf vf4 (&-> s4-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 (&-> s2-1 quad) vf6) + ) + (let ((s2-2 s5-0)) + (let ((s4-2 s5-0)) + (let ((s3-2 *z-vector*)) + (let ((v1-4 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-4) + ) + (.lvf vf5 (&-> s3-2 quad)) + ) + (.lvf vf4 (&-> s4-2 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-2 quad) vf6) + ) + (let ((s2-3 gp-0)) + (let ((s4-3 gp-0)) + (let ((s3-3 *x-vector*)) + (let ((v1-5 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-5) + ) + (.lvf vf5 (&-> s3-3 quad)) + ) + (.lvf vf4 (&-> s4-3 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-3 quad) vf6) + ) + (let ((s2-4 gp-0)) + (let ((s4-4 gp-0)) + (let ((s3-4 *y-vector*)) + (let ((v1-6 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-6) + ) + (.lvf vf5 (&-> s3-4 quad)) + ) + (.lvf vf4 (&-> s4-4 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-4 quad) vf6) + ) + (let ((s2-5 gp-0)) + (let ((s4-5 gp-0)) + (let ((s3-5 *z-vector*)) + (let ((v1-7 (rand-vu-float-range -4096.0 4096.0))) + (.mov vf7 v1-7) + ) + (.lvf vf5 (&-> s3-5 quad)) + ) + (.lvf vf4 (&-> s4-5 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> s2-5 quad) vf6) + ) + (set! sv-48 (process-spawn + lightning-tracker + :init lightning-tracker-init + (-> *lightning-spec-id-table* 48) + 0 + lightning-probe-callback + self + s5-0 + gp-0 + :name "lightning-tracker" + :to self + :unk 0 + ) + ) + (set! sv-52 (-> *part-id-table* 160)) + (when sv-48 + (set! (-> sv-48 0 user-time 0) 0) + (when sv-52 + (let ((v1-19 (get-field-spec-by-id sv-52 (sp-field-id spt-timer)))) + (if v1-19 + (set! (-> v1-19 initial-valuef) (the-as float (-> sv-48 0 duration))) + ) + ) + (let ((t9-10 sp-launch-particles-var) + (a0-20 *sp-particle-system-2d*) + (a1-10 sv-52) + (a2-3 *launch-matrix*) + ) + (set! (-> a2-3 trans quad) (-> s5-0 quad)) + (t9-10 a0-20 a1-10 a2-3 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + (let ((t9-11 sp-launch-particles-var) + (a0-21 *sp-particle-system-2d*) + (a1-11 sv-52) + (a2-4 *launch-matrix*) + ) + (set! (-> a2-4 trans quad) (-> gp-0 quad)) + (t9-11 a0-21 a1-11 a2-4 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0) + ) + ) + ) + ) + ) + ) + :code sleep-code + ) + +;; definition for method 11 of type grind-electricity +(defmethod init-from-entity! ((this grind-electricity) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (go (method-of-object this idle)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc new file mode 100644 index 0000000000..07b5a2b1d1 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/nest/mh-bat_REF.gc @@ -0,0 +1,1931 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-mh-bat-charge-up + :id 635 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 2460 :flags (sp7) :period (seconds 40) :length (seconds 0.667)) + (sp-item 2461 :flags (sp7) :period (seconds 40) :length (seconds 0.835)) + (sp-item 2462 :flags (sp6) :period (seconds 40) :length (seconds 1)) + (sp-item 2463 :flags (sp6) :period (seconds 40) :length (seconds 1)) + ) + ) + +;; failed to figure out what this is: +(defpart 2460 + :init-specs ((:texture (flame01 level-default-sprite)) + (:num 1.0) + (:x (meters 4)) + (:scale-x (meters 3)) + (:scale-y (meters 6)) + (:r 255.0) + (:g 0.0) + (:b 255.0) + (:a 0.0) + (:scalevel-x (meters -0.0033333334)) + (:scalevel-y (meters -0.013333334)) + (:fade-a 0.42666668) + (:accel-x (meters -0.001)) + (:friction 0.98 0.01) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + (:func 'sparticle-2d-spline-align-instant) + (:rotate-x (degrees 0) (degrees 36000)) + (:rotate-y (degrees 0) (degrees 36000)) + (:rotate-z (degrees 0) (degrees 36000)) + ) + ) + +;; failed to figure out what this is: +(defpart 2461 + :init-specs ((:texture (specs level-default-sprite)) + (:num 0.1) + (:scale-x (meters 10) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0 20.0) + (:b 128.0 128.0) + (:a 0.0) + (:scalevel-x (meters -0.02) (meters -0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.64) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.335)) + (:next-launcher 2464) + ) + ) + +;; failed to figure out what this is: +(defpart 2464 + :init-specs ((:fade-a 0.0)) + ) + +;; failed to figure out what this is: +(defpart 2462 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 0.5) + (:scale-x (meters 2)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 140.0) + (:b 128.0) + (:a 20.0 30.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.167)) + (:flags (glow)) + (:userdata 409.6) + ) + ) + +;; failed to figure out what this is: +(defpart 2463 + :init-specs ((:texture (ring level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.01)) + (:rot-x (degrees 22.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 10.0 5.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-bat-explosion + :id 636 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.75 0.75 0.75) + :parts ((sp-item 2465 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2466 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2467 :period (seconds 3) :length (seconds 0.05)) + (sp-item 2468 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 2469 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 2470 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 2471 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-bat-jet-explosion + :id 637 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.3 0.3 0.3) + :parts ((sp-item 2465 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2466 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 2467 :period (seconds 3) :length (seconds 0.05)) + (sp-item 2468 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 2469 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 2470 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 2471 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 2466 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 2472) + ) + ) + +;; failed to figure out what this is: +(defpart 2472 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 2471 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.085)) + (:next-launcher 2473) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2470 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 2473) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2473 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 2474)) + ) + +;; failed to figure out what this is: +(defpart 2474 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2475) + ) + ) + +;; failed to figure out what this is: +(defpart 2475 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 2476) + ) + ) + +;; failed to figure out what this is: +(defpart 2476 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 2465 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 2477) + ) + ) + +;; failed to figure out what this is: +(defpart 2477 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +;; failed to figure out what this is: +(defpart 2469 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2478) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2478 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2479) + ) + ) + +;; failed to figure out what this is: +(defpart 2479 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +;; failed to figure out what this is: +(defpart 2467 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 2480) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2480 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 2481) + ) + ) + +;; failed to figure out what this is: +(defpart 2481 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 2468 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-mh-bat mh-bat mh-bat-lod0-jg -1 + ((mh-bat-lod0-mg (meters 999999))) + :bounds (static-spherem 0 2 -2 8) + :shadow mh-bat-shadow-mg + ) + +;; definition of type mh-bat +(deftype mh-bat (enemy) + ((rotation-matrix matrix :inline) + (move-curve cubic-curve :inline) + (start-pos vector :inline) + (up-vector vector :inline) + (focus-bullseye-pos vector :inline) + (focus-xz-dir vector :inline :offset 752) + (target-velocity vector :inline) + (target-speed float) + (y-offset float) + (max-time-step float) + (orbit-angle float) + (orbit-angular-speed float) + (orbit-distance float) + (bank-angle float) + (pitch-angle float) + (anim-speed float) + (last-off-screen-time time-frame) + (nav-mesh nav-mesh) + (flap-interp float) + (shadow-id int32) + (move-dest vector :inline :overlay-at event-param-point) + ) + (:state-methods + retreat + attack-0 + attack-1 + ) + (:methods + (mh-bat-method-158 (_type_) vector) + (mh-bat-method-159 (_type_) none) + (set-scale! (_type_ float) none) + (probe-shadow (_type_) none) + ) + ) + +;; definition for method 3 of type mh-bat +(defmethod inspect ((this mh-bat)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type enemy inspect))) + (t9-0 this) + ) + (format #t "~2Trotation-matrix: #~%" (-> this rotation-matrix)) + (format #t "~2Tmove-curve: #~%" (-> this move-curve)) + (format #t "~2Tstart-pos: #~%" (-> this start-pos)) + (format #t "~2Tup-vector: #~%" (-> this up-vector)) + (format #t "~2Tfocus-bullseye-pos: #~%" (-> this focus-bullseye-pos)) + (format #t "~2Tfocus-pos: #~%" (-> this focus-pos)) + (format #t "~2Tfocus-xz-dir: #~%" (-> this focus-xz-dir)) + (format #t "~2Ttarget-velocity: #~%" (-> this target-velocity)) + (format #t "~2Ttarget-speed: ~f~%" (-> this target-speed)) + (format #t "~2Ty-offset: ~f~%" (-> this y-offset)) + (format #t "~2Tmax-time-step: ~f~%" (-> this max-time-step)) + (format #t "~2Torbit-angle: ~f~%" (-> this orbit-angle)) + (format #t "~2Torbit-angular-speed: ~f~%" (-> this orbit-angular-speed)) + (format #t "~2Torbit-distance: ~f~%" (-> this orbit-distance)) + (format #t "~2Tbank-angle: ~f~%" (-> this bank-angle)) + (format #t "~2Tpitch-angle: ~f~%" (-> this pitch-angle)) + (format #t "~2Tanim-speed: ~f~%" (-> this anim-speed)) + (format #t "~2Tlast-off-screen-time: ~D~%" (-> this last-off-screen-time)) + (format #t "~2Tnav-mesh: ~A~%" (-> this nav-mesh)) + (format #t "~2Tflap-interp: ~f~%" (-> this flap-interp)) + (format #t "~2Tshadow-id: ~D~%" (-> this shadow-id)) + (format #t "~2Tmove-dest: #~%" (-> this event-param-point)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-mh-bat-defaults*, type fact-info-enemy-defaults +(define *fact-info-mh-bat-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *mh-bat-enemy-info*, type enemy-info +(define *mh-bat-enemy-info* (new 'static 'enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #t + :idle-anim-script #f + :idle-anim 5 + :notice-anim 5 + :hostile-anim 5 + :hit-anim 5 + :knocked-anim 5 + :knocked-land-anim 5 + :die-anim 5 + :die-falling-anim 5 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 4 + :sound-hit (static-sound-name "mh-bat-get-hit") + :sound-die (static-sound-name "mh-bat-die") + :notice-distance (meters 100) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 8.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.4) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info (new 'static 'ragdoll-setup + :scale (new 'static 'vector :x 1.0 :y 1.0 :z 1.0) + :bg-collide-with (collide-spec backgnd) + :joint-setup (new 'static 'boxed-array :type ragdoll-joint-setup + (new 'static 'ragdoll-joint-setup + :joint-index 3 + :parent-joint -1 + :axial-slop 1887.9647 + :max-angle 1828.4725 + :coll-rad 2253.2097 + :hit-sound (static-sound-name "mh-bat-bf") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 4 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 8247.761) + :geo-tform (new 'static 'vector :x -1.0 :w 2592.404) + :axial-slop 1887.9647 + :max-angle 1884.2693 + :coll-rad 2172.109 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 5 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 13791.578) + :geo-tform (new 'static 'vector :x -1.0 :w 6063.536) + :axial-slop 1887.9647 + :max-angle 2151.4558 + :coll-rad 2430.976 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 6 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -1.0 :w 6328.3564) + :geo-tform (new 'static 'vector :x 1.0 :w 21944.402) + :axial-slop 1887.9647 + :max-angle 2562.5303 + :coll-rad 1696.9728 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 7 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.2846 :z -0.9585 :w 7849.993) + :geo-tform (new 'static 'vector :x -0.1595 :y -0.9862 :z -0.0413 :w 6464.9995) + :axial-slop 1887.9647 + :max-angle 2870.841 + :coll-rad 1848.9344 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 8 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8472 :z -0.5309 :w 1049.6501) + :geo-tform (new 'static 'vector :x 0.852 :y 0.2493 :z -0.4598 :w 35559.47) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 9 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8358 :z -0.5487 :w 10444.982) + :geo-tform (new 'static 'vector :x -0.7911 :y -0.552 :z -0.263 :w 13496.703) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 10 + :parent-joint 4 + :pre-tform (new 'static 'vector :x -0.2855 :z 0.9582 :w 7833.354) + :geo-tform (new 'static 'vector :x 0.9534 :y 0.0133 :z -0.3009 :w 31748.514) + :axial-slop 1887.9647 + :max-angle 2864.961 + :coll-rad 1774.7968 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 11 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.8392 :z 0.5436 :w 1057.5873) + :geo-tform (new 'static 'vector :x 0.9259 :y 0.1576 :z -0.3427 :w 22837.203) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 12 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.795 :z 0.6062 :w 10426.122) + :geo-tform (new 'static 'vector :x 0.904 :y 0.1843 :z -0.3851 :w 22428.13) + :axial-slop 1887.9647 + :max-angle 3766.3723 + :coll-rad 1318.5024 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 13 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6204 :z 0.784 :w 40801.75) + :geo-tform (new 'static 'vector :x 0.0112 :y 0.9036 :z -0.4279 :w 39265.93) + :axial-slop 1887.9647 + :max-angle 2403.9697 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 14 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9649 :z 0.2619 :w 8321.415) + :geo-tform (new 'static 'vector :x 0.0583 :y 0.979 :z 0.1943 :w 39636.37) + :axial-slop 1887.9647 + :max-angle 2680.7136 + :coll-rad 1060.864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 15 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8092 :z -0.5871 :w 4034.0503) + :geo-tform (new 'static 'vector :x 0.1021 :y 0.9505 :z 0.2931 :w 39452.543) + :axial-slop 1887.9647 + :max-angle 3055.8164 + :coll-rad 996.5568 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 16 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.6217 :z 0.783 :w 24744.848) + :geo-tform (new 'static 'vector :x -0.3088 :y 0.4058 :z 0.86 :w 32838.07) + :axial-slop 1887.9647 + :max-angle 2584.5579 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 17 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9715 :z -0.2362 :w 8353.983) + :geo-tform (new 'static 'vector :x -0.3226 :y -0.1866 :z 0.9278 :w 33548.844) + :axial-slop 1887.9647 + :max-angle 2685.8474 + :coll-rad 1008.0256 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 18 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.8614 :z 0.5077 :w 3994.5286) + :geo-tform (new 'static 'vector :x -0.3154 :y -0.2796 :z 0.9066 :w 34789.88) + :axial-slop 1887.9647 + :max-angle 3281.1692 + :coll-rad 984.2688 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 19 + :parent-joint 3 + :pre-tform (new 'static 'vector :x 0.6761 :z 0.7365 :w 40678.086) + :geo-tform (new 'static 'vector :x -0.1121 :y 0.9875 :z 0.1087 :w 25535.54) + :axial-slop 1887.9647 + :max-angle 2307.814 + :coll-rad 1013.76 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 20 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6369 :z 0.7707 :w 2816.1184) + :geo-tform (new 'static 'vector :x -0.2268 :y 0.9677 :z -0.1093 :w 25577.736) + :axial-slop 1887.9647 + :max-angle 3235.658 + :coll-rad 849.5104 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 21 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7205 :z 0.6933 :w 4994.6807) + :geo-tform (new 'static 'vector :x 0.1277 :y 0.9274 :z -0.3509 :w 25689.31) + :axial-slop 1887.9647 + :max-angle 3077.8438 + :coll-rad 928.5632 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 22 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6775 :z 0.7354 :w 24868.4) + :geo-tform (new 'static 'vector :x 0.9349 :y -0.1038 :z -0.3389 :w 34939.773) + :axial-slop 1887.9647 + :max-angle 2959.6604 + :coll-rad 1315.2256 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 23 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.6375 :z -0.7702 :w 2830.2815) + :geo-tform (new 'static 'vector :x 0.9169 :y -0.2121 :z -0.3375 :w 30645.873) + :axial-slop 1887.9647 + :max-angle 3016.913 + :coll-rad 748.3392 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 24 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.7178 :z -0.6959 :w 4934.4604) + :geo-tform (new 'static 'vector :x 0.9278 :y 0.1268 :z -0.3503 :w 25722.824) + :axial-slop 1887.9647 + :max-angle 2718.8884 + :coll-rad 839.2704 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 25 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -1.0 :w 19514.164) + :geo-tform (new 'static 'vector :x 1.0 :w 1363.3673) + :axial-slop 1887.9647 + :max-angle 2641.8108 + :coll-rad 1934.1312 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 26 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 1606.342) + :geo-tform (new 'static 'vector :x 1.0 :w 1523.8759) + :axial-slop 1887.9647 + :max-angle 2748.9805 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 27 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 1.0 :w 1523.8577) + :geo-tform (new 'static 'vector :x 0.9998) + :axial-slop 1887.9647 + :max-angle 3340.6248 + :coll-rad 1063.3217 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 28 + :parent-joint -1 + :geo-tform (new 'static 'vector :x 0.9998) + :axial-slop 1887.9647 + :max-angle 4079.8164 + :coll-rad 819.6096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 29 + :parent-joint -1 + :geo-tform (new 'static 'vector :x -1.0) + :axial-slop 1887.9647 + :max-angle 4675.866 + :coll-rad 1035.0592 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 30 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6594 :z -0.7516 :w 12366.753) + :geo-tform (new 'static 'vector :x 0.9085 :y -0.4097 :z -0.0797 :w 4672.098) + :axial-slop 1887.9647 + :max-angle 2759.9941 + :coll-rad 2022.1952 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 31 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z 0.0053 :w 4255.4893) + :geo-tform (new 'static 'vector :x -0.6493 :y -0.1997 :z 0.7335 :w 28478.05) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 32 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9915 :z 0.1286 :w 10408.628) + :geo-tform (new 'static 'vector :x -0.8244 :y -0.5619 :z 0.065 :w 15611.349) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1471.6927 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 33 + :parent-joint 3 + :pre-tform (new 'static 'vector :x -0.6605 :z 0.7505 :w 12360.744) + :geo-tform (new 'static 'vector :x 0.9954 :y 0.0188 :z -0.0925 :w 37012.13) + :axial-slop 1887.9647 + :max-angle 2989.7524 + :coll-rad 2006.6304 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 34 + :parent-joint -1 + :pre-tform (new 'static 'vector :x 0.9998 :z -0.0013 :w 4262.1885) + :geo-tform (new 'static 'vector :x 0.9329 :y -0.0745 :z -0.3517 :w 23086.13) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1437.2864 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 35 + :parent-joint -1 + :pre-tform (new 'static 'vector :x -0.9773 :z 0.2109 :w 9797.359) + :geo-tform (new 'static 'vector :x 0.9079 :y 0.0423 :z -0.4165 :w 20326.883) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 1318.5024 + :hit-sound (static-sound-name "mh-bat-ragdoll") + ) + (new 'static 'ragdoll-joint-setup + :joint-index 36 + :parent-joint 6 + :pre-tform (new 'static 'vector :x 1.0 :w 21138.729) + :geo-tform (new 'static 'vector :x -0.6322 :y -0.3636 :z 0.684 :w 1500.7925) + :axial-slop 1887.9647 + :max-angle 1766.8142 + :coll-rad 1608.4991 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 37 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.3751 :z -0.9269 :w 5793.9287) + :geo-tform (new 'static 'vector :x -0.1097 :y -0.6822 :z 0.7226 :w 21710.604) + :axial-slop 1887.9647 + :max-angle 3980.7112 + :coll-rad 637.3376 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 38 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.3763 :z 0.9263 :w 5778.3457) + :geo-tform (new 'static 'vector :x 0.7524 :y 0.1215 :z 0.647 :w 18734.613) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 482.9184 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 39 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.1845 :z -0.9828 :w 3915.7214) + :geo-tform (new 'static 'vector :x -0.342 :y 0.753 :z -0.562 :w 32853.996) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 521.0112 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 40 + :parent-joint 25 + :pre-tform (new 'static 'vector :x -0.1853 :z 0.9825 :w 3901.449) + :geo-tform (new 'static 'vector :x 0.6881 :y 0.2026 :z 0.6964 :w 18306.844) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 524.288 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 41 + :parent-joint 25 + :pre-tform (new 'static 'vector :x 0.0055 :z -0.9998 :w 3042.2903) + :geo-tform (new 'static 'vector :x -0.3492 :y 0.73 :z -0.5871 :w 34187.945) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 614.8096 + ) + (new 'static 'ragdoll-joint-setup + :joint-index 42 + :parent-joint 25 + :pre-tform (new 'static 'vector :x 0.0055 :z 0.9998 :w 3029.875) + :geo-tform (new 'static 'vector :x 0.6216 :y 0.2236 :z 0.7505 :w 17720.426) + :axial-slop 1887.9647 + :max-angle 3748.7683 + :coll-rad 705.3312 + ) + ) + ) + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +;; failed to figure out what this is: +(set! (-> *mh-bat-enemy-info* fact-defaults) *fact-info-mh-bat-defaults*) + +;; definition for method 120 of type mh-bat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this mh-bat)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd)) + (set! (-> s4-0 prim-core action) (collide-action solid semi-solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 6144.0 0.0 10649.6) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core action) (collide-action semi-solid)) + (set-vector! (-> v1-13 local-sphere) 0.0 6144.0 0.0 10240.0) + ) + (set-vector! + (-> (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)) local-sphere) + 0.0 + 6144.0 + 0.0 + 8192.0 + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-17 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-17 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-17 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function mh-bat-fly-code +;; WARN: new jak 2 until loop case, check carefully +(defbehavior mh-bat-fly-code mh-bat ((arg0 (function object :behavior mh-bat))) + (ja-channel-push! 2 (seconds 0.1)) + (until #f + (ja-no-eval :group! mh-bat-fly-glide0-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (let ((a0-3 (-> self skel root-channel 1))) + (let ((f0-4 (-> self flap-interp))) + (set! (-> a0-3 frame-interp 1) f0-4) + (set! (-> a0-3 frame-interp 0) f0-4) + ) + (set! (-> a0-3 frame-group) (the-as art-joint-anim mh-bat-fly-fast0-ja)) + (set! (-> a0-3 param 0) 0.0) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim mh-bat-fly-fast0-ja) num-func-chan) + ) + (until (ja-done? 0) + (suspend) + (let ((s5-0 (cubic-curve-method-12 (-> self move-curve) (new 'stack-no-clear 'vector) 0.0)) + (s4-0 (vector-flatten! (new 'stack-no-clear 'vector) (-> self root transv) (-> self rotation-matrix fvec))) + ) + (vector-flatten! s5-0 s5-0 (the-as vector (-> self rotation-matrix))) + (set! (-> s5-0 y) (fmax 0.0 (-> s5-0 y))) + (seek! + (-> self flap-interp) + (lerp-scale 0.5 1.0 (vector-length s5-0) 0.0 163840.0) + (* 4.0 (seconds-per-frame)) + ) + (seek! + (-> self anim-speed) + (fmax + (lerp-scale 1.0 3.0 (vector-length s5-0) 0.0 327680.0) + (lerp-scale 0.5 4.0 (vector-length s4-0) 0.0 245760.0) + ) + (* 5.0 (seconds-per-frame)) + ) + ) + (ja :num! (seek! max (-> self anim-speed))) + (let ((a0-13 (-> self skel root-channel 1))) + (let ((f0-22 (-> self flap-interp))) + (set! (-> a0-13 frame-interp 1) f0-22) + (set! (-> a0-13 frame-interp 0) f0-22) + ) + (set! (-> a0-13 param 0) 0.0) + (joint-control-channel-group-eval! a0-13 (the-as art-joint-anim #f) num-func-chan) + ) + ) + (if arg0 + (arg0) + ) + ) + #f + ) + +;; definition for function mh-bat-fly-post +(defbehavior mh-bat-fly-post mh-bat () + (cubic-curve-method-9 + (-> self move-curve) + (-> self root trans) + (-> self root transv) + (-> self event-param-point) + (-> self target-velocity) + ) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (new 'stack-no-clear 'vector) + (let ((gp-0 (-> self up-vector))) + (let ((s4-0 (-> self root transv))) + (cubic-curve-method-11 (-> self move-curve) s4-0 0.0) + (vector-length-max! s4-0 245760.0) + (set! (-> s4-0 y) (fmax -61440.0 (fmin 61440.0 (-> s4-0 y)))) + (vector-v++! (-> self root trans) s4-0) + (cubic-curve-method-12 (-> self move-curve) s5-0 0.0) + (vector-length-max! s5-0 327680.0) + (vector-v++! s4-0 s5-0) + ) + (let* ((v1-13 (vector-flatten! (new 'stack-no-clear 'vector) s5-0 (the-as vector (-> self rotation-matrix)))) + (f0-3 (lerp-scale 9102.223 -9102.223 (vector-dot (-> self rotation-matrix fvec) v1-13) 245760.0 -245760.0)) + ) + (seek! (-> self pitch-angle) f0-3 (* 32768.0 (seconds-per-frame))) + ) + (vector-rotate-around-axis! + gp-0 + (the-as quaternion *y-vector*) + (-> self pitch-angle) + (the-as vector (-> self rotation-matrix)) + ) + (let* ((v1-17 (vector-flatten! (new 'stack-no-clear 'vector) s5-0 *y-vector*)) + (f0-9 (lerp-scale + -15473.777 + 15473.777 + (vector-dot (the-as vector (-> self rotation-matrix)) v1-17) + 163840.0 + -163840.0 + ) + ) + ) + (seek! (-> self bank-angle) f0-9 (* 10922.667 (seconds-per-frame))) + ) + (vector-rotate-around-axis! gp-0 (the-as quaternion gp-0) (-> self bank-angle) (-> self rotation-matrix fvec)) + ) + ) + 0 + (enemy-simple-post) + (none) + ) + +;; definition for function mh-bat-chase-post +(defbehavior mh-bat-chase-post mh-bat () + (mh-bat-method-159 self) + (mh-bat-fly-post) + (none) + ) + +;; failed to figure out what this is: +(defstate dormant-aware (mh-bat) + :virtual #t + :trans (behavior () + (if (and (time-elapsed? (-> self state-time) (-> self state-timeout)) + (< (vector-vector-xz-distance (-> self root trans) (target-pos 0)) 368640.0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (and (and (nav-mesh-method-10 (-> self nav-mesh) gp-1 (target-pos 0) (the-as nav-poly #f)) + (< (vector-vector-xz-distance gp-1 (target-pos 0)) 4096.0) + ) + *target* + (focus-test? *target* pilot-riding) + ) + ) + ) + (go-virtual ambush) + ) + ) + ) + +;; failed to figure out what this is: +(defstate ambush (mh-bat) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set-time! (-> self state-time)) + (set! (-> self start-pos quad) (-> self root trans quad)) + (set-vector! (-> self root transv) 0.0 -81920.0 0.0 0.0) + (set! (-> self orbit-angle) + (vector-vector-angle-safe + (vector-! (new 'stack-no-clear 'vector) (-> self focus-pos) (-> self root trans)) + *z-vector* + ) + ) + (set! (-> self anim-speed) 0.0) + (set! (-> self y-offset) 24576.0) + (get-point-at-percent-along-path! (-> self path) (-> self event-param-point) 1.0 'interp) + (vector-! (-> self target-velocity) (-> self focus-pos) (-> self event-param-point)) + (set! (-> self target-velocity y) 0.0) + (vector-xz-normalize! (-> self target-velocity) 245760.0) + (logclear! (-> self mask) (process-mask actor-pause)) + ) + :exit (behavior () + (set-scale! self 1.0) + ) + :code (behavior () + (mh-bat-fly-code + (lambda :behavior mh-bat + () + (if (or (< (vector-vector-distance (-> self root trans) (-> self event-param-point)) 40960.0) + (< (vector-length (cubic-curve-method-12 (-> self move-curve) (new 'stack-no-clear 'vector) 0.0)) 65536.0) + ) + (go-virtual hostile) + ) + ) + ) + ) + :post (behavior () + (set-scale! self (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 30.0 540.0)) + (mh-bat-fly-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-2 (-> self focus-xz-dir))) + (forward-up->quaternion gp-1 a1-2 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate retreat (mh-bat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self event-param-point quad) (-> self start-pos quad)) + (vector-reset! (-> self target-velocity)) + ) + :code (behavior () + (mh-bat-fly-code (lambda :behavior mh-bat + () + (when (< (vector-vector-distance (-> self root trans) (-> self start-pos)) 8192.0) + (if (logtest? (-> self enemy-flags) (enemy-flag actor-pause-backup)) + (logior! (-> self mask) (process-mask actor-pause)) + (logclear! (-> self mask) (process-mask actor-pause)) + ) + (go-dormant-aware self) + ) + ) + ) + ) + :post (behavior () + (set-scale! self (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self state-time))) 420.0 1500.0)) + (mh-bat-fly-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-2 (-> self focus-xz-dir))) + (forward-up->quaternion gp-1 a1-2 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate stare (mh-bat) + :virtual #t + :trans (behavior () + '() + ) + :code (behavior () + (mh-bat-fly-code (lambda :behavior mh-bat () (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (let ((gp-0 (-> self focus aware))) + (cond + ((>= 1 (the-as int gp-0)) + (go-virtual retreat) + ) + ((and (= gp-0 (enemy-aware ea3)) (get-focus! self)) + (go-hostile self) + ) + ((= gp-0 (enemy-aware ea4)) + (go-flee self) + ) + ) + ) + ) + ) + ) + ) + :post (behavior () + (let ((gp-0 (-> self target-velocity))) + (vector-! gp-0 (-> self focus-pos) (-> self event-param-point)) + (vector-normalize! gp-0 1.0) + (vector-cross! gp-0 gp-0 *y-vector*) + (vector-normalize! gp-0 245760.0) + ) + (mh-bat-chase-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-6 (-> self focus-xz-dir))) + (forward-up->quaternion gp-1 a1-6 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (mh-bat) + :virtual #t + :enter (behavior () + (let ((t9-1 (-> (find-parent-state) enter))) + (if t9-1 + (t9-1) + ) + ) + (set! (-> self bank-angle) 0.0) + (set! (-> self pitch-angle) 0.0) + (set! (-> self orbit-distance) (* 4096.0 (rnd-float-range self 17.0 30.0))) + (set! (-> self orbit-angular-speed) (* 182.04445 (rnd-float-range self 35.0 55.0))) + ) + :code (behavior () + (mh-bat-fly-code + (lambda :behavior mh-bat () (if (and (time-elapsed? (-> self state-time) (seconds 2)) + (time-elapsed? (-> self last-off-screen-time) (seconds 1)) + (get-focus! self) + ) + (go-virtual attack-0) + ) + ) + ) + ) + :post (behavior () + (set! (-> self orbit-angle) + (the float + (sar (shl (the int (+ (-> self orbit-angle) (* (-> self orbit-angular-speed) (seconds-per-frame)))) 48) 48) + ) + ) + (let ((gp-0 (-> self target-velocity))) + (vector-! gp-0 (-> self focus-pos) (-> self event-param-point)) + (vector-normalize! gp-0 1.0) + (vector-cross! gp-0 gp-0 *y-vector*) + (vector-normalize! gp-0 245760.0) + ) + (mh-bat-chase-post) + (let ((gp-1 (new 'stack-no-clear 'quaternion))) + (let ((a1-7 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0))) + (forward-up->quaternion gp-1 a1-7 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-1 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate attack-0 (mh-bat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self orbit-distance) (* 2.0 (-> self orbit-distance))) + (set! (-> self target-speed) 245760.0) + ) + :trans (behavior () + (let ((a0-0 (-> self target-velocity))) + (vector-! a0-0 (-> self focus-pos) (-> self event-param-point)) + (vector-normalize! a0-0 (-> self target-speed)) + ) + (seek! (-> self target-speed) 0.0 (* 245760.0 (seconds-per-frame))) + (seek! (-> self orbit-distance) 20480.0 (* 24576.0 (seconds-per-frame))) + ) + :code (behavior () + (mh-bat-fly-code (lambda :behavior mh-bat + () + (when (time-elapsed? (-> self state-time) (seconds 0.2)) + (if (or (>= 2 (the-as int (-> self focus aware))) (not (get-focus! self))) + (go-virtual hostile) + ) + ) + (if (< (acos (vector-dot (-> self focus-xz-dir) (-> self rotation-matrix fvec))) 8192.0) + (go-virtual attack-1) + ) + ) + ) + ) + :post (behavior () + (mh-bat-chase-post) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (let ((a1-1 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> self root transv) 1.0)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-bullseye-pos) (-> self root trans))) + ) + (forward-up->quaternion gp-0 a1-1 (-> self up-vector)) + (forward-up->quaternion s5-0 s4-1 (-> self up-vector)) + ) + (quaternion-slerp! + gp-0 + gp-0 + s5-0 + (lerp-scale 0.0 1.0 (the float (- (current-time) (-> self state-time))) 0.0 900.0) + ) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 (* 6.0 (seconds-per-frame))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate attack-1 (mh-bat) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (let ((gp-0 (new 'stack-no-clear 'matrix))) + (let ((a1-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) + (matrix-f-compose gp-0 a1-1) + ) + (vector<-cspace! (-> gp-0 trans) (joint-node mh-bat-lod0-jg jaw)) + ) + (if (logtest? (-> *part-group-id-table* 635 flags) (sp-group-flag sp13)) + (part-tracker-spawn + part-tracker-subsampler + :to self + :group (-> *part-group-id-table* 635) + :target self + :mat-joint 36 + ) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 635) :target self :mat-joint 36) + ) + ) + :trans (behavior () + (seek! (-> self anim-speed) 1.0 (* 4.0 (seconds-per-frame))) + (seek! (-> self target-speed) 0.0 (* 245760.0 (seconds-per-frame))) + (seek! (-> self orbit-distance) 20480.0 (* 24576.0 (seconds-per-frame))) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! mh-bat-attack0-windup-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))) + ) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((a2-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-bat-lod0-jg jaw))) + (v1-23 (-> self focus-bullseye-pos)) + ) + (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 notify-handle) (process->handle self)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((a0-16 *game-info*) + (a1-12 (+ (-> a0-16 attack-id) 1)) + ) + (set! (-> a0-16 attack-id) a1-12) + (set! (-> gp-0 attack-id) a1-12) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 3.33) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-impulse-factor) 1.5) + (logior! (-> gp-0 options) (projectile-options po16)) + (set! (-> gp-0 pos quad) (-> a2-2 quad)) + (vector-normalize-copy! (-> gp-0 vel) (vector-! (new 'stack-no-clear 'vector) v1-23 a2-2) 532480.0) + ) + (spawn-projectile metalhead-shot gp-0 self *default-dead-pool*) + ) + (sound-play "mh-bat-shot") + (ja-no-eval :group! mh-bat-attack0-ja :num! (seek! max (-> self anim-speed)) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max (-> self anim-speed))) + ) + (set! (-> self orbit-angle) (the float (sar (shl (the int (+ 32768.0 (-> self orbit-angle))) 48) 48))) + (vector-normalize-copy! (-> self root transv) (-> self rotation-matrix fvec) 49152.0) + (go-virtual hostile) + ) + :post (behavior () + (mh-bat-chase-post) + (let ((gp-0 (new 'stack-no-clear 'quaternion))) + (let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> self focus-bullseye-pos) (-> self root trans)))) + (vector-normalize! s5-1 1.0) + (forward-up->quaternion gp-0 s5-1 (-> self up-vector)) + ) + (quaternion-slerp! (-> self root quat) (-> self root quat) gp-0 (* 4.0 (seconds-per-frame))) + ) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (mh-bat) + :virtual #t + :exit (behavior () + (let ((t9-1 (-> (find-parent-state) exit))) + (if t9-1 + (t9-1) + ) + ) + (deactivate-ragdoll! self) + ) + :code (behavior () + (cond + ((handle->process (-> self ragdoll-proc)) + (ja-channel-push! 1 0) + (ja-no-eval :group! mh-bat-fly-fast0-ja :num! (seek! max 2.0) :frame-num 0.0) + (enable-ragdoll! (-> (the-as ragdoll-proc (handle->process (-> self ragdoll-proc))) ragdoll) self) + (until (ja-done? 0) + (suspend) + (ja :num! (seek! max 2.0)) + ) + ) + (else + (ja-channel-push! 1 (seconds 0.2)) + (ja-no-eval :group! (-> self draw art-group data (-> self enemy-info idle-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + ) + (if (enemy-method-109 self) + (go-die self) + (go-hostile self) + ) + ) + ) + +;; definition for method 158 of type mh-bat +(defmethod mh-bat-method-158 ((this mh-bat)) + (local-vars (at-0 int) (at-1 int)) + (with-pp + (rlet ((vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (-> this nav-mesh)) + (v1-1 (-> this root trans)) + (gp-0 (-> this root transv)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((a0-2 s4-0)) + (.lvf vf1 (&-> gp-0 quad)) + (let ((f0-0 (seconds-per-frame))) + (.mov at-0 f0-0) + ) + (.mov vf2 at-0) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> a0-2 quad) vf1) + ) + (let ((s3-0 (new 'stack-no-clear 'nav-poly))) + (vector-! (the-as vector (-> s3-0 vertex)) v1-1 (the-as vector (-> s5-0 bounds))) + (set! (-> s3-0 vertex1 x) 40960000.0) + (set! (-> s3-0 data 20) (the-as uint 3)) + (let ((a2-0 (nav-mesh-method-45 s5-0 s3-0))) + (when a2-0 + (clamp-vector-to-mesh-cross-gaps + s5-0 + (the-as vector (-> s3-0 vertex)) + a2-0 + s4-0 + 2048.0 + #f + (the-as clamp-travel-vector-to-mesh-return-info #f) + ) + (.lvf vf1 (&-> s4-0 quad)) + (let ((f0-2 (-> pp clock frames-per-second))) + (.mov at-1 f0-2) + ) + (.mov vf2 at-1) + (.mov.vf vf1 vf0 :mask #b1000) + (.mul.x.vf vf1 vf1 vf2 :mask #b111) + (.svf (&-> gp-0 quad) vf1) + gp-0 + ) + ) + ) + ) + ) + ) + ) + +;; definition for method 159 of type mh-bat +;; WARN: Return type mismatch int vs none. +(defmethod mh-bat-method-159 ((this mh-bat)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (vector-rotate-y! s5-0 *z-vector* (-> this orbit-angle)) + (vector-xz-normalize! s5-0 (- (-> this orbit-distance))) + (vector+! (-> this event-param-point) (-> this focus-pos) s5-0) + ) + (+! (-> this event-param-point y) (-> this y-offset)) + (let* ((s5-1 (new 'stack-no-clear 'vector)) + (a1-3 (nav-mesh-method-10 (-> this nav-mesh) s5-1 (-> this event-param-point) (the-as nav-poly #f))) + ) + (cond + (a1-3 + (vector-! s5-1 s5-1 (the-as vector (-> this nav-mesh bounds))) + (project-point-onto-plane-of-poly-local (-> this nav-mesh) a1-3 s5-1 (new 'stack-no-clear 'vector) s5-1) + (vector+! s5-1 s5-1 (the-as vector (-> this nav-mesh bounds))) + (if (< (-> this event-param-point y) (+ 24576.0 (-> s5-1 y))) + (+! (-> this y-offset) (* 57344.0 (seconds-per-frame))) + (seek! (-> this y-offset) 24576.0 (* 32768.0 (seconds-per-frame))) + ) + (set! (-> this event-param-point x) (-> s5-1 x)) + (set! (-> this event-param-point z) (-> s5-1 z)) + ) + (else + (seek! (-> this y-offset) 24576.0 (* 65536.0 (seconds-per-frame))) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 160 of type mh-bat +;; WARN: Return type mismatch int vs none. +(defmethod set-scale! ((this mh-bat) (arg0 float)) + (set-vector! (-> this root scale) arg0 arg0 arg0 1.0) + 0 + (none) + ) + +;; definition for method 161 of type mh-bat +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod probe-shadow ((this mh-bat)) + (cond + ((and (-> this draw shadow) + (zero? (-> this draw cur-lod)) + (logtest? (-> this draw status) (draw-control-status on-screen)) + ) + (when (= (logand (-> this shadow-id) 7) (logand (-> *display* frame-clock integral-frame-counter) 15)) + (new 'stack-no-clear 'vector) + (new 'stack-no-clear 'vector) + (let ((s4-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (-> this draw shadow-ctrl settings shadow-dir)) + (f30-0 81920.0) + ) + (set! (-> s4-0 start-pos quad) (-> this root trans quad)) + (vector-normalize-copy! (-> s4-0 move-dist) s5-0 f30-0) + (let ((v1-17 s4-0)) + (set! (-> v1-17 radius) 3276.8) + (set! (-> v1-17 collide-with) (collide-spec backgnd)) + (set! (-> v1-17 ignore-process0) this) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (let ((f0-1 (fill-and-probe-using-line-sphere *collide-cache* s4-0))) + (cond + ((>= f0-1 0.0) + (let ((v1-21 (-> this draw shadow-ctrl))) + (logclear! (-> v1-21 settings flags) (shadow-flags disable-draw)) + ) + 0 + (-> s4-0 best-other-tri intersect) + (let ((a1-3 (-> this root trans))) + (-> a1-3 y) + (let ((f1-2 (* f0-1 f30-0))) + (shadow-control-method-14 + (-> this draw shadow-ctrl) + a1-3 + s5-0 + (fmax 32768.0 (* 409600.0 f0-1)) + (+ -12288.0 f1-2) + (+ 12288.0 f1-2) + ) + ) + ) + ) + (else + (let ((v1-33 (-> this draw shadow-ctrl))) + (logior! (-> v1-33 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + ) + ) + ) + ) + (else + (let ((v1-36 (-> this draw shadow-ctrl))) + (logior! (-> v1-36 settings flags) (shadow-flags disable-draw)) + ) + 0 + ) + ) + 0 + (none) + ) + +;; definition for method 89 of type mh-bat +(defmethod within-gspot-range? ((this mh-bat)) + #f + ) + +;; definition for method 50 of type mh-bat +;; WARN: Return type mismatch int vs none. +(defmethod enemy-method-50 ((this mh-bat) (arg0 int)) + (let ((v1-0 arg0)) + (cond + ((or (zero? v1-0) (= v1-0 2)) + (let ((v1-4 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-4 prim-core action) (collide-action)) + (set! (-> v1-4 prim-core collide-with) (collide-spec)) + ) + 0 + ) + ((= v1-0 1) + (let ((v1-8 (-> (the-as collide-shape-prim-group (-> this root root-prim)) child 1))) + (set! (-> v1-8 prim-core action) (collide-action solid)) + (set! (-> v1-8 prim-core collide-with) (collide-spec backgnd)) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for method 126 of type mh-bat +;; WARN: Return type mismatch ragdoll-flag vs vector. +(defmethod ragdoll-spawn! ((this mh-bat) (arg0 symbol) (arg1 symbol)) + (let ((t9-0 (method-of-type enemy ragdoll-spawn!))) + (t9-0 this arg0 arg1) + ) + (the-as + vector + (when (-> this enemy-info ragdoll-info) + (let ((v1-4 (handle->process (-> this ragdoll-proc)))) + (when v1-4 + (let ((v0-1 (logior (-> (the-as ragdoll-proc v1-4) ragdoll ragdoll-flags) (ragdoll-flag rf11)))) + (set! (-> (the-as ragdoll-proc v1-4) ragdoll ragdoll-flags) v0-1) + v0-1 + ) + ) + ) + ) + ) + ) + +;; definition for method 59 of type mh-bat +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this mh-bat)) + (if (not (logtest? (-> this draw status) (draw-control-status on-screen))) + (set-time! (-> this last-off-screen-time)) + ) + (quaternion->matrix (-> this rotation-matrix) (-> this root quat)) + (when (< 1 (the-as int (-> this focus aware))) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (set! (-> this focus-pos quad) (-> (get-trans s5-0 0) quad)) + (set! (-> this focus-bullseye-pos quad) (-> (get-trans s5-0 3) quad)) + (vector-! (-> this focus-xz-dir) (-> this focus-pos) (-> this root trans)) + (set! (-> this focus-xz-dir y) 0.0) + (vector-xz-normalize! (-> this focus-xz-dir) 1.0) + ) + ) + ) + (probe-shadow this) + ((method-of-type enemy enemy-common-post) this) + (none) + ) + +;; definition for method 82 of type mh-bat +(defmethod event-handler ((this mh-bat) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (go (method-of-object this knocked)) + ) + (('event-flap) + (sound-play-by-name + (static-sound-name "mh-wing-flap") + (new-sound-id) + (the int (* 1024.0 (-> this flap-interp))) + 0 + 0 + (sound-group) + (-> this root trans) + ) + ) + (else + (call-parent-method this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 27 of type mh-bat +(defmethod get-inv-mass ((this mh-bat)) + 0.5 + ) + +;; definition for method 67 of type mh-bat +(defmethod coin-flip? ((this mh-bat)) + #f + ) + +;; definition for method 121 of type mh-bat +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this mh-bat)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-bat" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *mh-bat-enemy-info*) + (set-scale! this 1.0) + (set! (-> this root pause-adjust-distance) 368640.0) + (let ((v1-9 (-> this neck))) + (set! (-> v1-9 up) (the-as uint 1)) + (set! (-> v1-9 nose) (the-as uint 2)) + (set! (-> v1-9 ear) (the-as uint 0)) + (set-vector! (-> v1-9 twist-max) 11832.889 15473.777 0.0 1.0) + (set! (-> v1-9 ignore-angle) 30947.555) + ) + (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 nav-mesh) (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0)) + (if (not (-> this nav-mesh)) + (go process-drawable-art-error "no nav-mesh") + ) + (let ((s5-1 (new 'static 'boxed-array :type uint32 #x8 #xb #x1f #x22))) + (dotimes (s4-1 (-> s5-1 length)) + (let ((s3-0 (-> this node-list data (-> s5-1 s4-1)))) + (set! (-> s3-0 param0) (lambda ((arg0 cspace) (arg1 transformq)) + (let ((f0-0 (the-as float (-> arg0 param1)))) + (vector-float*! (-> arg1 scale) (-> arg1 scale) f0-0) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + ) + (set! (-> s3-0 param1) (the-as basic (rnd-float-range this 0.02 0.4))) + ) + ) + ) + (if (not (task-node-closed? (game-task-node nest-eggs-resolution))) + (logior! (-> this mask) (process-mask no-kill)) + ) + (let ((s5-2 (new 'static 'array int32 4 0 0 0 0))) + (set! (-> this shadow-id) (-> s5-2 0)) + (+! (-> s5-2 0) (rand-vu-int-range 5 10)) + ) + (set-vector! (-> this draw color-emissive) 0.1 0.1 0.1 0.0) + (set! (-> this flap-interp) 0.0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc new file mode 100644 index 0000000000..d558711dac --- /dev/null +++ b/test/decompiler/reference/jak3/levels/nest/mh-centipede-part_REF.gc @@ -0,0 +1,1629 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for function birth-func-ground-dirt-bounce +;; WARN: Return type mismatch float vs none. +(defun birth-func-ground-dirt-bounce ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (set! (-> arg1 omega) (-> arg2 launchrot y)) + (none) + ) + +;; definition for function spt-func-ground-dirt-bounce1 +;; INFO: Used lq/sq +(defun spt-func-ground-dirt-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 2493) s4-0) + ) + ) + (none) + ) + +;; definition for function spt-func-ground-dirt-bounce2 +;; INFO: Used lq/sq +(defun spt-func-ground-dirt-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (when (and (< (-> arg2 launchrot y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! s4-0 (-> arg2 launchrot x) (-> arg1 omega) (-> arg2 launchrot z) 1.0) + (launch-particles (-> *part-id-table* 2494) s4-0) + ) + ) + (none) + ) + +;; definition for function spt-birth-func-brightness-mh-centipede-rocks +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 21) 100)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; definition for function spt-birth-func-brightness-mh-centipede-dirt +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 31) 70)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 25)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; definition for function spt-birth-func-brightness-mh-centipede-dust +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 41) 70)) + (s3-0 (logand 0 (rand-uint31-gen *random-generator*))) + (s4-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 25)) + (v1-6 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 6) 60)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 (the-as int s3-0)))) + (set! (-> arg2 rotate-y) (the float (- s5-0 s4-0))) + (set! (-> arg2 rotate-z) (the float (- s5-0 v1-6))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-before-breach + :id 641 + :duration (seconds 0.017) + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2495 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2496 :fade-after (meters 200) :falloff-to (meters 200)) + ) + ) + +;; failed to figure out what this is: +(defpart 2495 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 0.5) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 16.0 16.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.026666667) + (:accel-y (meters 0.00033333333) (meters 0.001)) + (:friction 0.96 0.02) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2496 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-before-breach-rocks) + (:num 1.0) + (:x (meters 0) (meters 10)) + (:scale-x (meters 0.4) (meters 0.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.023333333) (meters 0.023333333)) + (:rotvel-z (degrees -5) (degrees 10)) + (:accel-y (meters -0.001)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-mh-centipede-before-breach-rocks) + (:conerot-x (degrees -5) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-before-breach-rocks +(defun spt-birth-func-part-mh-centipede-before-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; definition for function spt-func-part-mh-centipede-before-breach-rocks +(defun spt-func-part-mh-centipede-before-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (check-drop-group-center arg0 arg1 arg2) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-breach + :id 642 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2497 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2498 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2499 :fade-after (meters 200) :falloff-to (meters 200)) + ) + ) + +;; failed to figure out what this is: +(defpart 2497 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 2.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2498 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-dirt) + (:num 4.0) + (:x (meters 0) (meters 6)) + (:y (meters 3)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-breach-dirt +(defun spt-birth-func-part-mh-centipede-breach-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dirt arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpart 2499 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-rocks) + (:num 4.0) + (:x (meters 3) (meters 2)) + (:y (meters 0.5)) + (:scale-x (meters 1) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 1) (meters 2)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-mh-centipede-breach-rocks) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-breach-rocks +(defun spt-birth-func-part-mh-centipede-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; definition for function spt-func-part-mh-centipede-breach-rocks +(defun spt-func-part-mh-centipede-breach-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce1 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +;; failed to figure out what this is: +(defpart 2493 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-rocks-bounce1) + (:num 1.0) + (:scale-x (meters 2) (meters 1) :store) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x40ae00 + #x40ad00 + #x40ac00 + #x40ab00 + #x40aa00 + #x40a900 + #x40a800 + #x40a700 + #x40a600 + #x40a500 + #x40a400 + #x40a300 + #x40a200 + #x40a100 + #x408c00 + #x408b00 + ) + ) + (:func 'spt-func-part-mh-centipede-breach-rocks-bounce1) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-breach-rocks-bounce1 +(defun spt-birth-func-part-mh-centipede-breach-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; definition for function spt-func-part-mh-centipede-breach-rocks-bounce1 +(defun spt-func-part-mh-centipede-breach-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce2 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +;; definition for function spt-func-ground-dirt-bounce3 +;; WARN: Return type mismatch object vs none. +(defun spt-func-ground-dirt-bounce3 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (cond + ((or (< (-> arg1 omega) (-> arg2 launchrot y)) (< 0.0 (-> arg1 vel-sxvel y))) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + ) + (else + (set! (-> arg1 acc x) 0.0) + (set! (-> arg1 acc y) 0.0) + (set! (-> arg1 acc z) 0.0) + (set! (-> arg1 vel-sxvel x) (* 0.7 (-> arg1 vel-sxvel x))) + (set! (-> arg1 vel-sxvel z) (* 0.7 (-> arg1 vel-sxvel z))) + (set! (-> arg2 launchrot y) (-> arg1 omega)) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defpart 2494 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-breach-rocks-bounce2) + (:num 1.0) + (:scale-x '*sp-temp*) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.0033333334) (meters 0.016666668)) + (:scalevel-x (meters -0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-ground-dirt-bounce3) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-breach-rocks-bounce2 +(defun spt-birth-func-part-mh-centipede-breach-rocks-bounce2 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-crater-mark + :id 643 + :flags (sp0 sp1) + :bounds (static-bspherem 0 0 0 30) + :parts ((sp-item 2500 :flags (is-3d sp3 sp7))) + ) + +;; failed to figure out what this is: +(defpart 2500 + :init-specs ((:texture (crack01 desert-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:scale-y (meters 2) (meters 2)) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy r) + (:a 0.0) + (:scalevel-x (meters 0.016666668) (meters 0.5)) + (:scalevel-y (meters 0.016666668) (meters 0.033333335)) + (:fade-a 2.56 0.85333335) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-4 left-multiply-quat)) + (:next-time (seconds 0.085)) + (:next-launcher 2501) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 2501 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:next-time (seconds 2)) + (:next-launcher 2502) + ) + ) + +;; failed to figure out what this is: +(defpart 2502 + :init-specs ((:fade-a -0.08533333)) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-dirt-fall-off + :id 644 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2503 :fade-after (meters 200) :falloff-to (meters 200))) + ) + +;; failed to figure out what this is: +(defpart 2503 + :init-specs ((:texture (ceiling-dust lwassig-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 0.5) + (:scale-x (meters 5) (meters 2)) + (:scale-y :copy scale-x) + (:r 100.0) + (:g 60.0 20.0) + (:b 30.0 10.0) + (:a 8.0 8.0) + (:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.21333334 0.21333334) + (:accel-y (meters -0.00033333333) (meters -0.00066666666)) + (:friction 0.96 0.02) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z left-multiply-quat)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x6a200100 #x6a200100 #x405c00)) + (:next-time (seconds 0.335)) + (:next-launcher 2504) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2504 + :init-specs ((:fade-a 0.0) (:next-time (seconds 0.5)) (:next-launcher 2505)) + ) + +;; failed to figure out what this is: +(defpart 2505 + :init-specs ((:fade-a -0.053333335 -0.053333335)) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-impact + :id 645 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2506 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2507 :fade-after (meters 200) :falloff-to (meters 200)) + (sp-item 2508 :fade-after (meters 200) :falloff-to (meters 200)) + ) + ) + +;; failed to figure out what this is: +(defpart 2506 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 2.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:vel-y (meters 0.013333334) (meters 0.1)) + (:scalevel-x (meters 0.006666667) (meters 0.01)) + (:rotvel-z (degrees -0.1) (degrees 0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.064 -0.064) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.96) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 80) (degrees 10)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2507 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-impact-dirt) + (:num 10.0) + (:x (meters 0) (meters 6)) + (:y (meters 3)) + (:scale-x (meters 2) (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.06666667)) + (:scalevel-x (meters 0.0033333334)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-impact-dirt +(defun spt-birth-func-part-mh-centipede-impact-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dirt arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpart 2508 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-impact-rocks) + (:num 4.0) + (:x (meters 3) (meters 2)) + (:y (meters 2)) + (:scale-x (meters 1) (meters 2) :store) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.06666667) (meters 0.06666667)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0033333334)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'spt-func-part-mh-centipede-impact-rocks) + (:conerot-x (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-impact-rocks +(defun spt-birth-func-part-mh-centipede-impact-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; definition for function spt-func-part-mh-centipede-impact-rocks +(defun spt-func-part-mh-centipede-impact-rocks ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce1 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +;; failed to figure out what this is: +(defpart 2509 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-impact-rocks-bounce1) + (:num 1.0) + (:scale-x '*sp-temp*) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 2) (meters 1)) + (:r 70.0 50.0) + (:g :copy r) + (:b :copy r) + (:a 128.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:rotvel-z (degrees -1) (degrees 2)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x40ae00 + #x40ad00 + #x40ac00 + #x40ab00 + #x40aa00 + #x40a900 + #x40a800 + #x40a700 + #x40a600 + #x40a500 + #x40a400 + #x40a300 + #x40a200 + #x40a100 + #x408c00 + #x408b00 + ) + ) + (:func 'spt-func-part-mh-centipede-impact-rocks-bounce1) + (:conerot-x (degrees 5) (degrees 30)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-impact-rocks-bounce1 +(defun spt-birth-func-part-mh-centipede-impact-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-ground-dirt-bounce arg0 arg1 arg2 arg3 arg4) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; definition for function spt-func-part-mh-centipede-impact-rocks-bounce1 +(defun spt-func-part-mh-centipede-impact-rocks-bounce1 ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (sparticle-texture-animate arg0 arg1 (the-as vector arg2)) + (spt-func-ground-dirt-bounce2 arg0 arg1 arg2 (the-as none arg3) (the-as none arg4)) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-impact-dust-up + :id 646 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 12) + :parts ((sp-item 2510 :fade-after (meters 200) :falloff-to (meters 200))) + ) + +;; failed to figure out what this is: +(defpart 2510 + :init-specs ((:texture (dirtpuff01 level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-dust) + (:num 1.0) + (:scale-x (meters 5) (meters 5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:vel-y (meters 0.16666667) (meters 0.016666668)) + (:scalevel-x (meters 0.006666667) (meters 0.02)) + (:rotvel-z (degrees -0.033333335) (degrees 0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.06533334 -0.06533334) + (:accel-y (meters 0) (meters 0.00033333333)) + (:friction 0.95 0.01) + (:timer (seconds 10)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-brightness-mh-centipede-blood +;; WARN: Return type mismatch float vs none. +(defun spt-birth-func-brightness-mh-centipede-blood ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (let ((s5-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 81) 40)) + (s3-0 (+ (mod (the-as int (rand-uint31-gen *random-generator*)) 11) 20)) + (s4-0 (logand 0 (rand-uint31-gen *random-generator*))) + (v1-5 (+ (logand 0 (rand-uint31-gen *random-generator*)) 120)) + ) + (set! (-> arg2 rotate-x) (the float (- s5-0 s3-0))) + (set! (-> arg2 rotate-y) (the float (- s5-0 (the-as int s4-0)))) + (set! (-> arg2 rotate-z) (the float (- s5-0 (the-as int v1-5)))) + ) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-death + :id 647 + :flags (sp0) + :bounds (static-bspherem 0 0 0 50) + :parts ((sp-item 2511 :period (seconds 30) :length (seconds 0.135)) + (sp-item 2512 :period (seconds 30) :length (seconds 0.135)) + ) + ) + +;; failed to figure out what this is: +(defpart 2511 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-explosion-lots) + (:num 10.0) + (:x (meters -3) (meters 6)) + (:y (meters -3) (meters 6)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 3) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0026666666) (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x406500 #x404a00)) + (:next-time (seconds 0.5)) + (:next-launcher 2513) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-explosion-lots +(defun spt-birth-func-part-mh-centipede-explosion-lots ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-blood arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpart 2513 + :init-specs ((:scalevel-x (meters 0.0033333334)) (:scalevel-y :copy scalevel-x)) + ) + +;; failed to figure out what this is: +(defpart 2512 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-explosion) + (:num 0.5) + (:x (meters -3) (meters 6)) + (:y (meters -3) (meters 6)) + (:z (meters -3) (meters 6)) + (:scale-x (meters 3) (meters 3)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:omega (degrees 0)) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:rotvel-z (degrees -0.2) (degrees 0.4)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.21333334 -0.21333334) + (:accel-y (meters -0.0033333334) (meters -0.0026666666)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x406500 #x404a00)) + (:func 'check-mh-centipede-explosion-level) + (:next-time (seconds 0.5)) + (:next-launcher 2513) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-explosion +(defun spt-birth-func-part-mh-centipede-explosion ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-blood arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpartgroup part-mh-centipede-explosion-splats + :id 648 + :duration (seconds 5) + :flags (sp0 sp4) + :bounds (static-bspherem 0 -12 0 14) + :parts ((sp-item 2514 :period (seconds 20) :length (seconds 0.2)) + (sp-item 2515 :period (seconds 20) :length (seconds 0.067) :offset 125) + (sp-item 2516 :flags (is-3d) :period (seconds 20) :length (seconds 0.067)) + (sp-item 2517 :flags (is-3d) :period (seconds 20) :length (seconds 0.5) :offset 150) + (sp-item 2518 :period (seconds 20) :length (seconds 0.167) :offset 20) + ) + ) + +;; failed to figure out what this is: +(defpart 2514 + :init-specs ((:texture (splash level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 5.0) + (:scale-x (meters 1)) + (:scale-y (meters 1)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-z (meters 0.06666667) (meters 0.006666667)) + (:friction 0.96) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata 0.0) + (:func 'live-func-curve) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mhcent-splash-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 20.0 :y 40.0 :w 128.0) + (new 'static 'vector :x 90.0 :y 128.0 :w 128.0) + (new 'static 'vector :x 90.0 :y 128.0 :w 128.0) + (new 'static 'vector :x 90.0 :y 128.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mhcent-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 64.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :x 64.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mhcent-splash-scale-x* (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 2.0 :z 3.0 :w 4.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mhcent-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 1.0 :y 4.0 :z 5.0 :w 6.0) + :one-over-x-deltas (new 'static 'vector :x 3.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mhcent-splash-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.1 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :w 1.0) + :one-over-x-deltas (new 'static 'vector :x 10.0 :y -1.1111112 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mhcent-splash-scale-x* (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 2.0 :z 3.0 :w 4.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-mhcent-splash-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.4 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 2.0 :z 0.5) + :one-over-x-deltas (new 'static 'vector :x 5.0 :y -5.0000005 :z -1.6666666 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-mh-centipede-splash-curve-settings*, type particle-curve-settings +(define *part-mh-centipede-splash-curve-settings* + (new 'static 'particle-curve-settings :lifetime-base (seconds 0.65) :lifetime-offset (seconds 0.1)) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2514 init-specs 13 initial-valuef) + (the-as float *part-mh-centipede-splash-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* color-start) *range-mhcent-splash-color*) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* alpha-start) *range-mhcent-splash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* scale-x-start) *range-mhcent-splash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* scale-y-start) *range-mhcent-splash-scale-y*) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* a-scalar) *curve-mhcent-splash-alpha*) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* scale-x-scalar) *curve-mhcent-splash-scale-x*) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-splash-curve-settings* scale-y-scalar) *curve-mhcent-splash-scale-y*) + +;; failed to figure out what this is: +(defpart 2516 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-blood) + (:num 1.0 2.0) + (:x (meters -5) (meters 10)) + (:z (meters -5) (meters 10)) + (:scale-x (meters 1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y (meters 1) (meters 0.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.01) (meters 0.02)) + (:scalevel-y (meters 0.01) (meters 0.02)) + (:fade-a -0.10666667) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 2519) + ) + ) + +;; failed to figure out what this is: +(defpart 2519 + :init-specs ((:scalevel-x (meters 0.001) (meters 0.00033333333)) (:scalevel-y (meters 0.001) (meters 0.00033333333))) + ) + +;; failed to figure out what this is: +(defpart 2518 + :init-specs ((:texture (lakedrop level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-blood) + (:num 1.0) + (:x (meters 0) (meters 3)) + (:scale-x (meters 0.1) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 32.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:accel-y (meters -0.0016666667)) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees -40) (degrees 80)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2517 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-brightness-mh-centipede-blood) + (:num 0.5 1.0) + (:x (meters 1) (meters 10)) + (:scale-x (meters 0.1) (meters 0.5)) + (:rot-y (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0 128.0) + (:scalevel-x (meters 0.0026666666) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.2125) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 left-multiply-quat)) + (:next-time (seconds 0.335)) + (:next-launcher 2519) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function check-mh-centipede-explosion-level +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defun check-mh-centipede-explosion-level ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 vector)) + (when (and (< (-> arg2 y) (-> arg1 omega)) (< (-> arg1 vel-sxvel y) 0.0)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (sp-kill-particle arg0 arg1) + (set-vector! gp-0 (-> arg2 x) (-> arg1 omega) (-> arg2 z) 1.0) + (cond + ((logtest? (-> *part-group-id-table* 648 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker-subsampler :to *entity-pool* :group (-> *part-group-id-table* 648)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> gp-0 quad)) + (part-tracker-spawn part-tracker :to *entity-pool* :group (-> *part-group-id-table* 648)) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-shot-trail + :id 649 + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 2520 :fade-after (meters 120) :falloff-to (meters 120)) (sp-item 2521 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2521 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5) (meters 0.2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0 64.0) + (:b 0.0) + (:a 16.0) + (:omega (degrees 6761.25)) + (:fade-a -0.8) + (:timer (seconds 0.05)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 3072.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2520 + :init-specs ((:texture (redpuff level-default-sprite)) + (:num 1.0 3.0) + (:scale-x (meters 0.8) (meters 0.8)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 0.0) + (:a 32.0 32.0) + (:vel-y (meters -0.006666667) (meters -0.006666667)) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r -3.2) + (:fade-g -1.6) + (:fade-b -3.2) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.97) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.135)) + (:next-launcher 2522) + ) + ) + +;; failed to figure out what this is: +(defpart 2522 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.10666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-centipede-shot-explosion + :id 650 + :duration (seconds 4) + :flags (sp0 sp5) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 2523 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2524 :fade-after (meters 400) :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2525 :flags (sp3) :period (seconds 30) :length (seconds 0.017)) + (sp-item 2526 :period (seconds 30) :length (seconds 0.167)) + (sp-item 2527 :period (seconds 30) :length (seconds 0.5)) + (sp-item 2528 :falloff-to (meters 400) :period (seconds 30) :length (seconds 0.035)) + (sp-item 2529 :falloff-to (meters 400) :period (seconds 30) :length (seconds 0.067)) + (sp-item 2530 :falloff-to (meters 400) :period (seconds 30) :length (seconds 0.167) :offset 100) + ) + ) + +;; failed to figure out what this is: +(defpart 2529 + :init-specs ((:texture (water-drops level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-shot-explosion-dirt) + (:num 20.0) + (:x (meters 0) (meters 2)) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:omega (degrees 0.225)) + (:vel-y (meters 0.033333335) (meters 0.13333334)) + (:scalevel-x (meters 0.0033333334) (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:accel-y (meters -0.0033333334)) + (:friction 0.99) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 5 1 0 #x406500 #x404a00)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.4)) + (:next-launcher 2531) + (:conerot-x (degrees 0) (degrees 20)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2531 + :init-specs ((:rotvel-z (degrees -0.2) (degrees 0.4)) (:fade-a -0.256) (:friction 0.95 0.04) (:func 'nothing)) + ) + +;; definition for function spt-birth-func-part-mh-centipede-shot-explosion-dirt +(defun spt-birth-func-part-mh-centipede-shot-explosion-dirt ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dirt arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpart 2530 + :init-specs ((:birth-func 'spt-birth-func-part-mh-centipede-shot-explosion-dust) + (:num 2.0) + (:x (meters 0) (meters 5)) + (:y (meters 8) (meters 5)) + (:scale-x (meters 1) (meters 2)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 0.0) + (:scalevel-x (meters 0.0033333334) (meters 0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.16 0.16) + (:accel-y (meters -0.001)) + (:friction 0.94 0.04) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13)) + (:userdata :data (new 'static 'boxed-array :type int32 10 1 0 #x6a200100 #x405c00)) + (:next-time (seconds 0.5)) + (:next-launcher 2532) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2532 + :init-specs ((:fade-a -0.03047619 -0.03047619)) + ) + +;; definition for function spt-birth-func-part-mh-centipede-shot-explosion-dust +(defun spt-birth-func-part-mh-centipede-shot-explosion-dust ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-dust arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpart 2525 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 2.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0) + (:b 40.0) + (:a 128.0) + (:omega (degrees 6767.9995)) + (:scalevel-x (meters -0.33333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.135)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 4096.0) + ) + ) + +;; failed to figure out what this is: +(defpart 2523 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 20)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 40.0) + (:a 64.0) + (:fade-a -0.21333334) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + ) + ) + +;; failed to figure out what this is: +(defpart 2528 + :init-specs ((:texture (rockbit01 level-default-sprite)) + (:birth-func 'spt-birth-func-part-mh-centipede-shot-explosion-bits) + (:num 10.0) + (:x (meters 0) (meters 4)) + (:scale-x (meters 0.2) (meters 0.4)) + (:rot-z (degrees 0) (degrees 3600)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.1)) + (:rotvel-z (degrees -3.0000002) (degrees 6.0000005)) + (:accel-y (meters -0.0013333333) (meters -0.00066666666)) + (:timer (seconds 4)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 launch-along-z)) + (:userdata :data (new 'static 'boxed-array :type int32 + 10 + 1 + 0 + #x408b00 + #x408c00 + #x40a100 + #x40a200 + #x40a300 + #x40a400 + #x40a500 + #x40a600 + #x40a700 + #x40a800 + #x40a900 + #x40aa00 + #x40ab00 + #x40ac00 + #x40ad00 + #x40ae00 + ) + ) + (:func 'sparticle-texture-animate) + (:conerot-z (degrees 0) (degrees 40)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; definition for function spt-birth-func-part-mh-centipede-shot-explosion-bits +(defun spt-birth-func-part-mh-centipede-shot-explosion-bits ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo) (arg3 object) (arg4 object)) + (birth-func-texture-group-2d arg0 arg1 arg2 arg3 arg4) + (spt-birth-func-brightness-mh-centipede-rocks arg0 arg1 arg2 arg3 arg4) + (none) + ) + +;; failed to figure out what this is: +(defpart 2524 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 10.0) + (:scale-x (meters 2) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 160.0) + (:b 40.0) + (:a 128.0) + (:vel-y (meters 0) (meters 0.033333335)) + (:scalevel-x (meters 0.01)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.13333334) + (:fade-b -0.05) + (:fade-a -0.21333334 -0.21333334) + (:friction 0.93) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2526 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 2.0) + (:scale-x (meters 2) (meters 1)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 80.0 20.0) + (:b 30.0) + (:a 128.0) + (:vel-y (meters 0.16666667) (meters 0.06666667)) + (:scalevel-x (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.17777778) + (:fade-b -0.06666667) + (:fade-a -0.28444445 -0.28444445) + (:friction 0.7) + (:timer (seconds 1.5)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 2527 + :init-specs ((:texture (explo-texture level-default-sprite)) + (:birth-func 'birth-func-curve) + (:num 1.0) + (:x (meters -1) (meters 2)) + (:y (meters 0) (meters 2)) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:vel-y (meters 0.033333335) (meters 0.016666668)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-14)) + (:userdata 0.0) + (:func 'live-func-curve) + (:conerot-x (degrees 20) (degrees 90)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mh-centipede-shot-explo-color* (new 'static 'curve-color-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'inline-array vector 4 + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + (new 'static 'vector :x 255.0 :y 255.0 :z 255.0 :w 128.0) + ) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mh-centipede-shot-explo-alpha* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 128.0 :y 128.0 :z 129.0 :w 130.0) + :one-over-x-deltas (new 'static 'vector :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mh-centipede-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.0) + :one-over-x-deltas (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *range-mh-centipede-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -1.0 :z -2.0 :w -3.0) + :ys (new 'static 'vector :x 2.0 :y 3.0 :z 4.0 :w 5.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-mh-centipede-shot-explo-alpha* + (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.05 :z -0.7 :w -1.0) + :ys (new 'static 'vector :y 1.0 :z 0.8) + :one-over-x-deltas (new 'static 'vector :x 20.0 :y -0.3076923 :z -2.6666665 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mh-centipede-shot-explo-scale-x* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; failed to figure out what this is: +(if #t + (set! *curve-mh-centipede-shot-explo-scale-y* (new 'static 'curve2d-fast + :xs (new 'static 'vector :y -0.8 :z -1.0 :w -2.0) + :ys (new 'static 'vector :y 1.0 :z 1.5 :w 2.5) + :one-over-x-deltas (new 'static 'vector :x 1.25 :y 2.5000002 :z 1.0 :w 1.0) + ) + ) + ) + +;; definition for symbol *part-mh-centipede-shot-explosion-texture-curve-settings*, type particle-curve-settings +(define *part-mh-centipede-shot-explosion-texture-curve-settings* (new 'static 'particle-curve-settings + :lifetime-base (seconds 0.1) + :lifetime-offset (seconds 0.6) + :flags (particle-curve-flags pcf0) + ) + ) + +;; failed to figure out what this is: +(set! (-> *part-id-table* 2527 init-specs 16 initial-valuef) + (the-as float *part-mh-centipede-shot-explosion-texture-curve-settings*) + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* color-start) + *range-mh-centipede-shot-explo-color* + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* alpha-start) + *range-mh-centipede-shot-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-x-start) + *range-mh-centipede-shot-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-y-start) + *range-mh-centipede-shot-explo-scale-y* + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* r-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* g-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* b-scalar) #f) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* a-scalar) + *curve-mh-centipede-shot-explo-alpha* + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-x-scalar) + *curve-mh-centipede-shot-explo-scale-x* + ) + +;; failed to figure out what this is: +(set! (-> *part-mh-centipede-shot-explosion-texture-curve-settings* scale-y-scalar) + *curve-mh-centipede-shot-explo-scale-y* + ) + +;; failed to figure out what this is: +(defpartgroup group-beast-mh-centipede-shot-glow + :id 651 + :flags (sp0) + :bounds (static-bspherem 0 0 0 40) + :parts ((sp-item 2533 :flags (sp6))) + ) + +;; failed to figure out what this is: +(defpart 2533 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:scalevel-x (meters -0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.2)) + (:flags (sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2534 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 2)) + (:scale-y :copy scale-x) + (:r 110.0) + (:g 1.0) + (:b 255.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 2535 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 8)) + (:scale-y :copy scale-x) + (:r 110.0) + (:g 1.0) + (:b 255.0) + (:a 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc b/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc new file mode 100644 index 0000000000..10a653d8f7 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/nest/mh-centipede_REF.gc @@ -0,0 +1,3709 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition for symbol *mh-centipede-sphere-1*, type sphere +(define *mh-centipede-sphere-1* (new 'static 'sphere :x -3276800.0 :z 2048000.0 :r 8192000.0)) + +;; definition for symbol *mh-centipede-sphere-2*, type sphere +(define *mh-centipede-sphere-2* (new 'static 'sphere :x 6144000.0 :z 2048000.0 :r 1310720.0)) + +;; definition for function nest-hunt-find-sphere +(defun nest-hunt-find-sphere ((arg0 vector)) + (cond + ((< (vector-vector-distance *mh-centipede-sphere-1* arg0) (-> *mh-centipede-sphere-1* r)) + *mh-centipede-sphere-1* + ) + ((< (vector-vector-distance *mh-centipede-sphere-2* arg0) (-> *mh-centipede-sphere-2* r)) + *mh-centipede-sphere-2* + ) + (else + (the-as sphere #f) + ) + ) + ) + +;; definition for function nest-hunt-same-sphere +(defun nest-hunt-same-sphere ((arg0 sphere) (arg1 vector)) + (and arg0 (= arg0 (nest-hunt-find-sphere arg1))) + ) + +;; definition for function nest-hunt-volume +(defun nest-hunt-volume ((arg0 sphere)) + (if (nest-hunt-same-sphere arg0 (target-pos 0)) + 1.0 + 0.1 + ) + ) + +;; definition for function nest-hunt-shake-amp +(defun nest-hunt-shake-amp ((arg0 vector)) + (if (nest-hunt-same-sphere (the-as sphere arg0) (target-pos 0)) + 1.0 + 0.01 + ) + ) + +;; definition for symbol *nest-hunt-speech-list*, type (inline-array talker-speech-class) +(define *nest-hunt-speech-list* (new 'static 'inline-array talker-speech-class 36 + (new 'static 'talker-speech-class :name "none") + (new 'static 'talker-speech-class + :name "sig224" + :channel (gui-channel sig) + :speech #x1 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig225" + :channel (gui-channel sig) + :speech #x2 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig226" + :channel (gui-channel sig) + :speech #x3 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig227" + :channel (gui-channel sig) + :speech #x4 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig228" + :channel (gui-channel sig) + :speech #x5 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig229" + :channel (gui-channel sig) + :speech #x6 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig230" + :channel (gui-channel sig) + :speech #x7 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig231" + :channel (gui-channel sig) + :speech #x8 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig232" + :channel (gui-channel sig) + :speech #x9 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig233" + :channel (gui-channel sig) + :speech #xa + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig234" + :channel (gui-channel sig) + :speech #xb + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig235" + :channel (gui-channel sig) + :speech #xc + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig236" + :channel (gui-channel sig) + :speech #xd + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig237" + :channel (gui-channel sig) + :speech #xe + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig238" + :channel (gui-channel sig) + :speech #xf + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig239" + :channel (gui-channel sig) + :speech #x10 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig240" + :channel (gui-channel sig) + :speech #x11 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig241" + :channel (gui-channel sig) + :speech #x12 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig242" + :channel (gui-channel sig) + :speech #x13 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig243" + :channel (gui-channel sig) + :speech #x14 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig244" + :channel (gui-channel sig) + :speech #x15 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig245" + :channel (gui-channel sig) + :speech #x16 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig246" + :channel (gui-channel sig) + :speech #x17 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig247" + :channel (gui-channel sig) + :speech #x18 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig248" + :channel (gui-channel sig) + :speech #x19 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig249" + :channel (gui-channel sig) + :speech #x1a + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig250" + :channel (gui-channel sig) + :speech #x1b + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig251" + :channel (gui-channel sig) + :speech #x1c + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig252" + :channel (gui-channel sig) + :speech #x1d + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig253" + :channel (gui-channel sig) + :speech #x1e + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig254" + :channel (gui-channel sig) + :speech #x1f + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig255" + :channel (gui-channel sig) + :speech #x20 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig256" + :channel (gui-channel sig) + :speech #x21 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig257" + :channel (gui-channel sig) + :speech #x22 + :neg #x1 + :on-close #f + :camera #f + ) + (new 'static 'talker-speech-class + :name "sig258" + :channel (gui-channel sig) + :speech #x23 + :neg #x1 + :on-close #f + :camera #f + ) + ) + ) + +;; definition of type nest-hunt-speech-instance +(deftype nest-hunt-speech-instance (structure) + ((speech uint16) + (probability float) + (flags nest-hunt-speech-instance-flag) + (play-count uint32) + ) + ) + +;; definition for method 3 of type nest-hunt-speech-instance +(defmethod inspect ((this nest-hunt-speech-instance)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nest-hunt-speech-instance) + (format #t "~1Tspeech: ~D~%" (-> this speech)) + (format #t "~1Tprobability: ~f~%" (-> this probability)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tplay-count: ~D~%" (-> this play-count)) + (label cfg-4) + this + ) + +;; definition of type nest-hunt-speech-info +(deftype nest-hunt-speech-info (structure) + ((speeches (array nest-hunt-speech-instance)) + (play-time time-frame) + (current-random time-frame) + (minimum-interval time-frame) + (random-interval time-frame) + (last-played int8) + (flags nest-hunt-speech-info-flag) + ) + ) + +;; definition for method 3 of type nest-hunt-speech-info +(defmethod inspect ((this nest-hunt-speech-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nest-hunt-speech-info) + (format #t "~1Tspeeches: ~A~%" (-> this speeches)) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (format #t "~1Tcurrent-random: ~D~%" (-> this current-random)) + (format #t "~1Tminimum-interval: ~D~%" (-> this minimum-interval)) + (format #t "~1Trandom-interval: ~D~%" (-> this random-interval)) + (format #t "~1Tlast-played: ~D~%" (-> this last-played)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (label cfg-4) + this + ) + +;; definition of type nest-hunt-speech-group +(deftype nest-hunt-speech-group (structure) + ((play-time time-frame) + (game-counter-last float) + (info (array nest-hunt-speech-info)) + ) + ) + +;; definition for method 3 of type nest-hunt-speech-group +(defmethod inspect ((this nest-hunt-speech-group)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'nest-hunt-speech-group) + (format #t "~1Tplay-time: ~D~%" (-> this play-time)) + (format #t "~1Tgame-counter-last: ~f~%" (-> this game-counter-last)) + (format #t "~1Tinfo: ~A~%" (-> this info)) + (label cfg-4) + this + ) + +;; definition for symbol *nest-hunt-speech*, type nest-hunt-speech-group +(define *nest-hunt-speech* (new 'static 'nest-hunt-speech-group + :info (new 'static 'boxed-array :type nest-hunt-speech-info + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #x1 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x2 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x3 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x4 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x6 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x11 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x12 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1b :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x5 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1d :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1c :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x19 :probability 1.0) + ) + :minimum-interval (seconds 10) + :random-interval (seconds 3) + :flags (nest-hunt-speech-info-flag nhs0 nhs1) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance + :speech #xd + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs4) + ) + (new 'static 'nest-hunt-speech-instance :speech #x7 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x1e :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x8 :probability 1.0) + (new 'static 'nest-hunt-speech-instance + :speech #x21 + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs3) + ) + (new 'static 'nest-hunt-speech-instance + :speech #x1a + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs3) + ) + ) + :minimum-interval (seconds 20) + :random-interval (seconds 3) + :flags (nest-hunt-speech-info-flag nhs0) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #x9 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #xb :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x22 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x23 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x20 :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 2) + :flags (nest-hunt-speech-info-flag nhs0) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #xa :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #xf :probability 1.0) + ) + :minimum-interval (seconds 10) + :random-interval (seconds 2) + :flags (nest-hunt-speech-info-flag nhs0) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #xc :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #xe :probability 1.0) + (new 'static 'nest-hunt-speech-instance + :speech #x10 + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs4) + ) + (new 'static 'nest-hunt-speech-instance + :speech #x13 + :probability 1.0 + :flags (nest-hunt-speech-instance-flag nhs4) + ) + ) + ) + (new 'static 'nest-hunt-speech-info + :speeches (new 'static 'boxed-array :type nest-hunt-speech-instance + (new 'static 'nest-hunt-speech-instance :speech #x14 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x15 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x16 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x17 :probability 1.0) + (new 'static 'nest-hunt-speech-instance :speech #x18 :probability 1.0) + ) + :minimum-interval (seconds 15) + :random-interval (seconds 5) + :flags (nest-hunt-speech-info-flag nhs0) + ) + ) + ) + ) + +;; definition for function reset-nest-hunt-speeches +(defun reset-nest-hunt-speeches ((arg0 float)) + (set! (-> *nest-hunt-speech* game-counter-last) arg0) + (set! (-> *nest-hunt-speech* play-time) 0) + (dotimes (v1-2 (-> *nest-hunt-speech* info length)) + (let ((a0-3 (-> *nest-hunt-speech* info v1-2))) + (dotimes (a1-2 (-> a0-3 speeches length)) + (set! (-> a0-3 speeches a1-2 play-count) (the-as uint 0)) + ) + (set! (-> a0-3 play-time) 0) + (set! (-> a0-3 current-random) 0) + (set! (-> a0-3 last-played) -1) + ) + ) + #f + ) + +;; definition for function nest-hunt-play-speech +;; WARN: Return type mismatch int vs none. +;; WARN: Function nest-hunt-play-speech has a return type of none, but the expression builder found a return statement. +(defun nest-hunt-play-speech ((arg0 int) (arg1 sphere)) + (let ((gp-0 (-> *nest-hunt-speech* info arg0))) + (if (zero? (-> gp-0 speeches length)) + (return 0) + ) + (if (and (logtest? (-> gp-0 flags) (nest-hunt-speech-info-flag nhs1)) + (or (not arg1) (>= (vector-vector-distance arg1 (target-pos 0)) (-> arg1 r))) + ) + (return 0) + ) + (if (logtest? (-> gp-0 flags) (nest-hunt-speech-info-flag nhs0)) + (set! (-> gp-0 play-time) (-> *nest-hunt-speech* play-time)) + ) + (if (not (time-elapsed? (-> gp-0 play-time) (+ (-> gp-0 minimum-interval) (-> gp-0 current-random)))) + (return 0) + ) + (let ((f30-0 0.0) + (s5-1 (-> gp-0 speeches 0 play-count)) + ) + (dotimes (v1-23 (-> gp-0 speeches length)) + (let ((a0-10 (-> gp-0 speeches v1-23))) + (cond + ((or (< s5-1 (-> a0-10 play-count)) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs1)) (nonzero? (-> gp-0 play-time))) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs2)) (zero? (-> gp-0 play-time))) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs0)) (> (-> a0-10 play-count) 0)) + (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs3)) + (!= (-> *game-info* counter) (-> *nest-hunt-speech* game-counter-last)) + ) + (or (and (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs4)) (< 4.0 (-> *game-info* counter))) + (and (not (logtest? (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs5))) (= (-> gp-0 last-played) v1-23)) + ) + ) + (logclear! (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs6)) + ) + ((= (-> a0-10 play-count) s5-1) + (+! f30-0 (-> a0-10 probability)) + (logior! (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs6)) + ) + (else + (set! s5-1 (-> a0-10 play-count)) + (set! f30-0 (-> a0-10 probability)) + (logior! (-> a0-10 flags) (nest-hunt-speech-instance-flag nhs6)) + ) + ) + ) + ) + (let ((f0-5 (* f30-0 (rand-vu)))) + (dotimes (s4-1 (-> gp-0 speeches length)) + (let ((s3-1 (-> gp-0 speeches s4-1))) + (cond + ((or (not (logtest? (-> s3-1 flags) (nest-hunt-speech-instance-flag nhs6))) (< s5-1 (-> s3-1 play-count))) + ) + ((or (>= (-> s3-1 probability) f0-5) + (logtest? (-> s3-1 flags) (nest-hunt-speech-instance-flag nhs1)) + (and (logtest? (-> s3-1 flags) (nest-hunt-speech-instance-flag nhs3)) (zero? (-> s3-1 play-count))) + ) + (when (nonzero? (talker-spawn-func + (-> *nest-hunt-speech-list* (-> s3-1 speech)) + *entity-pool* + (target-pos 0) + (the-as region #f) + ) + ) + (set! (-> s3-1 play-count) (+ s5-1 1)) + (set-time! (-> *nest-hunt-speech* play-time)) + (set-time! (-> gp-0 play-time)) + (set! (-> gp-0 current-random) + (the-as time-frame (the int (* (rand-vu) (the float (-> gp-0 random-interval))))) + ) + (set! (-> gp-0 last-played) s4-1) + ) + (return 0) + ) + (else + (set! f0-5 (- f0-5 (-> gp-0 speeches s4-1 probability))) + ) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; definition for symbol *mh-centipede-shadow-control*, type shadow-control +(define *mh-centipede-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 163840.0) + :top-plane (new 'static 'plane :y 1.0 :w -163840.0) + ) + ) + ) + +;; failed to figure out what this is: +(defskelgroup skel-mh-centipede-eco-crystal-light eco-crystal-light eco-crystal-light-lod0-jg eco-crystal-light-idle-ja + ((eco-crystal-light-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 0.5) + :origin-joint-index 3 + ) + +;; definition of type rod-spawner +(deftype rod-spawner (process-drawable) + ((rod handle) + (minimap connection-minimap) + ) + (:state-methods + idle + wait-for-children + hidden + ) + ) + +;; definition for method 3 of type rod-spawner +(defmethod inspect ((this rod-spawner)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Trod: ~D~%" (-> this rod)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate wait-for-children (rod-spawner) + :virtual #t + :trans (behavior () + (if (not (-> self child)) + (deactivate self) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (rod-spawner) + :virtual #t + :enter (behavior () + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (set-time! (-> self state-time)) + (set-vector! (-> self root scale) 3.0 3.0 3.0 1.0) + (logclear! (-> self mask) (process-mask actor-pause)) + (let ((v1-8 (-> self entity extra perm))) + (logior! (-> v1-8 status) (entity-perm-status bit-5)) + (set! (-> self root trans x) (* 4096.0 (the float (-> v1-8 user-int16 0)))) + (set! (-> self root trans z) (* 4096.0 (the float (-> v1-8 user-int16 1)))) + ) + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 12) (the-as int #f) (the-as vector #t) 0)) + (let ((gp-0 (new 'stack-no-clear 'collide-query))) + (set-vector! (-> gp-0 move-dist) 0.0 -204800.0 0.0 1.0) + (set! (-> gp-0 start-pos quad) (-> self root trans quad)) + (+! (-> gp-0 start-pos y) 102400.0) + (let ((v1-17 gp-0)) + (set! (-> v1-17 radius) 409.6) + (set! (-> v1-17 collide-with) (collide-spec backgnd)) + (set! (-> v1-17 ignore-process0) #f) + (set! (-> v1-17 ignore-process1) #f) + (set! (-> v1-17 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-17 action-mask) (collide-action solid)) + ) + (let ((f0-15 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (cond + ((>= f0-15 0.0) + (let ((a0-22 (-> self root trans))) + (let ((v1-21 (-> gp-0 start-pos))) + (let ((a1-2 (-> gp-0 move-dist))) + (let ((a2-1 f0-15)) + (.mov vf7 a2-1) + ) + (.lvf vf5 (&-> a1-2 quad)) + ) + (.lvf vf4 (&-> v1-21 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a0-22 quad) vf6) + ) + (+! (-> self root trans y) 4096.0) + ) + (else + (format 0 "~A failed to find ground~%" (-> self name)) + ) + ) + ) + ) + (let ((gp-1 (new 'stack-no-clear 'task-arrow-params))) + (set! (-> gp-1 pos quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 quat)) + (set! (-> gp-1 flags) (task-arrow-flags taf3 taf5)) + (set! (-> gp-1 map-icon) (the-as uint 12)) + (set! (-> self rod) (process->handle (task-arrow-spawn gp-1 self))) + ) + ) + ) + :exit (behavior () + (send-event (handle->process (-> self rod)) 'die) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + :trans (behavior () + (let ((f0-0 (vector-vector-xz-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 28672.0) + ) + (when (< f0-0 (* f1-0 f1-0)) + (let* ((v1-6 (-> *game-info* sub-task-list (game-task-node nest-hunt-get-crystal))) + (a0-4 (handle->process (if (-> v1-6 manager) + (-> v1-6 manager manager) + (the-as handle #f) + ) + ) + ) + ) + (when a0-4 + (when (send-event a0-4 'complete) + (talker-spawn-func (-> *talker-speech* 133) *entity-pool* (target-pos 0) (the-as region #f)) + (cleanup-for-death self) + (go-virtual wait-for-children) + ) + ) + ) + ) + ) + (let* ((f0-2 (* 24.272593 (the float (- (current-time) (-> self state-time))))) + (f30-0 (- f0-2 (* (the float (the int (/ f0-2 65536.0))) 65536.0))) + ) + (quaternion-set! (-> self root quat) 0.0 (sin f30-0) 0.0 (cos f30-0)) + ) + ) + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate hidden (rod-spawner) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('appear) + (let ((a1-1 (the-as object (-> block param 0))) + (a0-3 (the-as object (-> block param 1))) + (v1-3 (-> self entity extra perm)) + ) + (logior! (-> v1-3 status) (entity-perm-status bit-5)) + (set! (-> v1-3 user-int16 0) (the int (* 0.00024414062 (-> (the-as vector a1-1) x)))) + (set! (-> v1-3 user-int16 1) (the int (* 0.00024414062 (-> (the-as vector a1-1) z)))) + (set! (-> v1-3 user-int16 2) (the int (* 0.00024414062 (-> (the-as vector a0-3) x)))) + (set! (-> v1-3 user-int16 3) (the int (* 0.00024414062 (-> (the-as vector a0-3) z)))) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + ) + (('apply-pos-from-entity) + (logclear! (-> self mask) (process-mask actor-pause)) + (go-virtual idle) + ) + ) + ) + :enter (behavior () + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (ja-post) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + ) + :trans (behavior () + '() + ) + :code sleep-code + ) + +;; definition for method 11 of type rod-spawner +(defmethod init-from-entity! ((this rod-spawner) (arg0 entity-actor)) + (set! (-> this root) (new 'process 'trsqv)) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as + skeleton-group + (art-group-get-by-name *level* "skel-mh-centipede-eco-crystal-light" (the-as (pointer level) #f)) + ) + (the-as pair 0) + ) + (set! (-> this rod) (the-as handle #f)) + (set! (-> this event-hook) (-> (method-of-object this hidden) event)) + (set! (-> this minimap) #f) + (cond + ((task-node-closed? (game-task-node nest-hunt-fight)) + (logclear! (-> this mask) (process-mask actor-pause)) + (go (method-of-object this idle)) + ) + (else + (go (method-of-object this hidden)) + ) + ) + ) + +;; definition of type mh-centipede-shot +(deftype mh-centipede-shot (projectile) + ((trail-part sparticle-launch-control) + ) + ) + +;; definition for method 3 of type mh-centipede-shot +(defmethod inspect ((this mh-centipede-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile inspect))) + (t9-0 this) + ) + (format #t "~2Ttrail-part: ~A~%" (-> this trail-part)) + (label cfg-4) + this + ) + +;; definition for method 7 of type mh-centipede-shot +(defmethod relocate ((this mh-centipede-shot) (offset int)) + (if (nonzero? (-> this trail-part)) + (&+! (-> this trail-part) offset) + ) + (call-parent-method this offset) + ) + +;; definition for method 25 of type mh-centipede-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this mh-centipede-shot)) + (if (nonzero? (-> this trail-part)) + (push-back (-> this trail-part) (-> this root trans)) + ) + 0 + (none) + ) + +;; definition for method 30 of type mh-centipede-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this mh-centipede-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-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 + jak + crate + civilian + enemy + obstacle + vehicle-sphere + hit-by-others-list + player-list + pusher + shield + ) + ) + (set! (-> v1-6 prim-core action) (collide-action solid)) + (set-vector! (-> v1-6 local-sphere) 0.0 0.0 0.0 3072.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-9 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-9 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-9 prim-core collide-with)) + ) + (set! (-> 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 31 of type mh-centipede-shot +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this mh-centipede-shot)) + (with-pp + (set! (-> this attack-mode) 'eco-dark) + pp + (set! (-> this trail-part) + (the-as + sparticle-launch-control + (new 'process 'sparticle-subsampler *sp-particle-system-2d* (-> *part-id-table* 2520) 10.0) + ) + ) + (set! (-> this sound-id) (new-sound-id)) + ((method-of-type projectile init-proj-settings!) this) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate moving (mh-centipede-shot) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type projectile moving) trans))) + (if t9-0 + (t9-0) + ) + ) + (if (logtest? (collide-status + on-surface + on-ground + touch-surface + touch-wall + touch-ceiling + touch-actor + on-special-surface + touch-edge + no-touch + blocked + on-water + impact-surface + touch-background + stuck + touch-ceiling-sticky + glance + probe-hit + ) + (-> self root status) + ) + (go-impact! self) + ) + ) + ) + +;; failed to figure out what this is: +(defstate impact (mh-centipede-shot) + :virtual #t + :enter (behavior () + (sound-play-by-name + (static-sound-name "cent-fire-bomb") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (nest-hunt-find-sphere (-> self root trans))))) + 0 + 0 + (sound-group) + (-> self root trans) + ) + (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 + (let ((gp-1 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-1 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-1 spawn-quat)) + (set! (-> gp-1 radius) 8192.0) + (set! (-> gp-1 scale) 1.0) + (set! (-> gp-1 group) (-> *part-group-id-table* 650)) + (set! (-> gp-1 collide-with) + (collide-spec backgnd jak crate enemy obstacle vehicle-sphere hit-by-others-list player-list pusher shield) + ) + (set! (-> gp-1 damage) 1.0) + (set! (-> gp-1 damage-scale) 1.0) + (set! (-> gp-1 vehicle-damage-factor) 0.333) + (set! (-> gp-1 vehicle-impulse-factor) 1.0) + (set! (-> gp-1 ignore-proc) (process->handle #f)) + (explosion-spawn gp-1 (ppointer->process (-> self parent))) + ) + (send-event (ppointer->process (-> self parent)) 'shot-hit (-> self root trans)) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (time-elapsed? (-> self state-time) (seconds 10)) (not (-> self child))) + (deactivate self) + (go empty-state) + ) + ) + :code sleep-code + ) + +;; definition of type mh-centipede-crater-pt +(deftype mh-centipede-crater-pt (structure) + ((collision-pt vector :inline) + (normal vector :inline) + (found? symbol) + (angle float) + ) + ) + +;; definition for method 3 of type mh-centipede-crater-pt +(defmethod inspect ((this mh-centipede-crater-pt)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mh-centipede-crater-pt) + (format #t "~1Tcollision-pt: #~%" (-> this collision-pt)) + (format #t "~1Tnormal: #~%" (-> this normal)) + (format #t "~1Tfound?: ~A~%" (-> this found?)) + (format #t "~1Tangle: ~f~%" (-> this angle)) + (label cfg-4) + this + ) + +;; definition of type mh-centipede-crater-pt-array +(deftype mh-centipede-crater-pt-array (structure) + ((points mh-centipede-crater-pt 20 :inline) + (origin vector :inline) + (radius float) + (current-point int32) + ) + (:methods + (init! (_type_ vector float) none) + (mh-centipede-crater-pt-array-method-10 (_type_) none) + (mh-centipede-crater-pt-array-method-11 (_type_ process) none) + ) + ) + +;; definition for method 3 of type mh-centipede-crater-pt-array +(defmethod inspect ((this mh-centipede-crater-pt-array)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mh-centipede-crater-pt-array) + (format #t "~1Tpoints[20] @ #x~X~%" (-> this points)) + (format #t "~1Torigin: #~%" (-> this origin)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tcurrent-point: ~D~%" (-> this current-point)) + (label cfg-4) + this + ) + +;; definition for method 9 of type mh-centipede-crater-pt-array +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init! ((this mh-centipede-crater-pt-array) (arg0 vector) (arg1 float)) + (set! (-> this origin quad) (-> arg0 quad)) + (set! (-> this radius) arg1) + (set! (-> this current-point) 0) + 0 + (none) + ) + +;; definition for method 10 of type mh-centipede-crater-pt-array +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 10 mh-centipede-crater-pt-array) has a return type of none, but the expression builder found a return statement. +(defmethod mh-centipede-crater-pt-array-method-10 ((this mh-centipede-crater-pt-array)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (if (>= (-> this current-point) 20) + (return 0) + ) + (let ((gp-0 (new 'stack-no-clear 'collide-query)) + (s5-0 (-> this points (-> this current-point))) + ) + (set! (-> s5-0 found?) #f) + (let* ((f0-0 3449.2632) + (f30-0 (* f0-0 (the float (-> this current-point)))) + (s3-0 (new 'stack-no-clear 'vector)) + ) + (let ((f0-3 (+ f30-0 (rand-vu-float-range (* -0.43 f0-0) (* 0.43 f0-0))))) + (set! (-> s5-0 angle) f0-3) + (sincos! s3-0 f0-3) + ) + (set! (-> s3-0 z) (* (-> s3-0 y) (-> this radius) (rand-vu-float-range 0.7 0.9))) + (set! (-> s3-0 y) 32768.0) + (set! (-> s3-0 x) (* (-> s3-0 x) (-> this radius) (rand-vu-float-range 0.7 0.9))) + (vector+! (-> gp-0 start-pos) (-> this origin) s3-0) + ) + (set-vector! (-> gp-0 move-dist) 0.0 -65536.0 0.0 1.0) + (let ((v1-13 gp-0)) + (set! (-> v1-13 radius) 409.6) + (set! (-> v1-13 collide-with) (collide-spec backgnd pusher)) + (set! (-> v1-13 ignore-process0) #f) + (set! (-> v1-13 ignore-process1) #f) + (set! (-> v1-13 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-13 action-mask) (collide-action solid)) + ) + (+! (-> this current-point) 1) + (let ((f0-16 (fill-and-probe-using-line-sphere *collide-cache* gp-0))) + (when (>= f0-16 0.0) + (let ((a1-5 (-> s5-0 collision-pt))) + (let ((v1-19 (-> gp-0 start-pos))) + (let ((a0-15 (-> gp-0 move-dist))) + (let ((a2-0 f0-16)) + (.mov vf7 a2-0) + ) + (.lvf vf5 (&-> a0-15 quad)) + ) + (.lvf vf4 (&-> v1-19 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> a1-5 quad) vf6) + ) + (+! (-> s5-0 collision-pt y) 204.8) + (set! (-> s5-0 found?) #t) + (vector-normalize-copy! (-> s5-0 normal) (-> gp-0 best-other-tri normal) 1.0) + (let ((s3-1 (new 'stack-no-clear 'vector)) + (s4-1 (new 'stack-no-clear 'inline-array 'vector 4)) + ) + (vector-cross! s3-1 (-> s5-0 normal) (vector-get-unique! (new 'stack-no-clear 'vector) (-> s5-0 normal))) + (vector-normalize! s3-1 10240.0) + (set! (-> s4-1 0 quad) (-> s3-1 quad)) + (vector-cross! (-> s4-1 1) s3-1 (-> s5-0 normal)) + (vector-negate! (-> s4-1 2) s3-1) + (vector-cross! (-> s4-1 3) (-> s5-0 normal) s3-1) + (vector-float*! s3-1 (-> s5-0 normal) 3072.0) + (dotimes (v1-28 4) + (vector+! (-> s4-1 v1-28) (-> s4-1 v1-28) s3-1) + (vector+! (-> s4-1 v1-28) (-> s4-1 v1-28) (-> s5-0 collision-pt)) + ) + (vector-float*! (-> gp-0 move-dist) s3-1 -2.0) + (let ((s3-2 (new 'stack-no-clear 'collide-query))) + (let ((a1-19 (new 'stack-no-clear 'bounding-box))) + (let* ((f0-21 409.6) + (f1-9 3072.0) + (f1-11 (* f1-9 f1-9)) + (f2-0 10240.0) + (f0-22 (+ f0-21 (sqrtf (+ f1-11 (* f2-0 f2-0))))) + (v1-38 (new 'stack-no-clear 'vector)) + ) + (set-vector! v1-38 f0-22 f0-22 f0-22 1.0) + (vector+! (-> a1-19 max) (-> s5-0 collision-pt) v1-38) + (vector-! (-> a1-19 min) (-> s5-0 collision-pt) v1-38) + ) + (set! (-> s3-2 collide-with) (collide-spec backgnd pusher)) + (set! (-> s3-2 ignore-process0) #f) + (set! (-> s3-2 ignore-process1) #f) + (set! (-> s3-2 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> s3-2 action-mask) (collide-action solid)) + (mem-copy! (the-as pointer (-> s3-2 bbox)) (the-as pointer a1-19) 32) + ) + (fill-using-bounding-box *collide-cache* s3-2) + ) + (dotimes (s3-3 4) + (set! (-> gp-0 start-pos quad) (-> s4-1 s3-3 quad)) + (when (< (probe-using-line-sphere *collide-cache* gp-0) 0.0) + (set! (-> s5-0 found?) #f) + (return 0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + +;; definition for method 11 of type mh-centipede-crater-pt-array +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +;; WARN: Function (method 11 mh-centipede-crater-pt-array) has a return type of none, but the expression builder found a return statement. +(defmethod mh-centipede-crater-pt-array-method-11 ((this mh-centipede-crater-pt-array) (arg0 process)) + (let ((s4-0 (new 'stack-no-clear 'vector))) + (set! (-> s4-0 x) 0.0) + (set! (-> s4-0 y) 409.6) + (set! (-> s4-0 z) 0.0) + (set! (-> s4-0 w) 1.0) + (let ((s3-0 (new 'stack-no-clear 'matrix))) + (dotimes (s2-0 4) + (+! (-> this current-point) -1) + (if (< (-> this current-point) 0) + (return 0) + ) + (let ((s1-0 (-> this points (-> this current-point)))) + (when (-> s1-0 found?) + (set! (-> s3-0 uvec quad) (-> s1-0 normal quad)) + (vector-cross! + (-> s3-0 rvec) + (-> s3-0 uvec) + (vector-! (new 'stack-no-clear 'vector) (-> s1-0 collision-pt) (-> this origin)) + ) + (vector-normalize! (-> s3-0 rvec) 1.0) + (vector-cross! (-> s3-0 fvec) (-> s3-0 rvec) (-> s3-0 uvec)) + (let ((s0-0 (matrix->quaternion (new 'stack-no-clear 'quaternion) s3-0))) + (quaternion-rotate-local-y! s0-0 s0-0 49152.0) + (quaternion->matrix s3-0 s0-0) + ) + (vector+! (-> s3-0 trans) (-> s1-0 collision-pt) s4-0) + (let ((v1-23 + (if (logtest? (-> *part-group-id-table* 643 flags) (sp-group-flag sp13)) + (part-tracker-spawn part-tracker-subsampler :to arg0 :group (-> *part-group-id-table* 643) :mat-joint s3-0) + (part-tracker-spawn part-tracker :to arg0 :group (-> *part-group-id-table* 643) :mat-joint s3-0) + ) + ) + ) + (send-event (ppointer->process v1-23) 'clock arg0) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defskelgroup skel-mh-centipede mh-centipede mh-centipede-lod0-jg mh-centipede-idle-ja + ((mh-centipede-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 37) + :shadow mh-centipede-shadow-mg + :origin-joint-index 49 + ) + +;; failed to figure out what this is: +(defskelgroup skel-mh-centipede-explode mh-centipede mh-centipede-explode-lod0-jg mh-centipede-explode-idle-ja + ((mh-centipede-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 6) + ) + +;; definition for symbol *mh-centipede-exploder-params*, type joint-exploder-static-params +(define *mh-centipede-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 12 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 13 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 14 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition of type mh-centipede-anim +(deftype mh-centipede-anim (structure) + ((anim int32) + (speed float) + (radius float) + (vulnerable-start float) + (vulnerable-end float) + ) + ) + +;; definition for method 3 of type mh-centipede-anim +(defmethod inspect ((this mh-centipede-anim)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'mh-centipede-anim) + (format #t "~1Tanim: ~D~%" (-> this anim)) + (format #t "~1Tspeed: ~f~%" (-> this speed)) + (format #t "~1Tradius: ~f~%" (-> this radius)) + (format #t "~1Tvulnerable-start: ~f~%" (-> this vulnerable-start)) + (format #t "~1Tvulnerable-end: ~f~%" (-> this vulnerable-end)) + (label cfg-4) + this + ) + +;; definition of type mh-centipede +(deftype mh-centipede (process-focusable) + ((root collide-shape-moving :override) + (launch-position vector :inline) + (landing-position vector :inline) + (flags mh-centipede-flag) + (incoming-attack-id uint32) + (hit-points float) + (appearance-order int8) + (before-breach-part sparticle-launch-control) + (breach-part sparticle-launch-control) + (dirt-fall-part sparticle-launch-control) + (impact-part sparticle-launch-control) + (impact-dust-part sparticle-launch-control) + (out-of-ground-crater mh-centipede-crater-pt-array :inline) + (into-ground-crater mh-centipede-crater-pt-array :inline) + (wait-time time-frame) + (pre-breach-time time-frame) + (breach-anims (array mh-centipede-anim)) + (shoot-anims (array mh-centipede-anim)) + (current-anim mh-centipede-anim) + (nose-smack-time time-frame) + (tail-smack-time time-frame) + (timeout time-frame) + (prev-anim-frame float) + (current-target-position vector :inline) + (prev-target-position vector :inline) + (prev-time time-frame) + (rumble-sound sound-id) + (rumble-sound-playing symbol) + (ground-sound sound-id) + (ground-sound-playing symbol) + (legs-sound sound-id) + (legs-sound-playing symbol) + (minimap connection-minimap) + (mm-handle handle) + (effect-sphere sphere) + ) + (:state-methods + hidden + wait-on-minimap + wait-off-minimap + pre-breach + breach + shooting + die + test + ) + (:methods + (mh-centipede-method-36 (_type_) none) + (probe-ground (_type_ vector) symbol) + (mh-centipede-method-38 (_type_ symbol) symbol) + (mh-centipede-method-39 (_type_) symbol) + (death-explosion (_type_ int) none) + (mh-centipede-method-41 (_type_) symbol) + (fire-shot (_type_) none) + ) + ) + +;; definition for method 3 of type mh-centipede +(defmethod inspect ((this mh-centipede)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-focusable inspect))) + (t9-0 this) + ) + (format #t "~2Tlaunch-position: #~%" (-> this launch-position)) + (format #t "~2Tlanding-position: #~%" (-> this landing-position)) + (format #t "~2Tflags: ~D~%" (-> this flags)) + (format #t "~2Tincoming-attack-id: ~D~%" (-> this incoming-attack-id)) + (format #t "~2Thit-points: ~f~%" (-> this hit-points)) + (format #t "~2Tappearance-order: ~D~%" (-> this appearance-order)) + (format #t "~2Tbefore-breach-part: ~A~%" (-> this before-breach-part)) + (format #t "~2Tbreach-part: ~A~%" (-> this breach-part)) + (format #t "~2Tdirt-fall-part: ~A~%" (-> this dirt-fall-part)) + (format #t "~2Timpact-part: ~A~%" (-> this impact-part)) + (format #t "~2Timpact-dust-part: ~A~%" (-> this impact-dust-part)) + (format #t "~2Tout-of-ground-crater: #~%" (-> this out-of-ground-crater)) + (format #t "~2Tinto-ground-crater: #~%" (-> this into-ground-crater)) + (format #t "~2Twait-time: ~D~%" (-> this wait-time)) + (format #t "~2Tpre-breach-time: ~D~%" (-> this pre-breach-time)) + (format #t "~2Tbreach-anims: ~A~%" (-> this breach-anims)) + (format #t "~2Tshoot-anims: ~A~%" (-> this shoot-anims)) + (format #t "~2Tcurrent-anim: #~%" (-> this current-anim)) + (format #t "~2Tnose-smack-time: ~D~%" (-> this nose-smack-time)) + (format #t "~2Ttail-smack-time: ~D~%" (-> this tail-smack-time)) + (format #t "~2Ttimeout: ~D~%" (-> this timeout)) + (format #t "~2Tprev-anim-frame: ~f~%" (-> this prev-anim-frame)) + (format #t "~2Tcurrent-target-position: #~%" (-> this current-target-position)) + (format #t "~2Tprev-target-position: #~%" (-> this prev-target-position)) + (format #t "~2Tprev-time: ~D~%" (-> this prev-time)) + (format #t "~2Trumble-sound: ~D~%" (-> this rumble-sound)) + (format #t "~2Trumble-sound-playing: ~A~%" (-> this rumble-sound-playing)) + (format #t "~2Tground-sound: ~D~%" (-> this ground-sound)) + (format #t "~2Tground-sound-playing: ~A~%" (-> this ground-sound-playing)) + (format #t "~2Tlegs-sound: ~D~%" (-> this legs-sound)) + (format #t "~2Tlegs-sound-playing: ~A~%" (-> this legs-sound-playing)) + (format #t "~2Tminimap: #~%" (-> this minimap)) + (format #t "~2Tmm-handle: ~D~%" (-> this mm-handle)) + (format #t "~2Teffect-sphere: #~%" (-> this effect-sphere)) + (label cfg-4) + this + ) + +;; definition of type mh-centipede-minimap-dot +(deftype mh-centipede-minimap-dot (process-drawable) + ((parent (pointer mh-centipede) :override) + (minimap connection-minimap) + ) + (:state-methods + idle + ) + ) + +;; definition for method 3 of type mh-centipede-minimap-dot +(defmethod inspect ((this mh-centipede-minimap-dot)) + (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)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (mh-centipede-minimap-dot) + :virtual #t + :enter (behavior () + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 137) (the-as int #f) (the-as vector #t) 0)) + ) + :exit (behavior () + (kill-callback (-> *minimap* engine) (-> self minimap)) + ) + :trans (behavior () + (vector<-cspace! (-> self root trans) (-> (ppointer->process (-> self parent)) node-list data 5)) + ) + :code sleep-code + ) + +;; definition for function mh-centipede-minimap-dot-init-by-other +(defbehavior mh-centipede-minimap-dot-init-by-other mh-centipede-minimap-dot () + (set! (-> self root) (new 'process 'trsqv)) + (initialize-skeleton + self + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-centipede" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> self mask) (process-mask actor-pause)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (go-virtual idle) + ) + +;; definition for method 20 of type mh-centipede +;; WARN: Return type mismatch int vs search-info-flag. +(defmethod process-mask->search-info-flag ((this mh-centipede)) + (the-as search-info-flag 120) + ) + +;; definition for method 21 of type mh-centipede +;; INFO: Used lq/sq +(defmethod get-trans ((this mh-centipede) (arg0 int)) + "Get the `trans` for this process." + (cond + ((or (= arg0 2) (= arg0 3)) + (let ((gp-0 (new 'static 'vector))) + (cond + ((logtest? (-> this flags) (mh-centipede-flag mc5)) + (set! (-> gp-0 quad) (-> this landing-position quad)) + (+! (-> gp-0 y) 8192.0) + ) + (else + (vector<-cspace! gp-0 (-> this node-list data 5)) + ) + ) + gp-0 + ) + ) + (else + ((method-of-type process-focusable get-trans) this arg0) + ) + ) + ) + +;; definition for method 36 of type mh-centipede +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod mh-centipede-method-36 ((this mh-centipede)) + (set! (-> this effect-sphere) (nest-hunt-find-sphere (-> this root trans))) + (when (!= (-> this prev-time) (current-time)) + (set-time! (-> this prev-time)) + (set! (-> this prev-target-position quad) (-> this current-target-position quad)) + (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + ) + (nest-hunt-play-speech 1 (-> this effect-sphere)) + 0 + (none) + ) + +;; definition for method 37 of type mh-centipede +;; INFO: Used lq/sq +(defmethod probe-ground ((this mh-centipede) (arg0 vector)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf4 :class vf) + (vf5 :class vf) + (vf6 :class vf) + (vf7 :class vf) + ) + (init-vf0-vector) + (let ((s5-0 (new 'stack-no-clear 'collide-query))) + (set-vector! (-> s5-0 move-dist) 0.0 -40960.0 0.0 1.0) + (set! (-> s5-0 start-pos quad) (-> arg0 quad)) + (+! (-> s5-0 start-pos y) 20480.0) + (let ((v1-3 s5-0)) + (set! (-> v1-3 radius) 409.6) + (set! (-> v1-3 collide-with) (collide-spec backgnd)) + (set! (-> v1-3 ignore-process0) #f) + (set! (-> v1-3 ignore-process1) #f) + (set! (-> v1-3 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-3 action-mask) (collide-action solid)) + ) + (let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s5-0))) + (cond + ((>= f0-7 0.0) + (let ((v1-6 (-> s5-0 start-pos))) + (let ((a0-10 (-> s5-0 move-dist))) + (let ((a1-2 f0-7)) + (.mov vf7 a1-2) + ) + (.lvf vf5 (&-> a0-10 quad)) + ) + (.lvf vf4 (&-> v1-6 quad)) + ) + (.add.x.vf vf6 vf0 vf0 :mask #b1000) + (.mul.x.vf acc vf5 vf7 :mask #b111) + (.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111) + (.svf (&-> arg0 quad) vf6) + #t + ) + (else + #f + ) + ) + ) + ) + ) + ) + +;; definition for method 38 of type mh-centipede +;; INFO: Used lq/sq +(defmethod mh-centipede-method-38 ((this mh-centipede) (arg0 symbol)) + (local-vars (sv-288 nav-control) (sv-304 vector) (sv-320 vector) (sv-336 nav-control)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + (vf3 :class vf) + (vf4 :class vf) + ) + (init-vf0-vector) + (if (and (not arg0) (< (rand-vu) 0.5)) + (set! arg0 #t) + ) + (logclear! (-> this flags) (mh-centipede-flag mc8)) + (when (nonzero? (-> this nav)) + (let ((s4-0 (new 'stack-no-clear 'matrix))) + (if arg0 + (set! (-> this current-anim) (-> this shoot-anims (rand-vu-int-count (-> this shoot-anims length)))) + (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) + ) + (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) + (set! (-> s4-0 rvec quad) (-> (camera-matrix) fvec quad)) + (set! (-> s4-0 rvec y) 0.0) + (vector-normalize! (-> s4-0 rvec) 1.0) + (set! (-> s4-0 uvec quad) (-> (camera-matrix) rvec quad)) + (set! (-> s4-0 uvec y) 0.0) + (vector-normalize! (-> s4-0 uvec) 1.0) + (set! (-> s4-0 fvec quad) (-> s4-0 rvec quad)) + (vector-normalize! (-> s4-0 fvec) 327680.0) + (vector+! (-> s4-0 fvec) (-> s4-0 fvec) (target-pos 0)) + (let ((s3-3 (closest-point-on-mesh (-> this nav) (-> this landing-position) (-> s4-0 fvec) (the-as nav-poly #f))) + (s1-0 (new 'stack-no-clear 'vector)) + (s2-2 (new 'stack-no-clear 'vector)) + ) + (let ((f0-6 10240.0)) + (if (< (* f0-6 f0-6) (vector-vector-xz-distance-squared (-> s4-0 fvec) (-> this landing-position))) + (return #f) + ) + ) + (set! sv-288 (-> this nav)) + (let ((a1-7 s3-3) + (s0-0 s1-0) + ) + (let ((a3-1 s2-2) + (v1-30 (-> this landing-position)) + ) + (project-point-onto-plane-of-poly-local + (-> sv-288 state mesh) + a1-7 + s0-0 + a3-1 + (vector-! (new 'stack-no-clear 'vector) v1-30 (the-as vector (-> sv-288 state mesh bounds))) + ) + ) + (vector+! s0-0 s0-0 (the-as vector (-> sv-288 state mesh bounds))) + ) + 0 + (set! (-> this landing-position y) (-> s1-0 y)) + (when (or (probe-ground this (-> this landing-position)) (not arg0)) + (dotimes (s1-1 10) + (let ((s0-1 (-> s4-0 fvec))) + (set! sv-304 (-> s4-0 rvec)) + (set! sv-320 (-> s4-0 uvec)) + (let* ((f30-2 (- (tan 0.0))) + (v1-39 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-40 (the-as number (logior #x3f800000 v1-39))) + (f0-16 (+ f30-2 (* (+ -1.0 (the-as float v1-40)) (+ (tan 0.0) (tan 0.0))))) + ) + (.lvf vf2 (&-> sv-320 quad)) + (.lvf vf1 (&-> sv-304 quad)) + (let ((v1-44 f0-16)) + (.mov vf3 v1-44) + ) + ) + (.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 (&-> s0-1 quad) vf4) + ) + (vector-normalize! (-> s4-0 fvec) (* 3.0 (-> this current-anim radius))) + (let ((s0-2 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (set! (-> s4-0 fvec y) 0.0) + (set! (-> s0-2 poly) s3-3) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this landing-position) (-> s0-2 poly) (-> s4-0 fvec) s0-2) + (when (not (-> s0-2 found-boundary)) + (vector+! (-> s4-0 fvec) (-> this landing-position) (-> s4-0 fvec)) + (set! sv-336 (-> this nav)) + (let ((a1-13 (-> s0-2 poly)) + (s0-3 (-> this launch-position)) + ) + (let ((a3-3 s2-2) + (v1-52 (-> s4-0 fvec)) + ) + (project-point-onto-plane-of-poly-local + (-> sv-336 state mesh) + a1-13 + s0-3 + a3-3 + (vector-! (new 'stack-no-clear 'vector) v1-52 (the-as vector (-> sv-336 state mesh bounds))) + ) + ) + (vector+! s0-3 s0-3 (the-as vector (-> sv-336 state mesh bounds))) + ) + 0 + (when (probe-ground this (-> this launch-position)) + (when arg0 + (logior! (-> this flags) (mh-centipede-flag mc8)) + (set! (-> this landing-position quad) (-> this launch-position quad)) + ) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + +;; definition for method 39 of type mh-centipede +;; INFO: Used lq/sq +(defmethod mh-centipede-method-39 ((this mh-centipede)) + (local-vars (sv-288 vector)) + (logclear! (-> this flags) (mh-centipede-flag mc8)) + (when (nonzero? (-> this nav)) + (let ((s5-0 (new 'stack-no-clear 'matrix))) + (set! (-> this current-anim) (-> this breach-anims (rand-vu-int-count (-> this breach-anims length)))) + (set! (-> this pre-breach-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) + (set! (-> s5-0 rvec quad) (-> (camera-matrix) fvec quad)) + (set! (-> s5-0 rvec y) 0.0) + (vector-normalize! (-> s5-0 rvec) 1.0) + (set! (-> s5-0 uvec quad) (-> (camera-matrix) rvec quad)) + (set! (-> s5-0 uvec y) 0.0) + (vector-normalize! (-> s5-0 uvec) 1.0) + (let* ((s4-2 (-> s5-0 fvec)) + (s3-0 (-> s5-0 rvec)) + (s2-0 (-> s5-0 uvec)) + (f30-1 (- (tan 0.0))) + (v1-15 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-16 (the-as number (logior #x3f800000 v1-15))) + ) + (vector+float*! s4-2 s3-0 s2-0 (+ f30-1 (* (+ -1.0 (the-as float v1-16)) (+ (tan 0.0) (tan 0.0))))) + ) + (vector-normalize! (-> s5-0 fvec) 409600.0) + (vector+! (-> s5-0 fvec) (-> s5-0 fvec) (camera-pos)) + (let ((s4-5 (closest-point-on-mesh (-> this nav) (-> this landing-position) (-> s5-0 fvec) (the-as nav-poly #f))) + (s2-1 (new 'stack-no-clear 'vector)) + (s3-3 (new 'stack-no-clear 'vector)) + ) + (let ((f0-12 (vector-vector-xz-distance-squared (camera-pos) (-> this landing-position))) + (f1-1 245760.0) + ) + (if (or (< f0-12 (* f1-1 f1-1)) + (let ((f0-13 (vector-vector-xz-distance-squared (target-pos 0) (-> this landing-position))) + (f1-4 245760.0) + ) + (< f0-13 (* f1-4 f1-4)) + ) + ) + (return #f) + ) + ) + (let ((s0-0 (-> this nav)) + (a1-7 s4-5) + (s1-2 s2-1) + ) + (let ((a3-1 s3-3) + (v1-27 (-> this landing-position)) + ) + (project-point-onto-plane-of-poly-local + (-> s0-0 state mesh) + a1-7 + s1-2 + a3-1 + (vector-! (new 'stack-no-clear 'vector) v1-27 (the-as vector (-> s0-0 state mesh bounds))) + ) + ) + (vector+! s1-2 s1-2 (the-as vector (-> s0-0 state mesh bounds))) + ) + 0 + (set! (-> this landing-position y) (-> s2-1 y)) + (when (probe-ground this (-> this landing-position)) + (dotimes (s2-2 10) + (let* ((s1-3 (-> s5-0 fvec)) + (s0-1 (-> s5-0 uvec)) + (f30-2 -1.0) + (f28-1 2.0) + (v1-35 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-36 (the-as number (logior #x3f800000 v1-35))) + ) + (vector-float*! s1-3 s0-1 (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-36))))) + ) + (let ((s1-5 (-> s5-0 fvec)) + (s0-2 (-> s5-0 fvec)) + ) + (set! sv-288 (-> s5-0 rvec)) + (let* ((f30-3 -1.0) + (f28-2 2.0) + (v1-41 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-42 (the-as number (logior #x3f800000 v1-41))) + (f0-24 (+ f30-3 (* f28-2 (+ -1.0 (the-as float v1-42))))) + ) + (vector+float*! s1-5 s0-2 sv-288 f0-24) + ) + ) + (vector-normalize! (-> s5-0 fvec) (* 3.0 (-> this current-anim radius))) + (let ((s1-7 (new 'stack-no-clear 'clamp-travel-vector-to-mesh-return-info))) + (set! (-> s1-7 poly) s4-5) + (clamp-vector-to-mesh-no-gaps (-> this nav) (-> this landing-position) (-> s1-7 poly) (-> s5-0 fvec) s1-7) + (when (not (-> s1-7 found-boundary)) + (vector+! (-> s5-0 fvec) (-> this landing-position) (-> s5-0 fvec)) + (let ((s0-3 (-> this nav)) + (a1-13 (-> s1-7 poly)) + (s1-8 (-> this launch-position)) + ) + (let ((a3-3 s3-3) + (v1-51 (-> s5-0 fvec)) + ) + (project-point-onto-plane-of-poly-local + (-> s0-3 state mesh) + a1-13 + s1-8 + a3-3 + (vector-! (new 'stack-no-clear 'vector) v1-51 (the-as vector (-> s0-3 state mesh bounds))) + ) + ) + (vector+! s1-8 s1-8 (the-as vector (-> s0-3 state mesh bounds))) + ) + 0 + (if (probe-ground this (-> this launch-position)) + (return #t) + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + +;; definition for method 40 of type mh-centipede +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod death-explosion ((this mh-centipede) (arg0 int)) + (local-vars + (sv-848 process) + (sv-864 + (function skeleton-group int joint-exploder-tuning joint-exploder-static-params object :behavior joint-exploder) + ) + ) + (let ((s4-0 (get-field-spec-by-id (-> *part-id-table* 2512) (sp-field-id spt-omega))) + (s5-0 (new 'stack-no-clear 'matrix)) + ) + (let* ((v1-2 s5-0) + (a3-0 (-> this node-list data arg0 bone transform)) + (a0-5 (-> a3-0 rvec quad)) + (a1-3 (-> a3-0 uvec quad)) + (a2-0 (-> a3-0 fvec quad)) + (a3-1 (-> a3-0 trans quad)) + ) + (set! (-> v1-2 rvec quad) a0-5) + (set! (-> v1-2 uvec quad) a1-3) + (set! (-> v1-2 fvec quad) a2-0) + (set! (-> v1-2 trans quad) a3-1) + ) + (vector<-cspace! (-> s5-0 trans) (-> this node-list data arg0)) + (cond + (s4-0 + (let ((s3-1 (new 'stack-no-clear 'collide-query))) + (set! (-> s3-1 start-pos quad) (-> s5-0 trans quad)) + (vector-float*! (-> s3-1 move-dist) (-> this root dynam gravity-normal) -163840.0) + (let ((v1-8 s3-1)) + (set! (-> v1-8 radius) 1228.8) + (set! (-> v1-8 collide-with) (collide-spec backgnd obstacle hit-by-player-list hit-by-others-list)) + (set! (-> v1-8 ignore-process0) this) + (set! (-> v1-8 ignore-process1) #f) + (set! (-> v1-8 ignore-pat) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1 :board #x1) + ) + (set! (-> v1-8 action-mask) (collide-action solid)) + ) + (let ((f30-0 (fill-and-probe-using-line-sphere *collide-cache* s3-1))) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s5-0 trans) + (meters 0.2) + (new 'static 'rgba :r #x40 :g #xff :b #xff :a #x80) + ) + (cond + ((>= f30-0 0.0) + (add-debug-sphere + #t + (bucket-id debug-no-zbuf1) + (-> s3-1 best-other-tri intersect) + (meters 0.3) + (new 'static 'rgba :r #x40 :g #xff :b #xff :a #x80) + ) + (set! (-> s4-0 initial-valuef) + (fmin (+ 819.2 (-> s3-1 best-other-tri intersect y)) (+ -1228.8 (-> s5-0 trans y))) + ) + ) + (else + (set! (-> s4-0 initial-valuef) (+ -81920.0 (-> s5-0 trans y))) + ) + ) + ) + ) + ) + (else + (format 0 "no spec for mh-centipede death particle~%") + ) + ) + (let ((v1-22 + (if (logtest? (-> *part-group-id-table* 647 flags) (sp-group-flag sp13)) + (part-tracker-spawn part-tracker-subsampler :to this :group (-> *part-group-id-table* 647) :mat-joint s5-0) + (part-tracker-spawn part-tracker :to this :group (-> *part-group-id-table* 647) :mat-joint s5-0) + ) + ) + ) + (send-event (ppointer->process v1-22) 'clock this) + ) + (let ((s2-0 (new 'stack 'joint-exploder-tuning (the-as uint 0))) + (s1-0 (quaternion-copy! (new 'stack-no-clear 'quaternion) (-> this root quat))) + (s4-3 (new 'stack-no-clear 'vector)) + ) + (set! (-> s4-3 quad) (-> this root trans quad)) + (let ((s3-2 (new 'stack-no-clear 'vector))) + (set! (-> s3-2 quad) (-> this root scale quad)) + (set! (-> this root trans quad) (-> s5-0 trans quad)) + (set-vector! (-> this root scale) 2.0 2.0 2.0 1.0) + (let ((s5-1 (get-process *default-dead-pool* joint-exploder #x4000 0))) + (when s5-1 + (let ((t9-16 (method-of-type joint-exploder activate))) + (t9-16 (the-as joint-exploder s5-1) this "joint-exploder" (the-as pointer #x70004000)) + ) + (let ((s0-0 run-function-in-process)) + (set! sv-848 s5-1) + (set! sv-864 joint-exploder-init-by-other) + (let ((a2-16 (art-group-get-by-name *level* "skel-mh-centipede-explode" (the-as (pointer level) #f))) + (a3-10 10) + (t1-0 *mh-centipede-exploder-params*) + ) + ((the-as (function object object object object object object none) s0-0) sv-848 sv-864 a2-16 a3-10 s2-0 t1-0) + ) + ) + (-> s5-1 ppointer) + ) + ) + (quaternion-copy! (-> this root quat) s1-0) + (set! (-> this root trans quad) (-> s4-3 quad)) + (set! (-> this root scale quad) (-> s3-2 quad)) + ) + ) + ) + 0 + (none) + ) + +;; definition for function mh-centipede-active-handler +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs object. +(defbehavior mh-centipede-active-handler mh-centipede ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (local-vars (v1-13 float)) + (rlet ((acc :class vf) + (vf0 :class vf) + (vf1 :class vf) + (vf2 :class vf) + ) + (init-vf0-vector) + (case arg2 + (('touched) + (let ((s4-0 (the-as touching-shapes-entry (-> arg3 param 0)))) + (cond + ((not s4-0) + ) + ((type? arg0 vehicle) + (when (not (logtest? (-> self flags) (mh-centipede-flag mc6))) + (let ((s2-0 (-> s4-0 head))) + (when s2-0 + (let ((s3-0 (get-touched-prim s2-0 (-> self root) s4-0)) + (s5-1 (new 'stack-no-clear 'vector)) + ) + (when s3-0 + (get-intersect-point s5-1 s2-0 (-> self root) s4-0) + (vector-! s5-1 s5-1 (the-as vector (-> s3-0 prim-core))) + (set! (-> s5-1 y) 0.0) + (.lvf vf1 (&-> s5-1 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-13 vf1) + (let ((f0-1 v1-13) + (f1-0 1.0) + ) + (if (< f0-1 (* f1-0 f1-0)) + (set! (-> s5-1 x) 1.0) + ) + ) + (vector-normalize! s5-1 1.0) + (set! (-> s5-1 y) 0.1) + (when (send-event arg0 'attack #f (static-attack-info + :mask (vehicle-impulse-factor) + ((id (new-attack-id)) + (damage 4.0) + (vehicle-damage-factor 0.8325) + (vehicle-impulse-factor (* 1.25 (-> (the-as vehicle arg0) info info mass))) + (shield-damage 1.0) + (knock (knocked-type dark-shot)) + (attacker-velocity s5-1) + ) + ) + ) + ) + (logior! (-> self flags) (mh-centipede-flag mc6)) + (nest-hunt-play-speech 5 (-> self effect-sphere)) + ) + ) + ) + ) + ) + ) + ((prims-touching? s4-0 (-> self root) (the-as uint -1)) + (if (send-event + (if (type? arg0 process-focusable) + arg0 + ) + 'attack + (-> arg3 param 0) + (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) + (damage 4.0) + (vehicle-damage-factor 1.0) + (vehicle-impulse-factor 1.0) + (knock (knocked-type dark-shot)) + ) + ) + ) + (nest-hunt-play-speech 5 (-> self effect-sphere)) + ) + ) + ) + ) + #t + ) + (('attack) + (if (type? arg0 vehicle) + (return (the-as object #f)) + ) + (if (or (< (ja-aframe-num 0) (-> self current-anim vulnerable-start)) + (< (-> self current-anim vulnerable-end) (ja-aframe-num 0)) + ) + (return (the-as object #f)) + ) + (let ((f0-14 1.0) + (v1-50 (the-as attack-info (-> arg3 param 1))) + ) + (when (or (not (logtest? (-> v1-50 mask) (attack-mask id))) (!= (-> self incoming-attack-id) (-> v1-50 id))) + (if (logtest? (-> v1-50 mask) (attack-mask id)) + (set! (-> self incoming-attack-id) (-> v1-50 id)) + ) + (if (logtest? (attack-mask damage) (-> v1-50 mask)) + (set! f0-14 (-> v1-50 damage)) + ) + (if (and (-> self next-state) (= (-> self next-state name) 'shooting)) + (set! f0-14 (* 0.5 f0-14)) + ) + (if (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) + (set! f0-14 (* 0.6666667 f0-14)) + ) + (set! (-> self hit-points) (fmax 0.0 (- (-> self hit-points) f0-14))) + (set! (-> *game-info* health-bar) (-> self hit-points)) + (cond + ((= (-> self hit-points) 0.0) + (go-virtual die) + ) + ((= f0-14 0.0) + ) + ((< (-> self hit-points) 20.0) + (nest-hunt-play-speech 3 (-> self effect-sphere)) + ) + (else + (nest-hunt-play-speech 2 (-> self effect-sphere)) + ) + ) + ) + ) + #t + ) + ) + ) + ) + +;; definition for method 41 of type mh-centipede +(defmethod mh-centipede-method-41 ((this mh-centipede)) + (and (task-node-closed? (game-task-node nest-hunt-introduction)) + (> (-> this appearance-order) 0) + (= (-> this appearance-order) (the int (-> *game-info* counter))) + ) + ) + +;; definition for method 42 of type mh-centipede +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod fire-shot ((this mh-centipede)) + (local-vars (sv-192 sound-id)) + (with-pp + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((s3-0 (new 'stack-no-clear 'vector)) + (s4-0 (new 'stack-no-clear 'vector)) + ) + (let ((s2-0 (new 'stack-no-clear 'vector))) + (set! (-> s2-0 quad) (-> (target-pos 0) quad)) + (vector<-cspace! s3-0 (-> this node-list data 77)) + (let ((s1-0 sound-play-by-name) + (sname (static-sound-name "cent-fire-spit")) + ) + (set! sv-192 (new-sound-id)) + (let ((a2-0 (the int (* 1024.0 (nest-hunt-volume (-> this effect-sphere))))) + (a3-0 0) + (t0-0 0) + (t1-0 0) + (t2-0 s3-0) + ) + (s1-0 (the-as sound-name sname) sv-192 a2-0 a3-0 t0-0 (the-as sound-group t1-0) t2-0) + ) + ) + (vector-! s4-0 (-> this current-target-position) (-> this prev-target-position)) + (set! (-> s4-0 y) 0.0) + (let* ((f30-1 (vector-length s4-0)) + (s1-1 s4-0) + (s0-1 s4-0) + (f28-0 (lerp-scale 20480.0 81920.0 f30-1 0.0 4505.6)) + (f26-0 20480.0) + (v1-9 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-10 (the-as number (logior #x3f800000 v1-9))) + ) + (vector-float*! s1-1 s0-1 (/ (+ f28-0 (* f26-0 (+ -1.0 (the-as float v1-10)))) f30-1)) + ) + (vector+! s2-0 s2-0 s4-0) + (let* ((f30-2 (-> s2-0 y)) + (f28-1 -16384.0) + (v1-14 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-15 (the-as number (logior #x3f800000 v1-14))) + ) + (set! (-> s2-0 y) (+ f30-2 (* f28-1 (+ -1.0 (the-as float v1-15))))) + ) + (vector-! s4-0 s2-0 s3-0) + ) + (vector-normalize! s4-0 (* 36864.0 (-> pp clock frames-per-second))) + (set! (-> gp-0 ent) (-> this entity)) + (set! (-> gp-0 charge) 1.0) + (set! (-> gp-0 options) (projectile-options)) + (logclear! (-> gp-0 options) (projectile-options po14 po15 po16)) + (set! (-> gp-0 pos quad) (-> s3-0 quad)) + (set! (-> gp-0 vel quad) (-> s4-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 handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle this)) + (let* ((v1-30 *game-info*) + (a0-27 (+ (-> v1-30 attack-id) 1)) + ) + (set! (-> v1-30 attack-id) a0-27) + (set! (-> gp-0 attack-id) a0-27) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (set! (-> gp-0 damage) 3.33) + (logior! (-> gp-0 options) (projectile-options po14)) + (set! (-> gp-0 vehicle-impulse-factor) (* 0.3003003 (-> pp clock frames-per-second))) + (logior! (-> gp-0 options) (projectile-options po16)) + (spawn-projectile mh-centipede-shot gp-0 (ppointer->process (-> this parent)) *default-dead-pool*) + ) + 0 + (none) + ) + ) + +;; failed to figure out what this is: +(defstate hidden (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (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 + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (when (and (time-elapsed? (-> self state-time) (seconds 0.1)) (mh-centipede-method-41 self)) + (set! (-> *game-info* health-bar-owner) (process->handle self)) + (set! (-> *game-info* health-bar) (-> self hit-points)) + (go-virtual wait-off-minimap) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate wait-on-minimap (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set-time! (-> self timeout)) + (set! (-> self wait-time) (the-as time-frame (the int (* 900.0 (you-suck-scale *game-info* #f 0))))) + (vector<-cspace! (-> self root trans) (joint-node mh-centipede-lod0-jg head)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-14 (-> self root root-prim))) + (set! (-> v1-14 prim-core collide-as) (collide-spec)) + (set! (-> v1-14 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self minimap) (add-icon! *minimap* self (the-as uint 138) (the-as int #f) (the-as vector #t) 0)) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + (kill-callback (-> *minimap* engine) (-> self minimap)) + (set! (-> self minimap) #f) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (when (time-elapsed? (-> self state-time) (-> self wait-time)) + (if (or (mh-centipede-method-38 self #f) (mh-centipede-method-38 self #t)) + (go-virtual wait-off-minimap) + (set! (-> self state-time) (-> self state-time)) + ) + ) + (when (time-elapsed? (-> self timeout) (seconds 15)) + (if (mh-centipede-method-39 self) + (go-virtual wait-off-minimap) + (set! (-> self timeout) (-> self timeout)) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate wait-off-minimap (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self wait-time) (the-as time-frame (the int (* 300.0 (you-suck-scale *game-info* #f 0))))) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-10 (-> self root root-prim))) + (set! (-> v1-10 prim-core collide-as) (collide-spec)) + (set! (-> v1-10 prim-core collide-with) (collide-spec)) + ) + 0 + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (when (time-elapsed? (-> self state-time) (-> self wait-time)) + (if (or (mh-centipede-method-38 self #f) (mh-centipede-method-38 self #t) (mh-centipede-method-39 self)) + (go-virtual pre-breach) + (set! (-> self state-time) (-> self state-time)) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate pre-breach (mh-centipede) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (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 + (let* ((gp-0 lerp-scale) + (s5-0 819.2) + (s4-0 0.0) + (a2-0 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-0 204800.0) + (a3-0 (* f0-0 f0-0)) + (f0-2 2048000.0) + (f0-5 (* (gp-0 s5-0 s4-0 a2-0 a3-0 (* f0-2 f0-2)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (activate! *camera-smush-control* f0-5 37 600 1.0 1.1 (-> *display* camera-clock)) + ) + (init! (-> self out-of-ground-crater) (-> self launch-position) 32768.0) + (init! (-> self into-ground-crater) (-> self landing-position) 32768.0) + ) + :exit (behavior () + (logclear! (-> self draw status) (draw-control-status no-draw-bounds)) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) + (set! (-> v1-3 prim-core collide-with) (-> self root backup-collide-with)) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (cond + ((not (time-elapsed? (-> self state-time) (-> self pre-breach-time))) + ) + ((logtest? (-> self flags) (mh-centipede-flag mc8)) + (go-virtual shooting) + ) + (else + (go-virtual breach) + ) + ) + (let ((f30-0 (/ (the float (- (current-time) (-> self state-time))) (the float (-> self pre-breach-time))))) + (sound-play-by-name + (static-sound-name "cent-rumble") + (-> self rumble-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (set! (-> self rumble-sound-playing) #t) + (let ((f30-1 (* f30-0 f30-0))) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int (* 1024.0 (* f30-1 (nest-hunt-volume (-> self effect-sphere))))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + ) + ) + (set! (-> self ground-sound-playing) #t) + (if (nonzero? (-> self before-breach-part)) + (spawn (-> self before-breach-part) (-> self launch-position)) + ) + (dotimes (gp-2 2) + (mh-centipede-crater-pt-array-method-10 (-> self out-of-ground-crater)) + (mh-centipede-crater-pt-array-method-10 (-> self into-ground-crater)) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate breach (mh-centipede) + :virtual #t + :event mh-centipede-active-handler + :enter (behavior () + (nest-hunt-play-speech 0 (-> self effect-sphere)) + (set-time! (-> self state-time)) + (set! (-> self root trans quad) (-> self launch-position quad)) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self landing-position) (-> self launch-position)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + ) + (quaternion-normalize! (-> self root quat)) + (let* ((gp-2 lerp-scale) + (s5-0 1638.4) + (s4-0 0.0) + (a2-1 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-4 204800.0) + (a3-1 (* f0-4 f0-4)) + (f0-6 2048000.0) + (f30-1 (* (gp-2 s5-0 s4-0 a2-1 a3-1 (* f0-6 f0-6)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-1 75 900 1.1 1.07 (-> *display* camera-clock)) + ) + (logclear! (-> self flags) (mh-centipede-flag mc0 mc1 mc2 mc3 mc4 mc5 mc6)) + (ja-channel-push! 1 0) + (ja :group! (-> self draw art-group data (-> self current-anim anim)) :num! min) + (set! (-> self mm-handle) + (ppointer->handle (process-spawn mh-centipede-minimap-dot :name "mh-centipede-minimap-dot" :to self)) + ) + ) + :exit (behavior () + (let ((a0-1 (handle->process (-> self mm-handle)))) + (when a0-1 + (deactivate a0-1) + (set! (-> self mm-handle) (the-as handle #f)) + ) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (ja :num! (seek! max (-> self current-anim speed))) + (if (ja-done? 0) + (go-virtual wait-on-minimap) + ) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc0))) + (when (nonzero? (-> self breach-part)) + (let ((f30-0 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) + (lerp-scale f30-0 (* 0.1 f30-0) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + ) + (spawn (-> self breach-part) (-> self launch-position)) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-0) + ) + ) + (mh-centipede-crater-pt-array-method-11 (-> self out-of-ground-crater) self) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg tail3)) y) + (-> self launch-position y) + ) + (logior! (-> self flags) (mh-centipede-flag mc0)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc1))) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg tail3)) y) + (+ 8192.0 (-> self landing-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc1)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc2))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg tail3)) y) + (-> self landing-position y) + ) + (set-time! (-> self tail-smack-time)) + (logior! (-> self flags) (mh-centipede-flag mc2)) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + ) + ) + (else + ) + ) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc3))) + (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (when (>= (-> gp-0 y) (+ -12288.0 (-> self launch-position y))) + (logior! (-> self flags) (mh-centipede-flag mc3)) + (sound-play-by-name + (static-sound-name "cent-out") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-0 + ) + (set! (-> self legs-sound-playing) #t) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc4))) + (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-1 + ) + (set! (-> self legs-sound-playing) #t) + (if (< (+ 14336.0 (-> self launch-position y)) (-> gp-1 y)) + (logior! (-> self flags) (mh-centipede-flag mc4)) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc5))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 12288.0 (-> self launch-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc5)) + (set-time! (-> self nose-smack-time)) + (sound-play-by-name + (static-sound-name "cent-in") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (sound-play-by-name + (static-sound-name "cent-rumble") + (-> self rumble-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self rumble-sound-playing) #t) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + (let* ((gp-5 lerp-scale) + (s5-6 1638.4) + (s4-6 0.0) + (a2-9 (vector-vector-distance-squared (-> self landing-position) (target-pos 0))) + (f0-33 204800.0) + (a3-7 (* f0-33 f0-33)) + (f0-35 2048000.0) + (f30-8 (* (gp-5 s5-6 s4-6 a2-9 a3-7 (* f0-35 f0-35)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-8 60 600 0.995 1.07 (-> *display* camera-clock)) + ) + ) + ) + (else + (when (-> self legs-sound-playing) + (sound-stop (-> self legs-sound)) + (set! (-> self legs-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int + (* 1024.0 (* (nest-hunt-volume (-> self effect-sphere)) + (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self nose-smack-time))) 0.0 600.0) + ) + ) + ) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + ) + (mh-centipede-crater-pt-array-method-11 (-> self into-ground-crater) self) + (when (and (nonzero? (-> self impact-part)) (not (logtest? (-> self flags) (mh-centipede-flag mc2)))) + (let ((f30-10 (-> *part-id-table* 2507 init-specs 2 initial-valuef)) + (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) + ) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) + (lerp-scale f30-10 (* 0.05 f30-10) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + ) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) + (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) + ) + (spawn (-> self impact-part) (-> self landing-position)) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) f30-10) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) f28-1) + ) + ) + (if (and (nonzero? (-> self impact-dust-part)) + (logtest? (-> self flags) (mh-centipede-flag mc2)) + (not (time-elapsed? (-> self tail-smack-time) (seconds 0.2))) + ) + (spawn (-> self impact-dust-part) (-> self landing-position)) + ) + ) + ) + (when (nonzero? (-> self dirt-fall-part)) + (let ((gp-7 (new 'static 'boxed-array :type uint8 + #xb + #xe + #x1c + #x24 + #x2c + #x34 + #x3c + #x44 + #x11 + #x14 + #x1f + #x27 + #x2f + #x37 + #x3f + #x47 + ) + ) + (s5-8 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-8 3) + (vector<-cspace! + s5-8 + (-> self node-list data (-> gp-7 (mod (the-as int (rand-uint31-gen *random-generator*)) (-> gp-7 length)))) + ) + (spawn (-> self dirt-fall-part) s5-8) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate shooting (mh-centipede) + :virtual #t + :event mh-centipede-active-handler + :enter (behavior () + (nest-hunt-play-speech 0 (-> self effect-sphere)) + (set-time! (-> self state-time)) + (set! (-> self root trans quad) (-> self launch-position quad)) + (let* ((gp-0 lerp-scale) + (s5-0 1638.4) + (s4-0 0.0) + (a2-0 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-0 204800.0) + (a3-0 (* f0-0 f0-0)) + (f0-2 2048000.0) + (f30-1 (* (gp-0 s5-0 s4-0 a2-0 a3-0 (* f0-2 f0-2)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-1 75 900 1.1 1.07 (-> *display* camera-clock)) + ) + (logclear! (-> self flags) (mh-centipede-flag mc0 mc1 mc2 mc3 mc4 mc5 mc6)) + (ja-channel-push! 1 0) + (ja :group! (-> self draw art-group data (-> self current-anim anim)) :num! min) + (set! (-> self prev-anim-frame) (ja-aframe-num 0)) + (set! (-> self mm-handle) + (ppointer->handle (process-spawn mh-centipede-minimap-dot :name "mh-centipede-minimap-dot" :to self)) + ) + ) + :exit (behavior () + (let ((a0-1 (handle->process (-> self mm-handle)))) + (when a0-1 + (deactivate a0-1) + (set! (-> self mm-handle) (the-as handle #f)) + ) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (ja :num! (seek! max (-> self current-anim speed))) + (let ((f30-0 (ja-aframe-num 0))) + (if (or (and (< (-> self prev-anim-frame) 25.0) (>= f30-0 25.0)) + (and (< (-> self prev-anim-frame) 35.0) (>= f30-0 35.0)) + (and (< (-> self prev-anim-frame) 40.0) (>= f30-0 40.0)) + ) + (fire-shot self) + ) + (set! (-> self prev-anim-frame) f30-0) + ) + (if (ja-done? 0) + (go-virtual wait-on-minimap) + ) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (target-pos 0) (-> self launch-position)))) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (quaternion-set! (-> self root quat) 0.0 (-> gp-1 x) 0.0 (+ 1.0 (-> gp-1 z))) + ) + (quaternion-normalize! (-> self root quat)) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc0))) + (when (nonzero? (-> self breach-part)) + (let ((f30-1 (-> *part-id-table* 2499 init-specs 2 initial-valuef))) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) + (lerp-scale f30-1 (* 0.1 f30-1) (the float (- (current-time) (-> self state-time))) 0.0 150.0) + ) + (spawn (-> self breach-part) (-> self launch-position)) + (set! (-> *part-id-table* 2499 init-specs 2 initial-valuef) f30-1) + ) + ) + (mh-centipede-crater-pt-array-method-11 (-> self out-of-ground-crater) self) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 16384.0 (-> self launch-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc0)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc1))) + (if (>= (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 8192.0 (-> self landing-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc1)) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc2))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (-> self landing-position y) + ) + (set-time! (-> self tail-smack-time)) + (logior! (-> self flags) (mh-centipede-flag mc2)) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + ) + ) + ) + (cond + ((not (logtest? (-> self flags) (mh-centipede-flag mc3))) + (let ((gp-2 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (when (>= (-> gp-2 y) (+ -12288.0 (-> self launch-position y))) + (logior! (-> self flags) (mh-centipede-flag mc3)) + (sound-play-by-name + (static-sound-name "cent-out") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (when (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + (set! (-> self rumble-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + (set! (-> self ground-sound-playing) #f) + ) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-2 + ) + (set! (-> self legs-sound-playing) #t) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc4))) + (let ((gp-3 (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)))) + (sound-play-by-name + (static-sound-name "cent-legs") + (-> self legs-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + gp-3 + ) + (set! (-> self legs-sound-playing) #t) + (if (< (+ 14336.0 (-> self launch-position y)) (-> gp-3 y)) + (logior! (-> self flags) (mh-centipede-flag mc4)) + ) + ) + ) + ((not (logtest? (-> self flags) (mh-centipede-flag mc5))) + (when (< (-> (vector<-cspace! (new 'stack-no-clear 'vector) (joint-node mh-centipede-lod0-jg mouth)) y) + (+ 12288.0 (-> self launch-position y)) + ) + (logior! (-> self flags) (mh-centipede-flag mc5)) + (set-time! (-> self nose-smack-time)) + (sound-play-by-name + (static-sound-name "cent-in") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (sound-play-by-name + (static-sound-name "cent-rumble") + (-> self rumble-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self rumble-sound-playing) #t) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + (let* ((gp-7 lerp-scale) + (s5-6 1638.4) + (s4-6 0.0) + (a2-10 (vector-vector-distance-squared (-> self landing-position) (target-pos 0))) + (f0-43 204800.0) + (a3-8 (* f0-43 f0-43)) + (f0-45 2048000.0) + (f30-9 (* (gp-7 s5-6 s4-6 a2-10 a3-8 (* f0-45 f0-45)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-9 60 600 0.995 1.07 (-> *display* camera-clock)) + ) + ) + ) + (else + (when (-> self legs-sound-playing) + (sound-stop (-> self legs-sound)) + (set! (-> self legs-sound-playing) #f) + ) + (when (-> self ground-sound-playing) + (sound-play-by-name + (static-sound-name "cent-ground") + (-> self ground-sound) + (the int + (* 1024.0 (* (nest-hunt-volume (-> self effect-sphere)) + (lerp-scale 1.0 0.0 (the float (- (current-time) (-> self nose-smack-time))) 0.0 600.0) + ) + ) + ) + 0 + 0 + (sound-group) + (-> self landing-position) + ) + (set! (-> self ground-sound-playing) #t) + ) + (mh-centipede-crater-pt-array-method-11 (-> self into-ground-crater) self) + (when (and (nonzero? (-> self impact-part)) (not (logtest? (-> self flags) (mh-centipede-flag mc2)))) + (let ((f30-11 (-> *part-id-table* 2507 init-specs 2 initial-valuef)) + (f28-1 (-> *part-id-table* 2508 init-specs 2 initial-valuef)) + ) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) + (lerp-scale f30-11 (* 0.05 f30-11) (the float (- (current-time) (-> self nose-smack-time))) 0.0 30.0) + ) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) + (lerp-scale f28-1 (* 0.0 f28-1) (the float (- (current-time) (-> self nose-smack-time))) 0.0 150.0) + ) + (spawn (-> self impact-part) (-> self landing-position)) + (set! (-> *part-id-table* 2507 init-specs 2 initial-valuef) f30-11) + (set! (-> *part-id-table* 2508 init-specs 2 initial-valuef) f28-1) + ) + ) + (if (and (nonzero? (-> self impact-dust-part)) + (logtest? (-> self flags) (mh-centipede-flag mc2)) + (not (time-elapsed? (-> self tail-smack-time) (seconds 0.2))) + ) + (spawn (-> self impact-dust-part) (-> self landing-position)) + ) + ) + ) + (when (nonzero? (-> self dirt-fall-part)) + (let ((gp-9 (new 'static 'boxed-array :type uint8 + #xb + #xe + #x1c + #x24 + #x2c + #x34 + #x3c + #x44 + #x11 + #x14 + #x1f + #x27 + #x2f + #x37 + #x3f + #x47 + ) + ) + (s5-8 (new 'stack-no-clear 'vector)) + ) + (dotimes (s4-8 3) + (vector<-cspace! + s5-8 + (-> self node-list data (-> gp-9 (mod (the-as int (rand-uint31-gen *random-generator*)) (-> gp-9 length)))) + ) + (spawn (-> self dirt-fall-part) s5-8) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; failed to figure out what this is: +(defstate die (mh-centipede) + :virtual #t + :enter (behavior () + (let* ((v1-2 (-> *game-info* sub-task-list (game-task-node nest-hunt-fight))) + (a0-2 (handle->process (if (-> v1-2 manager) + (-> v1-2 manager manager) + (the-as handle #f) + ) + ) + ) + ) + (if a0-2 + (send-event a0-2 'centipede-died (-> self launch-position)) + ) + ) + (set-time! (-> self state-time)) + (let* ((gp-0 lerp-scale) + (s5-0 1638.4) + (s4-0 0.0) + (a2-1 (vector-vector-distance-squared (-> self launch-position) (target-pos 0))) + (f0-0 204800.0) + (a3-0 (* f0-0 f0-0)) + (f0-2 2048000.0) + (f30-1 (* (gp-0 s5-0 s4-0 a2-1 a3-0 (* f0-2 f0-2)) (nest-hunt-shake-amp (-> self effect-sphere)))) + ) + (set-zero! *camera-smush-control*) + (activate! *camera-smush-control* f30-1 75 900 1.1 1.07 (-> *display* camera-clock)) + ) + (if (-> self rumble-sound-playing) + (sound-stop (-> self rumble-sound)) + ) + (if (-> self ground-sound-playing) + (sound-stop (-> self ground-sound)) + ) + (if (-> self legs-sound-playing) + (sound-stop (-> self legs-sound)) + ) + (let ((v1-32 (-> self root root-prim))) + (set! (-> v1-32 prim-core collide-as) (collide-spec)) + (set! (-> v1-32 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw-bounds)) + (death-explosion self 5) + (death-explosion self 25) + (death-explosion self 33) + (death-explosion self 41) + (death-explosion self 49) + (death-explosion self 57) + (death-explosion self 65) + (sound-play-by-name + (static-sound-name "cent-out") + (new-sound-id) + (the int (* 1024.0 (nest-hunt-volume (-> self effect-sphere)))) + 0 + 0 + (sound-group) + (-> self launch-position) + ) + (nest-hunt-play-speech 4 (-> self effect-sphere)) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (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) 'get-vehicle) + (let ((a0-3 (the-as vehicle (send-event-function *target* a1-0)))) + (if a0-3 + (vehicle-method-106 a0-3) + ) + ) + ) + (when (and (time-elapsed? (-> self state-time) (seconds 1)) (not (-> self child))) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + (deactivate self) + ) + (when (time-elapsed? (-> self state-time) (seconds 2)) + (process-entity-status! self (entity-perm-status subtask-complete) #t) + (cleanup-for-death self) + ) + (when *camera* + (let ((s5-0 (-> *camera* slave))) + (when s5-0 + (new 'stack-no-clear 'vector) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (vector<-cspace! gp-0 (joint-node mh-centipede-lod0-jg mouth)) + (set! (-> gp-0 y) (fmax (-> gp-0 y) (+ 16384.0 (-> self landing-position y)))) + (vector-! gp-0 gp-0 (-> s5-0 0 trans)) + (vector-normalize! gp-0 1.0) + (forward-down->inv-matrix (the-as matrix (-> s5-0 0 tracking)) gp-0 (new 'static 'vector :y -1.0)) + ) + ) + ) + ) + ) + :code sleep-code + :post (behavior () + (ja-post) + ) + ) + +;; failed to figure out what this is: +(defstate test (mh-centipede) + :virtual #t + :enter (behavior () + (ja :group! mh-centipede-breach-2-ja :num! min) + (set-time! (-> self state-time)) + (set! (-> self root trans y) (-> self entity extra trans y)) + (set! (-> self draw shadow-ctrl) *mh-centipede-shadow-control*) + (logclear! (-> self flags) (mh-centipede-flag mc7)) + (when (!= (-> self entity) (entity-by-name "mh-centipede-7")) + (cleanup-for-death self) + (deactivate self) + ) + ) + :trans (behavior () + (mh-centipede-method-36 self) + (if (and (time-elapsed? (-> self state-time) (seconds 0.017)) (cpad-hold? 1 x)) + (go-virtual test) + ) + (when (not (logtest? (-> self flags) (mh-centipede-flag mc7))) + (when (mh-centipede-method-38 self #f) + (ja :group! mh-centipede-shoot-ja :num! min) + (set! (-> self root trans quad) (-> self launch-position quad)) + (logior! (-> self flags) (mh-centipede-flag mc7)) + ) + ) + (ja :num! (loop! 0.125)) + (format *stdebug* "frame ~f~%" (ja-aframe-num 0)) + ) + :code sleep-code + :post (behavior () + (transform-post) + (do-push-aways (-> self root)) + ) + ) + +;; definition for method 10 of type mh-centipede +(defmethod deactivate ((this mh-centipede)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this before-breach-part)) + (kill-particles (-> this before-breach-part)) + ) + (if (nonzero? (-> this breach-part)) + (kill-particles (-> this breach-part)) + ) + (if (nonzero? (-> this dirt-fall-part)) + (kill-particles (-> this dirt-fall-part)) + ) + (if (nonzero? (-> this impact-part)) + (kill-particles (-> this impact-part)) + ) + (if (nonzero? (-> this impact-dust-part)) + (kill-particles (-> this impact-dust-part)) + ) + (if (-> this rumble-sound-playing) + (sound-stop (-> this rumble-sound)) + ) + (if (-> this ground-sound-playing) + (sound-stop (-> this ground-sound)) + ) + (if (-> this legs-sound-playing) + (sound-stop (-> this legs-sound)) + ) + ((method-of-type process-focusable deactivate) this) + (none) + ) + +;; definition for method 7 of type mh-centipede +;; WARN: Return type mismatch process-focusable vs mh-centipede. +(defmethod relocate ((this mh-centipede) (offset int)) + (if (nonzero? (-> this before-breach-part)) + (&+! (-> this before-breach-part) offset) + ) + (if (nonzero? (-> this breach-part)) + (&+! (-> this breach-part) offset) + ) + (if (nonzero? (-> this dirt-fall-part)) + (&+! (-> this dirt-fall-part) offset) + ) + (if (nonzero? (-> this impact-part)) + (&+! (-> this impact-part) offset) + ) + (if (nonzero? (-> this impact-dust-part)) + (&+! (-> this impact-dust-part) offset) + ) + (the-as mh-centipede ((method-of-type process-focusable relocate) this offset)) + ) + +;; definition for method 11 of type mh-centipede +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs object. +(defmethod init-from-entity! ((this mh-centipede) (arg0 entity-actor)) + (local-vars (sv-16 res-tag)) + (let ((s4-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s4-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s4-0 reaction) cshape-reaction-default) + (set! (-> s4-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s4-0 penetrated-by) + (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s3-0 (new 'process 'collide-shape-prim-group s4-0 (the-as uint 8) 0))) + (set! (-> s4-0 total-prims) (the-as uint 9)) + (set! (-> s3-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s3-0 prim-core collide-with) (collide-spec backgnd jak bot hit-by-others-list player-list)) + (set! (-> s3-0 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> s3-0 transform-index) 34) + (set-vector! (-> s3-0 local-sphere) -3.6864002 0.0 -98.304 118246.195) + (set! (-> s4-0 root-prim) s3-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-14 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-14 transform-index) 5) + (set-vector! (-> v1-14 local-sphere) 46.6944 -7090.1763 -374.784 21871.41) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 1)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-16 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-16 transform-index) 3) + (set-vector! (-> v1-16 local-sphere) 1105.92 -20860.11 45.4656 34929.87) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-18 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-18 transform-index) 26) + (set-vector! (-> v1-18 local-sphere) -1062.912 -10449.715 11.0592 37866.7) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-20 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-20 transform-index) 34) + (set-vector! (-> v1-20 local-sphere) -366.1824 -3607.7568 3.6864002 34341.273) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-22 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-22 transform-index) 42) + (set-vector! (-> v1-22 local-sphere) 889.65125 -8613.888 -138.8544 33735.477) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-24 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-24 transform-index) 50) + (set-vector! (-> v1-24 local-sphere) -471.85922 -7038.5664 -77.4144 30895.719) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-26 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-26 transform-index) 58) + (set-vector! (-> v1-26 local-sphere) -305.9712 -4273.766 4158.2593 24832.82) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s4-0 (the-as uint 2)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core collide-with) (collide-spec jak bot player-list)) + (set! (-> v1-28 prim-core action) (collide-action solid deadly no-standon)) + (set! (-> v1-28 transform-index) 66) + (set-vector! (-> v1-28 local-sphere) -1778.0737 -7170.0483 -785.20325 21710.44) + ) + (set! (-> s4-0 nav-radius) 81920.0) + (let ((v1-30 (-> s4-0 root-prim))) + (set! (-> s4-0 backup-collide-as) (-> v1-30 prim-core collide-as)) + (set! (-> s4-0 backup-collide-with) (-> v1-30 prim-core collide-with)) + ) + (set! (-> s4-0 event-self) 'touched) + (set! (-> this root) s4-0) + ) + (process-drawable-from-entity! this arg0) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-centipede" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (logclear! (-> this mask) (process-mask actor-pause)) + (set-vector! (-> this root scale) 3.0 3.0 3.0 1.0) + (set! (-> this root pause-adjust-distance) 409600.0) + (let ((s4-2 (nav-mesh-from-res-tag (-> this entity) 'nav-mesh-actor 0))) + (when s4-2 + (change-to s4-2 this) + (set! (-> this root trans quad) (-> s4-2 bounds quad)) + (if (nonzero? (-> this nav)) + (closest-point-on-mesh (-> this nav) (-> this root trans) (-> this root trans) (the-as nav-poly #f)) + ) + ) + ) + (set! (-> this flags) (mh-centipede-flag)) + (set! (-> this incoming-attack-id) (the-as uint 0)) + (set! (-> this hit-points) 100.0) + (set! (-> this before-breach-part) (create-launch-control (-> *part-group-id-table* 641) this)) + (set! (-> this breach-part) (create-launch-control (-> *part-group-id-table* 642) this)) + (set! (-> this dirt-fall-part) (create-launch-control (-> *part-group-id-table* 644) this)) + (set! (-> this impact-part) (create-launch-control (-> *part-group-id-table* 645) this)) + (set! (-> this impact-dust-part) (create-launch-control (-> *part-group-id-table* 646) this)) + (set! (-> this breach-anims) + (new 'static 'boxed-array :type mh-centipede-anim + (new 'static 'mh-centipede-anim + :anim 5 + :speed 0.25 + :radius 63078.4 + :vulnerable-start 13.0 + :vulnerable-end 30.0 + ) + (new 'static 'mh-centipede-anim + :anim 6 + :speed 0.15 + :radius 63488.0 + :vulnerable-start 10.0 + :vulnerable-end 30.0 + ) + ) + ) + (set! (-> this shoot-anims) + (new 'static 'boxed-array :type mh-centipede-anim (new 'static 'mh-centipede-anim + :anim 7 + :speed 0.25 + :radius 73728.0 + :vulnerable-start 13.0 + :vulnerable-end 48.0 + ) + ) + ) + (set! (-> this current-anim) (-> this breach-anims 0)) + (set! (-> this appearance-order) 0) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-74 (res-lump-data arg0 'actor-groups (pointer actor-group) :tag-ptr (& sv-16)))) + (cond + ((and v1-74 (nonzero? (-> sv-16 elt-count))) + (let ((v1-75 (-> v1-74 0))) + (set! (-> this appearance-order) (-> v1-75 length)) + (dotimes (a0-78 (-> v1-75 length)) + (when (= arg0 (-> v1-75 data a0-78 actor)) + 0 + (goto cfg-14) + ) + (+! (-> this appearance-order) -1) + ) + ) + (format 0 "ERROR: could not find self in actor-group for ~S~%" (-> this name)) + (label cfg-14) + ) + (else + (format 0 "ERROR: could not find actor-group for ~S~%" (-> this name)) + ) + ) + ) + (set! (-> this rumble-sound) (new-sound-id)) + (set! (-> this rumble-sound-playing) #f) + (set! (-> this ground-sound) (new-sound-id)) + (set! (-> this ground-sound-playing) #f) + (set! (-> this legs-sound) (new-sound-id)) + (set! (-> this legs-sound-playing) #f) + (set! (-> this draw shadow-ctrl) *mh-centipede-shadow-control*) + (set! (-> this minimap) #f) + (set! (-> this mm-handle) (the-as handle #f)) + (set-time! (-> this prev-time)) + (set! (-> this prev-target-position quad) (-> (target-pos 0) quad)) + (set! (-> this current-target-position quad) (-> (target-pos 0) quad)) + (set! (-> this effect-sphere) #f) + (go (method-of-object this hidden)) + 0 + ) + +;; definition for method 15 of type hud-mh-centipede +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this hud-mh-centipede)) + (set-hud-piece-position! + (the-as hud-sprite (-> this sprites)) + (the int (+ 452.0 (* 130.0 (-> this offset)))) + 130 + ) + (set-as-offset-from! (-> this sprites 4) (the-as vector4w (-> this sprites)) 0 37) + (set! (-> this sprites 4 scale-x) (* 0.164 (the float (-> this values 1 current)))) + (cond + ((< 75 (-> this values 1 current)) + (set! (-> this sprites 4 color x) 0) + (set! (-> this sprites 4 color y) 255) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ((< 50 (-> this values 1 current)) + (set! (-> this sprites 4 color x) + (the int (lerp-scale 0.0 128.0 (the float (-> this values 1 current)) 75.0 50.0)) + ) + (set! (-> this sprites 4 color y) + (the int (lerp-scale 255.0 128.0 (the float (-> this values 1 current)) 75.0 50.0)) + ) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ((< 25 (-> this values 1 current)) + (set! (-> this sprites 4 color x) + (the int (lerp-scale 128.0 255.0 (the float (-> this values 1 current)) 50.0 25.0)) + ) + (set! (-> this sprites 4 color y) + (the int (lerp-scale 128.0 0.0 (the float (-> this values 1 current)) 50.0 25.0)) + ) + (set! (-> this sprites 4 color z) 0) + 0 + ) + (else + (set! (-> this sprites 4 color x) 255) + (set! (-> this sprites 4 color y) 0) + (set! (-> this sprites 4 color z) 0) + 0 + ) + ) + (set-as-offset-from! (-> this sprites 3) (the-as vector4w (-> this sprites)) 1 36) + (set-as-offset-from! (-> this sprites 2) (the-as vector4w (-> this sprites)) -59 36) + (set-as-offset-from! (-> this sprites 1) (the-as vector4w (-> this sprites)) -4 36) + (format (clear (-> this strings 0 text)) "~D" (-> this values 0 current)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) 5 15) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type hud-mh-centipede +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this hud-mh-centipede)) + (set! (-> this values 0 target) (the int (-> *game-info* counter))) + (cond + ((handle->process (-> *game-info* health-bar-owner)) + (set! (-> this values 1 target) (the int (-> *game-info* health-bar))) + ) + (else + (set! (-> this values 1 target) 0) + 0 + ) + ) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type hud-mh-centipede +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this hud-mh-centipede)) + (set! (-> this level) (level-get *level* 'nsta)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-middle-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-mhcentipede-01 lnstobb-minimap))) + (set! (-> this sprites 0 scale-x) 1.0) + (set! (-> this sprites 0 scale-y) 1.0) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 4 tid) (the-as texture-id (get-texture hud-mhcentipede-meter-01 lnstobb-minimap))) + (set! (-> this sprites 4 scale-x) 1.0) + (set! (-> this sprites 4 scale-y) 1.3) + (set! (-> this sprites 4 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 3 tid) (the-as texture-id (get-texture hud-small-frame-01 lnstobb-minimap))) + (set! (-> this sprites 3 scale-x) 1.0) + (set! (-> this sprites 3 scale-y) 1.0) + (set! (-> this sprites 3 flags) (hud-sprite-flags hsf0 hsf2)) + (set! (-> this sprites 2 tid) (the-as texture-id (get-texture hud-small-frame-01 lnstobb-minimap))) + (set! (-> this sprites 2 scale-x) 1.0) + (set! (-> this sprites 2 scale-y) 1.0) + (set! (-> this sprites 2 flags) (hud-sprite-flags hsf2)) + (set! (-> this sprites 1 tid) (the-as texture-id (get-texture hud-small-frame-02 lnstobb-minimap))) + (set! (-> this sprites 1 scale-x) 14.0) + (set! (-> this sprites 1 scale-y) 1.0) + (set! (-> this sprites 1 flags) (hud-sprite-flags hsf2)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.6) + (set! (-> this strings 0 flags) (font-flags shadow kerning large)) + 0 + (none) + ) + +;; definition of type task-manager-mh-centipede +(deftype task-manager-mh-centipede (task-manager) + ((vehicle-handle handle) + (manager-entity entity-actor) + (check-timer time-frame) + (actor-group (pointer actor-group)) + (actor-group-count int32) + (last-centipede-position vector :inline) + (last-target-position vector :inline) + ) + (:methods + (init-actor-group! (_type_) none) + ) + ) + +;; definition for method 3 of type task-manager-mh-centipede +(defmethod inspect ((this task-manager-mh-centipede)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle)) + (format #t "~2Tmanager-entity: ~A~%" (-> this manager-entity)) + (format #t "~2Tcheck-timer: ~D~%" (-> this check-timer)) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tlast-centipede-position: #~%" (-> this last-centipede-position)) + (format #t "~2Tlast-target-position: #~%" (-> this last-target-position)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-mh-centipede) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self check-timer) 0) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + ) + :exit (behavior () + (remove-setting! 'pilot-exit) + (remove-setting! 'pilot-death) + ) + :code (behavior () + (local-vars (v1-11 object)) + (while (begin + (set! (-> self vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 14)) + (not (handle->process (-> self vehicle-handle))) + ) + (format *stdebug* "mh-centipede task manager waiting for scorpion~%") + (suspend) + ) + (sig-rider-spawn (the-as vehicle (handle->process (-> self vehicle-handle))) #t) + (until v1-11 + (suspend) + (set! v1-11 (and *target* (= (send-event *target* 'query 'mode) 'pilot))) + ) + (sleep-code) + ) + ) + +;; definition for method 30 of type task-manager-mh-centipede +;; INFO: Used lq/sq +(defmethod taskman-event-handler ((this task-manager-mh-centipede) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('centipede-died) + (set! (-> this last-centipede-position quad) (-> (the-as vector (-> arg3 param 0)) quad)) + (let ((gp-0 (the-as object (-> this last-target-position)))) + (set! (-> (the-as vector gp-0) quad) (-> (target-pos 0) quad)) + gp-0 + ) + ) + (else + ((method-of-type task-manager taskman-event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 26 of type task-manager-mh-centipede +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-mh-centipede)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (time-elapsed? (-> this check-timer) (seconds 0.1)) + (if (not (-> this manager-entity)) + (init-actor-group! this) + ) + (let ((v1-9 0)) + (when (> (-> this actor-group-count) 0) + (dotimes (a0-6 (-> this actor-group 0 length)) + (if (not (logtest? (-> this actor-group 0 data a0-6 actor extra perm status) (entity-perm-status subtask-complete)) + ) + (+! v1-9 1) + ) + ) + ) + (set! (-> *game-info* counter) (the float v1-9)) + (when (zero? v1-9) + (let ((s5-0 (entity-by-name "rod-spawner-1"))) + (when s5-0 + (entity-birth-no-kill s5-0) + (send-event + (if s5-0 + (-> s5-0 extra process) + ) + 'appear + (-> this last-centipede-position) + (-> this last-target-position) + ) + ) + ) + (send-event this 'complete) + ) + ) + (set-time! (-> this check-timer)) + ) + (when (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (let* ((s5-1 (handle->process (-> this vehicle-handle))) + (a0-22 (if (type? s5-1 process-focusable) + (the-as vehicle s5-1) + ) + ) + ) + (if (and a0-22 (focus-test? a0-22 dead)) + (send-event this 'fail) + ) + ) + ) + (none) + ) + +;; definition for method 32 of type task-manager-mh-centipede +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-actor-group! ((this task-manager-mh-centipede)) + (local-vars (sv-16 res-tag)) + (let* ((s5-0 "mh-centipede-7") + (a0-2 (entity-by-name s5-0)) + ) + (cond + (a0-2 + (set! (-> this manager-entity) (the-as entity-actor a0-2)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-1 (res-lump-data a0-2 'actor-groups pointer :tag-ptr (& sv-16)))) + (cond + ((and v1-1 (nonzero? (-> sv-16 elt-count))) + (set! (-> this actor-group-count) (the-as int (-> sv-16 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) v1-1)) + ) + (else + (format 0 "ERROR: ~S: ~S entity missing actor-group!~%" (game-task->string (-> this node-info task)) s5-0) + ) + ) + ) + (set! (-> this hud-counter) + (ppointer->handle (process-spawn hud-mh-centipede :init hud-init-by-other :name "hud-mh-centipede" :to this)) + ) + ) + (else + ) + ) + ) + (none) + ) + +;; definition for method 25 of type task-manager-mh-centipede +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-25 ((this task-manager-mh-centipede)) + (let ((t9-0 (method-of-type task-manager task-manager-method-25))) + (t9-0 this) + ) + (send-event (handle->process (-> this hud-counter)) 'hide-and-die) + (none) + ) + +;; definition for method 21 of type task-manager-mh-centipede +;; WARN: Return type mismatch symbol vs none. +(defmethod set-time-limit ((this task-manager-mh-centipede)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set! (-> this manager-entity) #f) + (set! (-> this actor-group-count) 0) + (set-setting! 'extra-bank '((nest1 nest3) (nest2 nest4)) 0.0 0) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + (set-setting! 'scarf 'abs 1.0 0) + (set-setting! 'goggles 'abs 1.0 0) + (set-setting! 'music 'nesthunt 0.0 0) + (set-setting! 'cloth #f 0.0 0) + (set-setting! 'armor #f 0.0 0) + (reset-nest-hunt-speeches 1.0) + (none) + ) + +;; definition of type task-manager-nstb-crystal +(deftype task-manager-nstb-crystal (task-manager) + ((vehicle-handle handle) + ) + ) + +;; definition for method 3 of type task-manager-nstb-crystal +(defmethod inspect ((this task-manager-nstb-crystal)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tvehicle-handle: ~D~%" (-> this vehicle-handle)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate active (task-manager-nstb-crystal) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type task-manager active) enter))) + (if t9-0 + (t9-0) + ) + ) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + ) + :exit (behavior () + (remove-setting! 'pilot-exit) + (remove-setting! 'pilot-death) + ) + :code (behavior () + (local-vars (v1-11 object)) + (while (begin + (set! (-> self vehicle-handle) (-> *vehicle-info* handle-by-vehicle-type 14)) + (not (handle->process (-> self vehicle-handle))) + ) + (format *stdebug* "nstb-crystal task manager waiting for scorpion~%") + (suspend) + ) + (sig-rider-spawn (the-as vehicle (handle->process (-> self vehicle-handle))) #t) + (until v1-11 + (suspend) + (set! v1-11 (and *target* (= (send-event *target* 'query 'mode) 'pilot))) + ) + (sleep-code) + ) + ) + +;; definition for method 26 of type task-manager-nstb-crystal +;; WARN: Return type mismatch object vs none. +(defmethod task-manager-method-26 ((this task-manager-nstb-crystal)) + (let ((t9-0 (method-of-type task-manager task-manager-method-26))) + (t9-0 this) + ) + (when (and *target* (not (logtest? (focus-status teleporting) (-> *target* focus-status)))) + (let* ((s5-0 (handle->process (-> this vehicle-handle))) + (a0-8 (if (type? s5-0 process-focusable) + (the-as vehicle s5-0) + ) + ) + ) + (if (and a0-8 (focus-test? a0-8 dead)) + (send-event this 'fail) + ) + ) + ) + (none) + ) + +;; definition for method 21 of type task-manager-nstb-crystal +;; WARN: Return type mismatch connection vs none. +(defmethod set-time-limit ((this task-manager-nstb-crystal)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set! (-> this vehicle-handle) (the-as handle #f)) + (set-setting! 'extra-bank '((nest1 nest3) (nest2 nest4)) 0.0 0) + (set-setting! 'pilot-exit #f 0.0 0) + (set-setting! 'pilot-death #t 0.0 0) + (set-setting! 'scarf 'abs 1.0 0) + (set-setting! 'goggles 'abs 1.0 0) + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/mh-wasp-part_REF.gc b/test/decompiler/reference/jak3/levels/sewer/mh-wasp-part_REF.gc new file mode 100644 index 0000000000..205a8895fa --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/mh-wasp-part_REF.gc @@ -0,0 +1,550 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpart 5009 + :init-specs ((:texture (gun-enemy-beam level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 0.4)) + (:scale-y (meters 8)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 32.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 5010 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 5011 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 0.3) (meters 0.3)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 64.0 32.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpart 5012 + :init-specs ((:texture (gun-enemy-muzzleflash level-default-sprite)) + (:birth-func 'birth-func-set-quat) + (:num 1.0) + (:scale-x (meters 2)) + (:scale-y (meters 4.5)) + (:r 128.0) + (:g 128.0) + (:b 128.0) + (:a 128.0) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 left-multiply-quat)) + ) + ) + +;; failed to figure out what this is: +(defpart 5013 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 2) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 64.0) + (:b 128.0) + (:a 128.0) + (:rotvel-z (degrees -360) (degrees 720)) + (:fade-a -3.6571429) + (:timer (seconds 0.117)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-wasp-shot-hit + :id 1525 + :duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5014 :period (seconds 2) :length (seconds 0.017)) + (sp-item 5015 :fade-after (meters 100) :period (seconds 2) :length (seconds 0.017)) + (sp-item 5016 :period (seconds 2) :length (seconds 0.017)) + (sp-item 5017 :fade-after (meters 50) :falloff-to (meters 50) :period (seconds 2) :length (seconds 0.017)) + ) + ) + +;; failed to figure out what this is: +(defpart 5017 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 20.0 10.0) + (:y (meters 0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 96.0) + (:b 128.0 128.0) + (:a 64.0 32.0) + (:vel-y (meters 0.06666667) (meters 0.013333334)) + (:scalevel-x (meters -0.001) (meters -0.00033333333)) + (:rotvel-z (degrees -2.4) 1 (degrees 4.8)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.42666668) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.9) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.667)) + (:next-launcher 5018) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 5019 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.3)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0 128.0) + (:b 32.0 8.0) + (:a 96.0) + (:vel-y (meters 0.016666668) (meters 0.033333335)) + (:scalevel-x (meters -0.0005) (meters -0.0005)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.64) + (:fade-b -0.10666667) + (:accel-y (meters -0.00033333333) (meters -0.0013333333)) + (:friction 0.95) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.335)) + (:next-launcher 5018) + (:conerot-x (degrees 0) (degrees 180)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 5018 + :init-specs ((:fade-a -0.48 -0.48)) + ) + +;; failed to figure out what this is: +(defpart 5015 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 4)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 128.0) + (:b 128.0 128.0) + (:a 128.0) + (:rotvel-z (degrees -0.1)) + (:fade-a -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14)) + (:next-time (seconds 0.035)) + (:next-launcher 5020) + ) + ) + +;; failed to figure out what this is: +(defpart 5020 + :init-specs ((:scale-x (meters 2) (meters 0.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 128.0 128.0) + (:next-time (seconds 0.017)) + (:next-launcher 5020) + ) + ) + +;; failed to figure out what this is: +(defpart 5016 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 2.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 0.0 64.0) + (:b 128.0 128.0) + (:a 48.0) + (:scalevel-x (meters 0.12857144)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-g -2.1333334) + (:fade-b -2.1333334) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2)) + (:next-time (seconds 0.067)) + (:next-launcher 5021) + ) + ) + +;; failed to figure out what this is: +(defpart 5021 + :init-specs ((:scale-x (meters 4.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.06666667)) + (:scalevel-y :copy scalevel-x) + (:fade-g -0.53333336) + (:fade-a -0.8) + ) + ) + +;; failed to figure out what this is: +(defpart 5014 + :init-specs ((:texture (bigstarflash sewa-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.16666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:timer (seconds 0.185)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.05)) + (:next-launcher 5022) + ) + ) + +;; failed to figure out what this is: +(defpart 5022 + :init-specs ((:scale-x (meters 3.5)) + (:scale-y :copy scale-x) + (:scalevel-x (meters -0.0875)) + (:scalevel-y :copy scalevel-x) + (:fade-b -6.4) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-wasp-shot-die + :id 1526 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 249)) + ) + +;; failed to figure out what this is: +(defpart 5023 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2.5)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 192.0) + (:b 64.0) + (:a 16.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:userdata 819.2) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-wasp-gun-smoke + :id 1527 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5024 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5024 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 1.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 64.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.10666667) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-wasp-gun-casing + :id 1528 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5025 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 5026 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 5026 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 32.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.56) + (:fade-g -2.56) + (:fade-b 2.56) + (:fade-a -0.32) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.167)) + (:next-launcher 5027) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5027 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpart 5025 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:z (meters -0.4)) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.15) (meters 0.02)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:fade-b -8.0) + (:accel-y (meters -0.0016666667) (meters -0.0016666667)) + (:friction 0.9 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.05)) + (:next-launcher 5028) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5028 + :init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96)) + ) + +;; failed to figure out what this is: +(defpartgroup group-mh-wasp-engine + :id 1529 + :duration (seconds 0.017) + :flags (sp0 sp7) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 5029 :flags (is-3d sp7)) + (sp-item 5030 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + (sp-item 5031 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + (sp-item 5032 :fade-after (meters 60) :falloff-to (meters 60) :flags (sp7)) + (sp-item 5033 :fade-after (meters 120) :falloff-to (meters 120) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 5029 + :init-specs ((:texture (mech-flame sewa-sprite)) + (:num 1.0) + (:y (meters 0)) + (:z (meters -1.2) (meters 0.1)) + (:scale-x (meters 0.6)) + (:scale-y (meters 2.6)) + (:r 128.0 128.0) + (:g 64.0 64.0) + (:b :copy g) + (:a 128.0 64.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:rotate-x (degrees -90)) + (:rotate-y (degrees 0)) + (:rotate-z (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5033 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:y (meters -0.3)) + (:scale-x (meters 1.5) (meters 0.1)) + (:rot-x (degrees 2.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0 64.0) + (:b 0.0) + (:a 16.0 8.0) + (:omega (degrees 2718)) + (: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 5030 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5) + (:y (meters 0) (meters -0.25)) + (:scale-x (meters 0.2) (meters 0.2)) + (:rot-z (degrees 0) 1 (degrees 180)) + (:scale-y (meters 1) (meters 0.6)) + (:r 192.0) + (:g 64.0) + (:b 0.0) + (:a 0.0 16.0) + (:vel-y (meters -0.1) (meters -0.016666668)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y (meters 0.006666667)) + (:fade-r -2.0) + (:fade-g 2.0) + (:fade-b 5.0) + (:fade-a 0.32) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters 0.00016666666) (meters 0.00033333333)) + (:friction 0.94) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.085)) + (:next-launcher 5034) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 5034 + :init-specs ((:r 64.0 64.0) + (:g 64.0 64.0) + (:b 64.0 64.0) + (:fade-r 0.0) + (:fade-g 0.0) + (:fade-b 0.0) + (:fade-a -0.064 -0.128) + ) + ) + +;; failed to figure out what this is: +(defpart 5031 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 0.1 0.1) + (:y (meters 0.25) (meters -0.5)) + (:scale-x (meters 0.05)) + (:scale-y (meters 0.5)) + (:r 192.0 64.0) + (:g 0.0 128.0) + (:b 0.0) + (:a 128.0) + (:vel-y (meters -0.033333335) (meters -0.026666667)) + (:scalevel-x (meters 0.001)) + (:scalevel-y (meters -0.017)) + (:fade-g 0.0) + (:accel-x (meters 0) (meters 0.0016666667)) + (:accel-y (meters 0.00016666666) (meters 0.0005)) + (:friction 0.96) + (:timer (seconds 0.167) (seconds 0.247)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-13 sp-cpuinfo-flag-14 launch-along-z)) + (:next-time (seconds 0.1)) + (:next-launcher 5035) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 5035 + :init-specs ((:scalevel-x (meters 0)) (:scalevel-y (meters 0))) + ) + +;; failed to figure out what this is: +(defpart 5032 + :init-specs ((:num 1.0) + (:rot-x 8) + (:r 1638.4) + (:g 1331.2) + (:b 1433.6) + (:vel-y (meters -0.1) (meters -0.016666668)) + (:fade-r 32.768) + (:fade-g 26.623999) + (:fade-b 28.671999) + (:accel-x (meters 0) (meters 0.0016666667)) + (:friction 0.94) + (:timer (seconds 0.335)) + (:flags (distort launch-along-z)) + (:next-time (seconds 0.167)) + (:next-launcher 5036) + (:rotate-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 5036 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b -4.096)) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc new file mode 100644 index 0000000000..943c2ce01e --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/mh-wasp_REF.gc @@ -0,0 +1,1427 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-mh-wasp-explosion + :id 1530 + :duration (seconds 2) + :linger-duration (seconds 1) + :flags (sp0 sp5 sp6 sp7) + :bounds (static-bspherem 0 0 0 15) + :rotate ((degrees 0) (degrees 90) (degrees 0)) + :scale (0.25 0.25 0.25) + :parts ((sp-item 5037 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 5038 :flags (sp6) :period (seconds 3) :length (seconds 0.017)) + (sp-item 5039 :period (seconds 3) :length (seconds 0.05)) + (sp-item 5040 :fade-after (meters 60) :period (seconds 3) :length (seconds 0.035) :offset 10) + (sp-item 5041 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 3) :length (seconds 0.167) :offset 20) + (sp-item 5042 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 3) :length (seconds 0.085) :offset 20) + (sp-item 5043 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 3) :length (seconds 0.067) :offset 30) + ) + ) + +;; failed to figure out what this is: +(defpart 5038 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 2)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 24.0) + (:scalevel-x (meters 0.10666667)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -4.266667) + (:fade-b -4.266667) + (:fade-a 0.0) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 sp-cpuinfo-flag-14 glow)) + (:next-time (seconds 0.25)) + (:next-launcher 5044) + ) + ) + +;; failed to figure out what this is: +(defpart 5044 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.85333335) + (:fade-g -1.7066667) + (:fade-b -1.7066667) + (:fade-a -0.64) + ) + ) + +;; failed to figure out what this is: +(defpart 5043 + :init-specs ((:texture (explosion-wave sewa-sprite)) + (:num 2.0 0.2) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 3600) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085)) + (:next-launcher 5045) + (:conerot-x '*sp-temp*) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5042 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:birth-func 'birth-func-texture-group) + (:num 3.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400700)) + (:next-time (seconds 0.085)) + (:next-launcher 5045) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5045 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 5046)) + ) + +;; failed to figure out what this is: +(defpart 5046 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 5047) + ) + ) + +;; failed to figure out what this is: +(defpart 5047 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 5048) + ) + ) + +;; failed to figure out what this is: +(defpart 5048 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.1125)) + ) + +;; failed to figure out what this is: +(defpart 5037 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:rot-x (degrees 11.25)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.217)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + (:next-time (seconds 0.1)) + (:next-launcher 5049) + ) + ) + +;; failed to figure out what this is: +(defpart 5049 + :init-specs ((:scalevel-x (meters -0.2857143)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -3.6571429) + (:fade-b 0.0) + (:fade-a -2.7428572) + ) + ) + +;; failed to figure out what this is: +(defpart 5041 + :init-specs ((:texture (specs level-default-sprite)) + (:num 8.0 2.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 5050) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5050 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 5051) + ) + ) + +;; failed to figure out what this is: +(defpart 5051 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +;; failed to figure out what this is: +(defpart 5039 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 8.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2.5) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.02)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 5052) + (:conerot-x (degrees 0) (degrees 3600)) + (:conerot-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5052 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 5053) + ) + ) + +;; failed to figure out what this is: +(defpart 5053 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 5040 + :init-specs ((:texture (flamingstick sewa-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.2) (meters 0.5)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.3)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; definition of type mh-wasp-shot +(deftype mh-wasp-shot (metalhead-shot) + () + ) + +;; definition for method 3 of type mh-wasp-shot +(defmethod inspect ((this mh-wasp-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type metalhead-shot inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 28 of type mh-wasp-shot +;; WARN: Return type mismatch int vs none. +(defmethod play-impact-sound ((this mh-wasp-shot) (arg0 projectile-options)) + (let ((v1-0 arg0)) + (cond + ((zero? v1-0) + (sound-play "wasp-shot-fire") + ) + ((= v1-0 (projectile-options po0)) + (sound-play "wasp-shot-hit") + ) + ) + ) + 0 + (none) + ) + +;; definition for method 31 of type mh-wasp-shot +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-proj-settings! ((this mh-wasp-shot)) + (set! (-> this tail-pos quad) (-> this root trans quad)) + (set! (-> this attack-mode) 'mh-wasp-shot) + (set! (-> this max-speed) 491520.0) + (set! (-> this move) metalhead-shot-move) + (set! (-> this timeout) (seconds 1.375)) + 0 + (none) + ) + +;; definition of type mh-wasp +(deftype mh-wasp (hover-enemy) + ((gun-jmod joint-mod-rotate-local :inline) + (entity-group actor-group) + (smoke-part sparticle-launch-control) + (engine-part sparticle-launch-control) + (old-gravity float :offset 1024) + (knocked-anim int32) + (knocked-recover-anim int32) + (last-fire-time time-frame) + (bridge-index int32) + (gun-x-angle float) + (gun-x-angle-final float) + (path-u float) + (path-du float) + (path-du-final float) + (path-dest float) + (sound-id sound-id) + (attack-wait-min float) + (attack-wait-max float) + (attack-miss-dist-min float) + (attack-miss-dist-max float) + (attack-miss-dist-curr float) + ) + (:state-methods + attack + die-now + die-explode + ) + (:methods + (fire-shot (_type_ projectile-init-by-other-params int int float) none) + ) + ) + +;; definition for method 3 of type mh-wasp +(defmethod inspect ((this mh-wasp)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hover-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tgun-jmod: #~%" (-> this gun-jmod)) + (format #t "~2Tentity-group: ~A~%" (-> this entity-group)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tengine-part: ~A~%" (-> this engine-part)) + (format #t "~2Tknocked-start-level: ~f~%" (-> this knocked-start-level)) + (format #t "~2Told-gravity: ~f~%" (-> this old-gravity)) + (format #t "~2Tknocked-anim: ~D~%" (-> this knocked-anim)) + (format #t "~2Tknocked-recover-anim: ~D~%" (-> this knocked-recover-anim)) + (format #t "~2Tlast-fire-time: ~D~%" (-> this last-fire-time)) + (format #t "~2Tbridge-index: ~D~%" (-> this bridge-index)) + (format #t "~2Tgun-x-angle: ~f~%" (-> this gun-x-angle)) + (format #t "~2Tgun-x-angle-final: ~f~%" (-> this gun-x-angle-final)) + (format #t "~2Tpath-u: ~f~%" (-> this path-u)) + (format #t "~2Tpath-du: ~f~%" (-> this path-du)) + (format #t "~2Tpath-du-final: ~f~%" (-> this path-du-final)) + (format #t "~2Tpath-dest: ~f~%" (-> this path-dest)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tattack-wait-min: ~f~%" (-> this attack-wait-min)) + (format #t "~2Tattack-wait-max: ~f~%" (-> this attack-wait-max)) + (format #t "~2Tattack-miss-dist-min: ~f~%" (-> this attack-miss-dist-min)) + (format #t "~2Tattack-miss-dist-max: ~f~%" (-> this attack-miss-dist-max)) + (format #t "~2Tattack-miss-dist-curr: ~f~%" (-> this attack-miss-dist-curr)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defskelgroup skel-mh-wasp neo-wasp neo-wasp-lod0-jg -1 + ((neo-wasp-lod0-mg (meters 20)) (neo-wasp-lod1-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7.5) + :shadow neo-wasp-shadow-mg + :origin-joint-index 3 + ) + +;; failed to figure out what this is: +(defskelgroup skel-mh-wasp-explode neo-wasp neo-wasp-explode-lod0-jg neo-wasp-explode-idle-ja + ((neo-wasp-explode-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 7.5) + :origin-joint-index 3 + ) + +;; definition for symbol *mh-wasp-exploder-params*, type joint-exploder-static-params +(define *mh-wasp-exploder-params* + (new 'static 'joint-exploder-static-params + :joints (new 'static 'boxed-array :type joint-exploder-static-joint-params + (new 'static 'joint-exploder-static-joint-params :joint-index 3 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 4 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 5 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 6 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 7 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 8 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 9 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 10 :parent-joint-index -1) + (new 'static 'joint-exploder-static-joint-params :joint-index 11 :parent-joint-index -1) + ) + :collide-spec (collide-spec backgnd) + ) + ) + +;; definition for symbol *fact-info-mh-wasp-defaults*, type fact-info-enemy-defaults +(define *fact-info-mh-wasp-defaults* + (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80) :pickup-type 9) + ) + +;; definition for symbol *mh-wasp-enemy-info*, type enemy-info +(define *mh-wasp-enemy-info* (new 'static 'enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script #f + :idle-anim 4 + :notice-anim 4 + :hostile-anim 4 + :hit-anim 12 + :knocked-anim 10 + :knocked-land-anim 11 + :die-anim 14 + :die-falling-anim 15 + :victory-anim 4 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 7 + :look-at-joint 7 + :bullseye-joint 4 + :sound-hit (static-sound-name "wasp-hit") + :sound-die (static-sound-name "wasp-die") + :notice-distance (meters 70) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 55) + :default-hit-points 6.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 53248.0 + :knocked-hard-vxz-hi 101580.8 + :knocked-hard-vy-lo 60620.8 + :knocked-hard-vy-hi 95027.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 10) + :shadow-min-y (meters -20) + :shadow-locus-dist (meters 150) + :gem-joint 7 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +;; failed to figure out what this is: +(set! (-> *mh-wasp-enemy-info* fact-defaults) *fact-info-mh-wasp-defaults*) + +;; definition for method 82 of type mh-wasp +(defmethod event-handler ((this mh-wasp) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-knocked) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this focus-status) (focus-status dangerous)) + (logclear! (-> this enemy-flags) (enemy-flag use-notice-distance)) + (logior! (-> this enemy-flags) (enemy-flag alert)) + (logior! (-> this focus-status) (focus-status hit)) + (if (= (-> this hit-points) 0.0) + (logior! (-> this focus-status) (focus-status dead)) + ) + (logclear! (-> this enemy-flags) (enemy-flag lock-focus)) + (enemy-method-69 this) + (logior! (-> this enemy-flags) (enemy-flag lock-focus)) + (process-contact-action arg0) + (send-event arg0 'get-attack-count 1) + (freeze-hit-begin) + (if (= (-> this hit-points) 0.0) + (go (method-of-object this die-explode)) + (go (method-of-object this knocked)) + ) + ) + (else + ((method-of-type hover-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 56 of type mh-wasp +(defmethod knocked-handler ((this mh-wasp) (arg0 vector)) + (let ((s4-0 (-> this root))) + (case (-> this incoming knocked-type) + (((knocked-type explode-or-darkjak)) + (let ((gp-1 (-> this root transv))) + (let ((a1-1 (handle->process (-> this incoming attacker-handle)))) + (if a1-1 + (vector-! gp-1 (-> (the-as process-drawable a1-1) root trans) (-> this root trans)) + (vector-! gp-1 (-> this incoming attacker-pos) (-> this root trans)) + ) + ) + (set! (-> gp-1 y) 0.0) + (vector-normalize! gp-1 1.0) + (vector-rotate90-around-y! gp-1 gp-1) + (if (< 0.0 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (-> this incoming attacker-pos) (-> s4-0 trans)) + (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat)) + ) + ) + (vector-negate! gp-1 gp-1) + ) + (let ((f30-1 (rnd-float-range this 0.0 1.0)) + (s5-1 (-> this enemy-info)) + ) + (vector-float*! gp-1 gp-1 (lerp (-> s5-1 knocked-hard-vxz-lo) (-> s5-1 knocked-hard-vxz-hi) f30-1)) + (set! (-> gp-1 y) (lerp (-> s5-1 knocked-hard-vy-lo) (-> s5-1 knocked-hard-vy-hi) f30-1)) + ) + ) + ) + (else + (call-parent-method this arg0) + ) + ) + ) + ) + +;; definition for method 122 of type mh-wasp +(defmethod go-idle2 ((this mh-wasp)) + (if (logtest? (enemy-option ambush) (-> this fact enemy-options)) + (go (method-of-object this ambush)) + (go (method-of-object this notice)) + ) + ) + +;; definition for method 78 of type mh-wasp +(defmethod go-hostile ((this mh-wasp)) + (go (method-of-object this hostile)) + ) + +;; definition for method 80 of type mh-wasp +(defmethod go-best-state ((this mh-wasp)) + (go-hostile this) + ) + +;; definition for method 59 of type mh-wasp +(defmethod enemy-common-post ((this mh-wasp)) + (seek! (-> this gun-x-angle) (-> this gun-x-angle-final) (* 21845.334 (seconds-per-frame))) + ((method-of-type hover-enemy enemy-common-post) this) + (none) + ) + +;; failed to figure out what this is: +(defstate ambush (mh-wasp) + :virtual #t + :enter (behavior () + (logior! (-> self enemy-flags) (enemy-flag alert)) + (logior! (-> self enemy-flags) (enemy-flag cam-attack-mode)) + (hover-enemy-method-159 self #f) + (set-time! (-> self scale-timer)) + (cond + ((not (logtest? (-> self fact enemy-options) (enemy-option user0))) + (logclear! (-> self enemy-flags) (enemy-flag vulnerable)) + (hover-enemy-method-162 self 0.0) + ) + (else + (hover-enemy-method-162 self 1.0) + ) + ) + (hover-enemy-method-165 self) + (set-time! (-> self state-time)) + ) + :trans (behavior () + (when (and (not (logtest? (-> self fact enemy-options) (enemy-option user0))) + (time-elapsed? (-> self state-time) (seconds 2)) + ) + (hover-enemy-method-161 self) + (go-virtual hostile) + ) + ) + :code hover-enemy-fly-code + :post (behavior () + (local-vars (v1-19 enemy-flag)) + (when (not (logtest? (-> self fact enemy-options) (enemy-option user0))) + (let ((f0-1 (the float (- (current-time) (-> self scale-timer)))) + (f1-0 600.0) + ) + (when (< f0-1 f1-0) + (let ((f30-0 (fmin 1.0 (/ (+ 30.0 f0-1) f1-0)))) + (hover-enemy-method-162 self f30-0) + (when (and (not (logtest? (-> self enemy-flags) (enemy-flag vulnerable))) (>= f30-0 1.0)) + (let ((v1-18 (-> self enemy-flags))) + (if (logtest? v1-18 (enemy-flag vulnerable-backup)) + (set! v1-19 (logior v1-18 (enemy-flag vulnerable))) + (set! v1-19 (logclear v1-18 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-19) + ) + ) + ) + ) + ) + (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) + (hover-enemy-hostile-post) + ) + ) + +;; failed to figure out what this is: +(defstate notice (mh-wasp) + :virtual #t + :post (behavior () + (let ((t9-0 (-> (method-of-type hover-enemy notice) post))) + (if t9-0 + ((the-as (function none) t9-0)) + ) + ) + (set! (-> self last-fire-time) (+ (current-time) (seconds -1.5))) + ) + ) + +;; failed to figure out what this is: +(defstate hostile (mh-wasp) + :virtual #t + :trans (behavior () + (let ((gp-0 (ja-group)) + (f0-0 (ja-aframe-num 0)) + ) + (when (and (= gp-0 neo-wasp-idle-ja) + (or (and (>= f0-0 0.0) (>= 1.0 f0-0)) + (and (>= f0-0 16.0) + (>= (the float (+ (-> (the-as art-joint-anim neo-wasp-idle-ja) frames num-frames) -1)) (ja-frame-num 0)) + ) + ) + ) + (if (and (time-elapsed? + (-> self last-fire-time) + (the int (* 300.0 (rand-vu-float-range (-> self attack-wait-min) (-> self attack-wait-max)))) + ) + (get-focus! self) + ) + (go-virtual attack) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate attack (mh-wasp) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('event-attack) + (let ((gp-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (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 notify-handle) (the-as handle #f)) + (set! (-> gp-0 owner-handle) (the-as handle #f)) + (set! (-> gp-0 target-handle) (the-as handle #f)) + (set! (-> gp-0 target-pos quad) (the-as uint128 0)) + (set! (-> gp-0 ignore-handle) (process->handle self)) + (let* ((v1-9 *game-info*) + (a0-7 (+ (-> v1-9 attack-id) 1)) + ) + (set! (-> v1-9 attack-id) a0-7) + (set! (-> gp-0 attack-id) a0-7) + ) + (set! (-> gp-0 timeout) (seconds 4)) + (fire-shot self gp-0 19 17 -1.0) + (fire-shot self gp-0 23 21 1.0) + ) + (sound-play "wasp-fire" :position (-> self root trans)) + ) + (else + (enemy-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self attack-miss-dist-curr) (-> self attack-miss-dist-min)) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.2)) + (sound-play "wasp-warn" :position (-> self root trans)) + (ja-no-eval :group! (-> self draw art-group data (-> self hover-info shoot-anim)) + :num! (seek!) + :frame-num 0.0 + ) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set-time! (-> self last-fire-time)) + (set! (-> self restart-fly-anims) #t) + (go-hostile self) + ) + :post (behavior () + (let* ((a1-0 (-> self node-list data (-> self hover-info gun-base))) + (a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) a1-0)) + (gp-0 (new 'stack-no-clear 'vector)) + ) + (let ((v1-4 (new 'stack-no-clear 'vector))) + (set! (-> v1-4 quad) (-> self focus-pos quad)) + (+! (-> v1-4 y) (-> self attack-miss-dist-curr)) + (vector-! gp-0 v1-4 a0-2) + ) + (vector-normalize! gp-0 1.0) + (set! (-> self gun-x-angle-final) (- (vector-x-angle gp-0))) + ) + (quaternion-vector-angle! (-> self gun-jmod rotation) *x-vector* (-> self gun-x-angle)) + (seek! + (-> self attack-miss-dist-curr) + (-> self attack-miss-dist-max) + (* 0.5 (seconds-per-frame) (- (-> self attack-miss-dist-max) (-> self attack-miss-dist-min))) + ) + (hover-enemy-hostile-post) + ) + ) + +;; failed to figure out what this is: +(defstate knocked-recover (mh-wasp) + :virtual #t + :event enemy-event-handler + :code (behavior () + (local-vars (v1-35 enemy-flag) (v1-37 enemy-flag) (v1-39 enemy-flag)) + (ja-channel-push! 1 (seconds 0.5)) + (ja-no-eval :group! (-> self draw art-group data (-> self knocked-recover-anim)) :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (set! (-> self restart-fly-anims) #t) + (if (logtest? (-> self enemy-flags) (enemy-flag dangerous-backup)) + (logior! (-> self focus-status) (focus-status dangerous)) + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + (let ((v1-34 (-> self enemy-flags))) + (if (logtest? v1-34 (enemy-flag vulnerable-backup)) + (set! v1-35 (logior v1-34 (enemy-flag vulnerable))) + (set! v1-35 (logclear v1-34 (enemy-flag vulnerable))) + ) + ) + (set! (-> self enemy-flags) v1-35) + (let ((v1-36 (-> self enemy-flags))) + (if (logtest? v1-36 (enemy-flag attackable-backup)) + (set! v1-37 (logior v1-36 (enemy-flag attackable))) + (set! v1-37 (logclear v1-36 (enemy-flag attackable))) + ) + ) + (set! (-> self enemy-flags) v1-37) + (let ((v1-38 (-> self enemy-flags))) + (if (logtest? (enemy-flag trackable-backup) v1-38) + (set! v1-39 (logior (enemy-flag trackable) v1-38)) + (set! v1-39 (logclear v1-38 (enemy-flag trackable))) + ) + ) + (set! (-> self enemy-flags) v1-39) + (logclear! (-> self enemy-flags) (enemy-flag lock-focus)) + (logclear! (-> self focus-status) (focus-status hit)) + (hover-nav-control-method-20 (-> self hover)) + (go-hostile self) + ) + ) + +;; failed to figure out what this is: +(defstate die-explode (mh-wasp) + :virtual #t + :event enemy-event-handler + :code (behavior () + (on-dying self) + (set! (-> self hit-points) 0.0) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-stop (-> self sound-id)) + (sound-play "wasp-explode") + (let ((gp-1 (new 'stack 'joint-exploder-tuning (the-as uint 0)))) + (process-spawn + joint-exploder + (art-group-get-by-name *level* "skel-mh-wasp-explode" (the-as (pointer level) #f)) + 22 + gp-1 + *mh-wasp-exploder-params* + :name "joint-exploder" + :to self + ) + ) + (cond + ((logtest? (-> *part-group-id-table* 1530 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1530)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1530)) + ) + ) + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; failed to figure out what this is: +(defstate die-now (mh-wasp) + :virtual #t + :event enemy-event-handler + :code (behavior () + (on-dying self) + (let ((v1-3 (-> self root root-prim))) + (set! (-> v1-3 prim-core collide-as) (collide-spec)) + (set! (-> v1-3 prim-core collide-with) (collide-spec)) + ) + 0 + (set! (-> self hit-points) 0.0) + (do-effect (-> self skel effect) (the-as string 'death-default) 0.0 -1) + (let ((gp-0 (current-time))) + (until (time-elapsed? gp-0 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (cleanup-for-death self) + ) + :post transform-post + ) + +;; definition for method 113 of type mh-wasp +(defmethod get-focus! ((this mh-wasp)) + (let ((s5-0 (the-as process-focusable (handle->process (-> this focus handle))))) + (when s5-0 + (let* ((a0-4 (-> this root)) + (s4-1 (vector+! (new 'stack-no-clear 'vector) (-> a0-4 trans) (-> a0-4 transv))) + (s3-1 (vector-! (new 'stack-no-clear 'vector) s4-1 (-> this focus-pos))) + (s2-1 (vector-z-quaternion! (new 'stack-no-clear 'vector) (get-quat s5-0 0))) + (s3-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) s3-1 1.0)) + ) + (if (and (and s5-0 (not (logtest? (-> s5-0 focus-status) (focus-status disable dead ignore grabbed)))) + (< 0.0 (vector-dot s2-1 s3-2)) + (< (vector-vector-distance s4-1 (-> this focus-pos)) 225280.0) + (and (< (fabs (vector-x-angle s3-2)) 3640.889) (enemy-method-104 this (-> this focus-pos) 5461.3335)) + ) + s5-0 + ) + ) + ) + ) + ) + +;; definition for method 85 of type mh-wasp +(defmethod knocked-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + (cond + ((rnd-chance? this 0.5) + (set! (-> this knocked-anim) 10) + (set! (-> this knocked-recover-anim) 11) + ) + (else + (set! (-> this knocked-anim) 12) + (set! (-> this knocked-recover-anim) 13) + ) + ) + (ja-channel-push! 1 0) + (let ((a1-3 (-> this draw art-group data (-> this knocked-anim))) + (a0-5 (-> this skel root-channel 0)) + ) + (set! (-> a0-5 frame-group) (the-as art-joint-anim a1-3)) + (set! (-> a0-5 param 0) (the float (+ (-> (the-as art-joint-anim a1-3) frames num-frames) -1))) + (set! (-> a0-5 param 1) (-> arg0 anim-speed)) + (set! (-> a0-5 frame-num) 0.0) + (joint-control-channel-group! a0-5 (the-as art-joint-anim a1-3) num-func-seek!) + ) + #t + ) + +;; definition for method 86 of type mh-wasp +(defmethod knocked-land-anim ((this mh-wasp) (arg0 enemy-knocked-info)) + (let ((v1-4 (-> this draw art-group data (-> this enemy-info knocked-land-anim))) + (a0-3 (-> this skel root-channel 0)) + ) + (set! (-> a0-3 frame-group) (the-as art-joint-anim v1-4)) + (set! (-> a0-3 param 0) (the float (+ (-> (the-as art-joint-anim v1-4) frames num-frames) -1))) + (set! (-> a0-3 param 1) (-> arg0 anim-speed)) + (set! (-> a0-3 frame-num) 0.0) + (joint-control-channel-group! a0-3 (the-as art-joint-anim v1-4) num-func-seek!) + ) + #t + ) + +;; definition for method 88 of type mh-wasp +(defmethod enemy-method-88 ((this mh-wasp) (arg0 enemy-knocked-info)) + (-> this root) + (>= (-> arg0 on-surface-count) 1) + ) + +;; definition for method 89 of type mh-wasp +(defmethod within-gspot-range? ((this mh-wasp)) + #f + ) + +;; definition for method 81 of type mh-wasp +(defmethod go-die ((this mh-wasp)) + (cond + ((and (-> this next-state) (= (-> this next-state name) 'knocked)) + (go (method-of-object this die-now)) + ) + ((-> this enemy-info use-die-falling) + (go (method-of-object this die-falling)) + ) + (else + (go (method-of-object this die)) + ) + ) + ) + +;; definition for method 180 of type mh-wasp +;; WARN: Return type mismatch int vs none. +(defmethod fire-shot ((this mh-wasp) (arg0 projectile-init-by-other-params) (arg1 int) (arg2 int) (arg3 float)) + (vector<-cspace! (-> arg0 pos) (-> this node-list data arg1)) + (let ((s3-1 + (quaternion-vector-angle! + (new 'stack-no-clear 'quaternion) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data arg1 bone transform uvec) 1.0) + (* 273.06668 arg3) + ) + ) + (a1-8 + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this node-list data arg1 bone transform fvec) 1.0) + ) + ) + (vector-orient-by-quat! (-> arg0 vel) a1-8 s3-1) + ) + (vector-normalize! (-> arg0 vel) 491520.0) + (spawn-projectile mh-wasp-shot arg0 this *default-dead-pool*) + 0 + (none) + ) + +;; definition for method 163 of type mh-wasp +;; WARN: Return type mismatch int vs none. +(defmethod hover-enemy-method-163 ((this mh-wasp)) + (let ((s4-0 (-> this main-joint-movement 1)) + (s5-0 (-> this main-joint-movement 2)) + (gp-0 + (lambda ((arg0 mh-wasp) (arg1 cspace) (arg2 float) (arg3 float) (arg4 vector) (arg5 vector) (arg6 int)) + (local-vars (sv-192 float) (sv-208 vector) (sv-224 vector)) + (set! sv-192 arg2) + (let ((s0-0 arg3)) + (set! sv-224 arg4) + (let ((s1-0 arg5) + (s3-0 arg6) + (s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) arg1)) + (s5-0 (new 'stack-no-clear 'matrix)) + (a1-3 (matrix-with-scale->quaternion (new 'stack-no-clear 'quaternion) (-> arg1 bone transform))) + ) + (set! sv-208 (new 'stack-no-clear 'vector)) + (let ((s2-1 (new 'stack-no-clear 'vector))) + (-> arg0 scale) + (quaternion-rotate-local-z! (the-as quaternion sv-208) a1-3 sv-192) + (quaternion->matrix s5-0 (the-as quaternion sv-208)) + (set! (-> s2-1 quad) (-> arg0 root scale quad)) + (scale-matrix! s5-0 s2-1 s5-0) + (let* ((s1-1 (vector-inv-orient-by-quat! (new 'stack-no-clear 'vector) s1-0 (-> arg0 root quat))) + (t9-6 vector-inv-orient-by-quat!) + (a0-10 (new 'stack-no-clear 'vector)) + (a2-4 (-> arg0 root quat)) + (v0-6 (t9-6 a0-10 sv-224 a2-4)) + (f30-0 (* 1638400.0 (seconds-per-frame))) + (f28-0 + (seek + (-> arg0 thrust s3-0) + (+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0))) + (fmax 0.0 (-> v0-6 y)) + (fabs (* 0.2 (-> v0-6 z))) + (fmax 0.0 (-> s1-1 y)) + ) + (* 0.2 f30-0) + ) + ) + ) + (let ((f20-0 (lerp-scale 819.2 4096.0 f28-0 1638.4 f30-0)) + (f26-0 (lerp-scale 4915.2 11468.8 f28-0 1638.4 f30-0)) + ) + (lerp-scale 0.0 -4915.2 f28-0 1638.4 f30-0) + (let ((f22-0 (lerp-scale 0.5 1.5 f28-0 1638.4 f30-0)) + (f24-0 (lerp-scale 0.1 1.0 f28-0 1638.4 f30-0)) + ) + (lerp-scale 0.1 1.0 f28-0 1638.4 f30-0) + (let ((f1-10 (lerp-scale 0.02 0.6 f28-0 1638.4 f30-0)) + (f2-6 (fmin 1.0 (-> s2-1 x))) + (f0-15 (fmin 1.0 (-> s2-1 y))) + ) + (set! (-> *part-id-table* 5029 init-specs 4 initial-valuef) (* f20-0 f2-6)) + (set! (-> *part-id-table* 5029 init-specs 5 initial-valuef) (* f26-0 f0-15)) + (set! (-> *part-id-table* 5033 init-specs 3 initial-valuef) (* f22-0 f2-6)) + (set! (-> *part-id-table* 5030 init-specs 1 initial-valuef) (* f24-0 f0-15)) + (set! (-> *part-id-table* 5031 init-specs 1 initial-valuef) (* f1-10 f0-15)) + (set! (-> *part-id-table* 5032 init-specs 0 initial-valuef) (* f24-0 f0-15)) + (set! (-> arg0 thrust s3-0) f28-0) + (let ((f0-16 (* f26-0 f0-15))) + (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 uvec) (* -0.5 f0-16)) + ) + ) + ) + ) + (set! (-> s5-0 trans quad) (-> s4-0 quad)) + (spawn-from-mat (-> arg0 engine-part) s5-0) + (let ((f0-18 (lerp-scale 0.75 1.0 f28-0 1638.4 f30-0))) + (sound-play-by-name + (static-sound-name "wasp-jets") + (-> arg0 sound-id) + (the int (* 1024.0 f0-18)) + 0 + 0 + (sound-group) + (-> arg0 root trans) + ) + ) + ) + ) + ) + ) + 0 + (none) + ) + ) + ) + (gp-0 + this + (-> this node-list data (-> this hover-info engine-left)) + (-> this hover-info thrust-rotate-left) + -1.0 + s5-0 + s4-0 + 0 + ) + (gp-0 + this + (-> this node-list data (-> this hover-info engine-right)) + (-> this hover-info thrust-rotate-right) + 1.0 + s5-0 + s4-0 + 1 + ) + ) + 0 + (none) + ) + +;; definition for method 120 of type mh-wasp +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this mh-wasp)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 10) 0))) + (set! (-> s5-0 total-prims) (the-as uint 11)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set! (-> s4-0 transform-index) 3) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 15564.8) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-14 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-14 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-14 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> v1-14 prim-core action) (collide-action solid)) + (set! (-> v1-14 transform-index) 0) + (set-vector! (-> v1-14 local-sphere) 0.0 5324.8 -2048.0 6144.0) + ) + (let ((v1-16 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-16 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-16 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> v1-16 prim-core action) (collide-action solid)) + (set! (-> v1-16 transform-index) 0) + (set-vector! (-> v1-16 local-sphere) 0.0 3276.8 -2048.0 4915.2) + ) + (let ((v1-18 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-18 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-18 prim-core collide-with) (collide-spec backgnd enemy obstacle hit-by-others-list)) + (set! (-> v1-18 prim-core action) (collide-action solid)) + (set! (-> v1-18 transform-index) 0) + (set-vector! (-> v1-18 local-sphere) 0.0 7372.8 -2048.0 4915.2) + ) + (let ((v1-20 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-20 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-20 prim-core action) (collide-action semi-solid)) + (set! (-> v1-20 transform-index) 3) + (set-vector! (-> v1-20 local-sphere) 0.0 0.0 1228.8 3481.6) + ) + (let ((v1-22 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-22 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-22 prim-core action) (collide-action semi-solid)) + (set! (-> v1-22 transform-index) 7) + (set-vector! (-> v1-22 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (let ((v1-24 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-24 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-24 prim-core action) (collide-action semi-solid)) + (set! (-> v1-24 transform-index) 9) + (set-vector! (-> v1-24 local-sphere) 0.0 1638.4 0.0 2048.0) + ) + (let ((v1-26 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-26 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-26 prim-core action) (collide-action semi-solid)) + (set! (-> v1-26 transform-index) 10) + (set-vector! (-> v1-26 local-sphere) -819.2 0.0 0.0 1638.4) + ) + (let ((v1-28 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-28 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-28 prim-core action) (collide-action semi-solid)) + (set! (-> v1-28 transform-index) 12) + (set-vector! (-> v1-28 local-sphere) 0.0 -1638.4 0.0 2048.0) + ) + (let ((v1-30 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-30 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-30 prim-core action) (collide-action semi-solid)) + (set! (-> v1-30 transform-index) 13) + (set-vector! (-> v1-30 local-sphere) 819.2 0.0 0.0 1638.4) + ) + (let ((v1-32 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-32 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-32 prim-core action) (collide-action semi-solid)) + (set! (-> v1-32 transform-index) 15) + (set-vector! (-> v1-32 local-sphere) 0.0 0.0 0.0 3072.0) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-35 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-35 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-35 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 10 of type mh-wasp +(defmethod deactivate ((this mh-wasp)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this engine-part)) + (kill-particles (-> this engine-part)) + ) + (sound-stop (-> this sound-id)) + ((method-of-type hover-enemy deactivate) this) + (none) + ) + +;; definition for method 7 of type mh-wasp +;; WARN: Return type mismatch hover-enemy vs mh-wasp. +(defmethod relocate ((this mh-wasp) (offset int)) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this engine-part)) + (&+! (-> this engine-part) offset) + ) + (the-as mh-wasp ((method-of-type hover-enemy relocate) this offset)) + ) + +;; definition for method 170 of type mh-wasp +;; WARN: Return type mismatch int vs none. +(defmethod hover-enemy-method-170 ((this mh-wasp)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-mh-wasp" (the-as (pointer level) #f))) + (the-as pair 0) + ) + 0 + (none) + ) + +;; definition for method 171 of type mh-wasp +(defmethod get-enemy-info ((this mh-wasp)) + *mh-wasp-enemy-info* + ) + +;; definition for method 172 of type mh-wasp +(defmethod get-hover-info ((this mh-wasp)) + (new 'static 'hover-enemy-info + :fly-forward-anim 7 + :fly-backward-anim 8 + :fly-left-anim 6 + :fly-right-anim 5 + :shoot-anim 9 + :main-joint 3 + :gun-base 15 + :engine-left 10 + :engine-right 13 + :thrust-rotate-left 16384.0 + :thrust-rotate-right -16384.0 + :hover-y-offset 26624.0 + :hover-xz-offset 61440.0 + :use-flying-death #f + :fly-x-anim-seek 1.3 + :fly-z-anim-seek 1.3 + ) + ) + +;; definition for method 173 of type mh-wasp +(defmethod get-hover-params ((this mh-wasp)) + (new 'static 'hover-nav-params + :max-speed 57344.0 + :max-acceleration 81920.0 + :max-rotation-rate 14563.556 + :friction 0.05 + ) + ) + +;; definition for method 121 of type mh-wasp +;; INFO: Used lq/sq +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this mh-wasp)) + (local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag) (sv-64 res-tag)) + (hover-enemy-method-170 this) + (init-enemy-defaults! this (get-enemy-info this)) + (hover-enemy-method-176 this) + (set! (-> this neck up) (the-as uint 1)) + (set! (-> this neck nose) (the-as uint 2)) + (set! (-> this neck ear) (the-as uint 0)) + (set! (-> this scale) (rnd-float-range this 0.9 1.3)) + (set! (-> this sound-id) (new-sound-id)) + (set! (-> this root dynam gravity y) 327680.0) + (set! (-> this root dynam gravity-length) 327680.0) + (set! (-> this root dynam gravity-max) 327680.0) + (init (-> this gun-jmod) this (the-as uint (-> this hover-info gun-base)) (joint-mod-base-flags attached)) + (set! (-> this gun-x-angle) 0.0) + (set! (-> this gun-x-angle-final) 0.0) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! sv-16 (new 'static 'res-tag)) + (let ((v1-29 (res-lump-data (-> this entity) 'actor-groups pointer :tag-ptr (& sv-16)))) + (if (and v1-29 (= (-> sv-16 elt-count) 1)) + (set! (-> this entity-group) (the-as actor-group (-> (the-as (pointer uint32) v1-29)))) + (set! (-> this entity-group) #f) + ) + ) + (set! sv-32 (new 'static 'res-tag)) + (let ((v1-33 (res-lump-data (-> this entity) 'timeout (pointer float) :tag-ptr (& sv-32)))) + (cond + ((and v1-33 (= (-> sv-32 elt-count) 2)) + (set! (-> this attack-wait-min) (-> v1-33 0)) + (set! (-> this attack-wait-max) (-> v1-33 1)) + ) + (else + (set! (-> this attack-wait-min) 1.0) + (set! (-> this attack-wait-max) 3.0) + ) + ) + ) + (let ((f30-0 4096.0)) + (set! sv-48 (new 'static 'res-tag)) + (let ((v1-40 (res-lump-data (-> this entity) 'min-max pointer :tag-ptr (& sv-48)))) + (set! (-> this attack-miss-dist-min) (* f30-0 (if (and v1-40 (> (the-as int (-> sv-48 elt-count)) 0)) + (-> (the-as (pointer float) v1-40)) + -1.0 + ) + ) + ) + ) + ) + (let ((f30-1 4096.0)) + (set! sv-64 (new 'static 'res-tag)) + (let ((v1-44 (res-lump-data (-> this entity) 'min-max (pointer float) :tag-ptr (& sv-64)))) + (set! (-> this attack-miss-dist-max) (* f30-1 (if (and v1-44 (< 1 (the-as int (-> sv-64 elt-count)))) + (-> v1-44 1) + 1.0 + ) + ) + ) + ) + ) + (set! (-> this path) (new 'process 'path-control this 'intro 0.0 (-> this entity) #f)) + (set! (-> this path-u) 0.0) + (logior! (-> this path flags) (path-control-flag display draw-line draw-point draw-text)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1527) this)) + (set! (-> this engine-part) (create-launch-control (-> *part-group-id-table* 1529) this)) + (add-connection + *part-engine* + this + 7 + this + 468 + (new 'static 'vector :x 1187.84 :y -3112.96 :z 1392.64 :w 163840.0) + ) + (add-connection + *part-engine* + this + 7 + this + 468 + (new 'static 'vector :x -1187.84 :y -3112.96 :z 1392.64 :w 163840.0) + ) + (add-connection *part-engine* this 7 this 2204 (new 'static 'vector :y 1433.6 :z 1228.8 :w 163840.0)) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc b/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc new file mode 100644 index 0000000000..9f8e8c7375 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/needle-fish_REF.gc @@ -0,0 +1,840 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defskelgroup skel-needle-fish needle-fish needle-fish-lod0-jg -1 + ((needle-fish-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 3) + ) + +;; failed to figure out what this is: +(defskelgroup skel-needle-fish-needle needle-fish needle-fish-needle-lod0-jg needle-fish-needle-idle-ja + ((needle-fish-needle-lod0-mg (meters 999999))) + :bounds (static-spherem 0 1 0 2) + ) + +;; definition of type needle-fish-shot +(deftype needle-fish-shot (projectile-bounce) + ((scale float) + ) + ) + +;; definition for method 3 of type needle-fish-shot +(defmethod inspect ((this needle-fish-shot)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type projectile-bounce inspect))) + (t9-0 this) + ) + (format #t "~2Tscale: ~f~%" (-> this scale)) + (label cfg-4) + this + ) + +;; definition for method 25 of type needle-fish-shot +;; WARN: Return type mismatch int vs none. +(defmethod projectile-method-25 ((this needle-fish-shot)) + (let ((f0-0 (-> this scale))) + (set-vector! (-> this root scale) f0-0 f0-0 f0-0 1.0) + ) + (seek! (-> this scale) 0.0 (seconds-per-frame)) + (ja-post) + 0 + (none) + ) + +;; definition for method 28 of type needle-fish-shot +;; WARN: Return type mismatch sound-id vs none. +(defmethod play-impact-sound ((this needle-fish-shot) (arg0 projectile-options)) + (with-pp + (case arg0 + (((projectile-options po0 po1)) + (when (nonzero? (-> this sound-id)) + (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) (-> this sound-id)) + (let ((a1-1 (-> this root trans))) + (let ((s5-1 pp)) + (when (= a1-1 #t) + (if (and s5-1 (type? s5-1 process-drawable) (nonzero? (-> (the-as process-drawable s5-1) root))) + (set! a1-1 (-> (the-as process-drawable s5-1) root trans)) + (set! a1-1 (the-as vector #f)) + ) + ) + ) + (sound-trans-convert (-> gp-0 params trans) a1-1) + ) + (set! (-> gp-0 params mask) (the-as uint 32)) + (-> gp-0 id) + ) + ) + ) + ) + ) + (none) + ) + ) + +;; definition for method 30 of type needle-fish-shot +;; WARN: Return type mismatch int vs none. +(defmethod setup-collision! ((this needle-fish-shot)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) + (the-as (function control-info collide-query vector vector collide-status) cshape-reaction-just-move) + ) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrate-using) (penetrate enemy-yellow-shot)) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 2) 0))) + (set! (-> s5-0 total-prims) (the-as uint 3)) + (set! (-> s4-0 prim-core collide-as) (collide-spec projectile)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> s4-0 prim-core action) (collide-action solid)) + (set-vector! (-> s4-0 local-sphere) 0.0 0.0 0.0 819.2) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-13 prim-core collide-with) + (collide-spec backgnd jak bot crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-13 prim-core action) (collide-action solid deadly)) + (set-vector! (-> v1-13 local-sphere) 0.0 0.0 0.0 819.2) + ) + (let ((v1-15 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-15 prim-core collide-as) (collide-spec projectile)) + (set! (-> v1-15 prim-core collide-with) + (collide-spec jak bot crate civilian enemy vehicle-sphere hit-by-others-list player-list) + ) + (set! (-> v1-15 prim-core action) (collide-action deadly)) + (set-vector! (-> v1-15 local-sphere) 0.0 0.0 0.0 2457.6) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-18 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-18 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-18 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 1)) + (set! (-> s5-0 event-self) 'touched) + (set! (-> this root) s5-0) + ) + (set! (-> this root pat-ignore-mask) + (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noproj #x1 :noendlessfall #x1 :board #x1) + ) + (none) + ) + +;; definition for method 31 of type needle-fish-shot +;; WARN: Return type mismatch float vs none. +(defmethod init-proj-settings! ((this needle-fish-shot)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-needle-fish-needle" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (let ((t9-2 (method-of-type projectile-bounce init-proj-settings!))) + (t9-2 this) + ) + (let ((a1-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> this root transv) 1.0))) + (forward-up->quaternion (-> this root quat) a1-3 *y-vector*) + ) + (set! (-> this attack-mode) 'needle-fish-shot) + (set! (-> this max-speed) 163840.0) + (set-gravity-length (-> this root dynam) 245760.0) + (set! (-> this scale) 1.0) + (none) + ) + +;; definition for function spawn-needle-fish-projectile +;; INFO: Used lq/sq +;; WARN: Return type mismatch (pointer process) vs (pointer needle-fish-shot). +(defun spawn-needle-fish-projectile ((arg0 needle-fish) (arg1 vector) (arg2 vector) (arg3 float)) + (let ((s5-0 (new 'stack-no-clear 'projectile-init-by-other-params))) + (let ((a1-2 (vector-normalize-copy! (new 'stack-no-clear 'vector) arg2 arg3))) + (set! (-> s5-0 ent) (-> arg0 entity)) + (set! (-> s5-0 charge) 1.0) + (set! (-> s5-0 options) (projectile-options)) + (logclear! (-> s5-0 options) (projectile-options po14 po15 po16)) + (set! (-> s5-0 notify-handle) (process->handle arg0)) + (set! (-> s5-0 owner-handle) (the-as handle #f)) + (set! (-> s5-0 target-handle) (the-as handle #f)) + (set! (-> s5-0 target-pos quad) (the-as uint128 0)) + (set! (-> s5-0 ignore-handle) (process->handle arg0)) + (let* ((v1-11 *game-info*) + (a0-12 (+ (-> v1-11 attack-id) 1)) + ) + (set! (-> v1-11 attack-id) a0-12) + (set! (-> s5-0 attack-id) a0-12) + ) + (set! (-> s5-0 timeout) (seconds 4)) + (set! (-> s5-0 pos quad) (-> arg1 quad)) + (vector-normalize-copy! (-> s5-0 vel) a1-2 arg3) + ) + (the-as (pointer needle-fish-shot) (spawn-projectile needle-fish-shot s5-0 arg0 *default-dead-pool*)) + ) + ) + +;; definition of type needle-fish-chain-physics +(deftype needle-fish-chain-physics (chain-physics) + () + ) + +;; definition for method 3 of type needle-fish-chain-physics +(defmethod inspect ((this needle-fish-chain-physics)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tchain-joints[20] @ #x~X~%" (-> this chain-joints)) + (format #t "~1Tnum-joints: ~D~%" (-> this num-joints)) + (format #t "~1Troot-joint-index: ~D~%" (-> this root-joint-index)) + (format #t "~1Tjoint-length: ~f~%" (-> this joint-length)) + (format #t "~1Tgravity: #~%" (-> this gravity)) + (format #t "~1Tgravity-target: #~%" (-> this gravity-target)) + (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 "~1Tnegate-y: ~A~%" (-> this negate-y)) + (format #t "~1Taxial-slop: ~f~%" (-> this axial-slop)) + (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)) + (label cfg-4) + this + ) + +;; definition for method 13 of type needle-fish-chain-physics +;; WARN: Return type mismatch int vs none. +(defmethod apply-gravity ((this needle-fish-chain-physics) (arg0 vector) (arg1 int) (arg2 process-drawable)) + (with-pp + (vector-float*! + arg0 + (-> this gravity) + (* 4096.0 (-> pp clock time-adjust-ratio) (lerp-scale 0.01 0.1 (the float arg1) 0.0 5.0)) + ) + (vector+float*! arg0 arg0 (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* arg1 64))) 0.2) + 0 + (none) + ) + ) + +;; definition for method 14 of type needle-fish-chain-physics +;; WARN: Return type mismatch int vs none. +(defmethod chain-physics-method-14 ((this needle-fish-chain-physics) (arg0 vector) (arg1 int)) + (vector-float*! + arg0 + (the-as vector (+ (the-as uint (-> this chain-joints 0 velocity)) (* (+ arg1 1) 64))) + (lerp-scale 0.4 0.9 (the float arg1) 0.0 4.0) + ) + 0 + (none) + ) + +;; definition for method 16 of type needle-fish-chain-physics +(defmethod chain-physics-method-16 ((this needle-fish-chain-physics) (arg0 int)) + (if (zero? arg0) + 0.0 + 5461.3335 + ) + ) + +;; definition for symbol *needle-fish-spike-tbl*, type (array int32) +(define *needle-fish-spike-tbl* + (new 'static 'boxed-array :type int32 22 31 30 9 20 32 19 16 41 36 34 42 8 21 38 33 37 40 18 17 43 35) + ) + +;; definition for symbol *needle-fish-chain-setup*, type (array chain-physics-setup) +(define *needle-fish-chain-setup* (new 'static 'boxed-array :type chain-physics-setup + (new 'static 'chain-physics-setup :joint-index 26) + (new 'static 'chain-physics-setup :joint-index 27) + (new 'static 'chain-physics-setup :joint-index 28) + (new 'static 'chain-physics-setup :joint-index 29) + ) + ) + +;; definition of type needle-fish +(deftype needle-fish (nav-enemy) + ((scared-timer time-frame) + (tail needle-fish-chain-physics) + (tail-initialized symbol) + (tail-clock float) + (tail-blend float) + ) + (:state-methods + attack + explode + ) + ) + +;; definition for method 3 of type needle-fish +(defmethod inspect ((this needle-fish)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type nav-enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tscared-timer: ~D~%" (-> this scared-timer)) + (format #t "~2Ttail: ~A~%" (-> this tail)) + (format #t "~2Ttail-initialized: ~A~%" (-> this tail-initialized)) + (format #t "~2Ttail-clock: ~f~%" (-> this tail-clock)) + (format #t "~2Ttail-blend: ~f~%" (-> this tail-blend)) + (label cfg-4) + this + ) + +;; definition for symbol *fact-info-needle-fish-defaults*, type fact-info-enemy-defaults +(define *fact-info-needle-fish-defaults* (new 'static 'fact-info-enemy-defaults :idle-distance (meters 80))) + +;; definition for symbol *needle-fish-nav-enemy-info*, type nav-enemy-info +(define *needle-fish-nav-enemy-info* + (new 'static 'nav-enemy-info + :use-die-falling #t + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 3 + (new 'static 'idle-control-frame :command (idle-control-cmd push) :param0 30) + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x2 + :param0 5 + :param1 5 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 2 + :notice-anim 3 + :hostile-anim 4 + :hit-anim 3 + :knocked-anim 3 + :knocked-land-anim 3 + :die-anim 3 + :die-falling-anim 3 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint 6 + :look-at-joint 6 + :bullseye-joint 4 + :sound-hit (static-sound-name "needle-fish-hit") + :sound-die (static-sound-name "needle-fish-die") + :notice-distance (meters 20) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 5) + :default-hit-points 1.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :penetrate-knocked (penetrate + touch + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + vehicle + flut-attack + board + mech + mech-punch + mech-bonk + dark-skin + dark-punch + dark-bomb + dark-smack + flut + shield + explode + jak-yellow-shot + jak-red-shot + jak-blue-shot + jak-dark-shot + enemy-yellow-shot + enemy-dark-shot + eco-yellow + eco-red + eco-blue + eco-green + knocked + jak-red-shockwave + jak-dark-nuke + jak-dark-blackhole + emp-blast + penetrate38 + penetrate39 + penetrate40 + penetrate41 + penetrate42 + penetrate43 + penetrate44 + penetrate45 + penetrate46 + penetrate47 + penetrate48 + penetrate49 + penetrate50 + penetrate51 + penetrate52 + penetrate53 + penetrate54 + penetrate55 + penetrate56 + penetrate57 + penetrate58 + penetrate59 + penetrate60 + penetrate61 + penetrate64 + penetrate63 + ) + :movement-gravity (meters -100) + :friction 0.96 + :attack-shove-back (meters 5) + :attack-shove-up (meters 3) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.5) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 364.0889 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 2) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + :callback-info #f + :use-momentum #f + :use-frustration #f + :use-stop-chase #f + :use-circling #f + :use-pacing #f + :walk-anim 3 + :turn-anim -1 + :run-anim 3 + :taunt-anim -1 + :run-travel-speed (meters 4) + :run-acceleration (meters 0.1) + :run-turning-acceleration (meters 20) + :walk-travel-speed (meters 2) + :walk-acceleration (meters 6) + :walk-turning-acceleration (meters 2) + :maximum-rotation-rate (degrees 360) + :notice-nav-radius (meters 2) + :frustration-distance (meters 8) + :frustration-time (seconds 4) + :blocked-time (seconds 0.3) + :circle-dist-lo 20480.0 + :circle-dist-hi 61440.0 + :nav-mesh #f + ) + ) + +;; failed to figure out what this is: +(set! (-> *needle-fish-nav-enemy-info* fact-defaults) *fact-info-needle-fish-defaults*) + +;; definition for method 120 of type needle-fish +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this needle-fish)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((s4-0 (new 'process 'collide-shape-prim-group s5-0 (the-as uint 1) 0))) + (set! (-> s5-0 total-prims) (the-as uint 2)) + (set! (-> s4-0 prim-core collide-as) (collide-spec enemy)) + (set! (-> s4-0 prim-core collide-with) + (collide-spec backgnd jak bot crate obstacle hit-by-others-list player-list pusher) + ) + (set! (-> s4-0 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> s4-0 local-sphere) 0.0 4096.0 0.0 6144.0) + (set! (-> s5-0 root-prim) s4-0) + ) + (let ((v1-13 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-13 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-13 prim-core collide-with) (collide-spec backgnd obstacle hit-by-others-list pusher)) + (set! (-> v1-13 prim-core action) (collide-action solid deadly no-standon)) + (set-vector! (-> v1-13 local-sphere) 0.0 4096.0 0.0 5734.4) + ) + (set! (-> s5-0 nav-radius) 8192.0) + (let ((v1-15 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-15 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-15 prim-core collide-with)) + ) + (set! (-> s5-0 max-iteration-count) (the-as uint 3)) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for function needle-fish-joint-mod-tail +(defun needle-fish-joint-mod-tail ((arg0 cspace) (arg1 transformq)) + (let* ((s4-0 (-> arg0 param1)) + (f0-0 4.0) + (t9-0 sin) + (f1-0 65536.0) + (f2-0 (-> (the-as needle-fish s4-0) tail-clock)) + (f0-3 (t9-0 (* f1-0 (/ (- f2-0 (* (the float (the int (/ f2-0 f0-0))) f0-0)) f0-0)))) + (f0-4 (* 4551.1113 f0-3)) + (s3-0 (new 'stack-no-clear 'quaternion)) + ) + (let ((a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) *z-vector* f0-4))) + (quaternion-normalize! (quaternion*! s3-0 (-> arg1 quat) a2-1)) + ) + (quaternion-slerp! (-> arg1 quat) (-> arg1 quat) s3-0 (-> (the-as needle-fish s4-0) tail-blend)) + ) + (cspace<-parented-transformq-joint! arg0 arg1) + (none) + ) + +;; failed to figure out what this is: +(defstate active (needle-fish) + :virtual #t + :post nav-enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate notice (needle-fish) + :virtual #t + :enter (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy notice) enter))) + (if t9-0 + (t9-0) + ) + ) + (go-virtual hostile) + ) + ) + +;; failed to figure out what this is: +(defstate stare (needle-fish) + :virtual #t + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (until #f + (ja-no-eval :group! needle-fish-swim0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + ) + +;; failed to figure out what this is: +(defstate hostile (needle-fish) + :virtual #t + :trans (behavior () + (let ((t9-0 (-> (method-of-type nav-enemy hostile) trans))) + (if t9-0 + (t9-0) + ) + ) + (when (time-elapsed? (-> self state-time) (seconds 0.1)) + (cond + ((and (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 81920.0) (get-focus! self)) + (go-virtual attack) + ) + ((< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 24576.0) + (go-stare self) + ) + ) + ) + ) + :post (behavior () + (let ((v1-0 (new 'stack-no-clear 'vector)) + (a0-0 (-> self focus-pos)) + ) + (vector-! v1-0 (-> self root trans) a0-0) + (let ((f0-0 (vector-length v1-0)) + (f1-0 16384.0) + ) + (when (< f1-0 f0-0) + (vector-float*! v1-0 v1-0 (/ (+ -4096.0 f1-0) f0-0)) + (vector+! v1-0 a0-0 v1-0) + (let ((a0-2 (-> self nav state))) + (logclear! (-> a0-2 flags) (nav-state-flag directional-mode)) + (logior! (-> a0-2 flags) (nav-state-flag target-poly-dirty)) + (set! (-> a0-2 target-pos quad) (-> v1-0 quad)) + ) + 0 + ) + ) + ) + (nav-enemy-method-187 self) + ) + ) + +;; failed to figure out what this is: +(defstate attack (needle-fish) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (logior! (-> self focus-status) (focus-status dangerous)) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (logclear! (-> self focus-status) (focus-status dangerous)) + ) + :trans (behavior () + (when (time-elapsed? (-> self state-time) (-> self reaction-time)) + (let ((v1-3 (-> self focus aware))) + (if (or (>= 2 (the-as int v1-3)) (= v1-3 (enemy-aware ea4)) (not (get-focus! self))) + (go-stare self) + ) + ) + (if (< (vector-vector-xz-distance (-> self root trans) (-> self focus-pos)) 12288.0) + (go-virtual explode) + ) + ) + ) + :code (behavior () + (ja-channel-push! 1 (seconds 0.1)) + (ja-no-eval :group! needle-fish-spikes0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + (until #f + (ja-no-eval :group! needle-fish-swim-spikes0-ja :num! (seek!) :frame-num 0.0) + (until (ja-done? 0) + (suspend) + (ja :num! (seek!)) + ) + ) + #f + ) + :post (behavior () + (nav-enemy-chase-post) + ) + ) + +;; failed to figure out what this is: +(defstate explode (needle-fish) + :virtual #t + :enter (behavior () + (let ((v1-1 (-> self root root-prim))) + (set! (-> v1-1 prim-core collide-as) (collide-spec)) + (set! (-> v1-1 prim-core collide-with) (collide-spec)) + ) + 0 + (logior! (-> self draw status) (draw-control-status no-draw)) + (sound-play "nfish-explode") + (dotimes (gp-1 (-> *needle-fish-spike-tbl* length)) + (let* ((a1-1 (-> self node-list data (-> *needle-fish-spike-tbl* gp-1))) + (s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) a1-1)) + (s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> self root trans))) + ) + (vector-normalize! s4-1 1.0) + (spawn-needle-fish-projectile self s5-1 s4-1 163840.0) + ) + ) + (let ((gp-2 (new 'stack-no-clear 'explosion-init-params))) + (set! (-> gp-2 spawn-point quad) (-> self root trans quad)) + (quaternion-identity! (-> gp-2 spawn-quat)) + (set! (-> gp-2 radius) 20480.0) + (set! (-> gp-2 scale) 1.0) + (set! (-> gp-2 group) (-> *part-group-id-table* 221)) + (set! (-> gp-2 collide-with) + (collide-spec backgnd jak crate civilian enemy obstacle vehicle-sphere hit-by-others-list player-list pusher) + ) + (set! (-> gp-2 damage) 2.0) + (set! (-> gp-2 damage-scale) 1.0) + (set! (-> gp-2 vehicle-damage-factor) 1.0) + (set! (-> gp-2 vehicle-impulse-factor) 1.0) + (set! (-> gp-2 ignore-proc) (process->handle #f)) + (explosion-spawn gp-2 (the-as process-drawable *default-pool*)) + ) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 108 of type needle-fish +(defmethod enemy-method-108 ((this needle-fish) (arg0 process-focusable)) + (< (current-time) (-> this scared-timer)) + ) + +;; definition for method 75 of type needle-fish +(defmethod go-stare ((this needle-fish)) + (set! (-> this scared-timer) (+ (current-time) (the int (* 300.0 (rnd-float-range this 2.0 4.0))))) + (go-flee this) + ) + +;; definition for method 82 of type needle-fish +(defmethod event-handler ((this needle-fish) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit 'hit-flinch 'hit-knocked) + (go (method-of-object this explode)) + ) + (else + ((method-of-type nav-enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; definition for method 84 of type needle-fish +(defmethod send-attack-on-jump-or-knocked ((this needle-fish) (arg0 process) (arg1 event-message-block)) + (if (= arg0 *target*) + (go (method-of-object this explode)) + ((method-of-type nav-enemy send-attack-on-jump-or-knocked) this arg0 arg1) + ) + ) + +;; definition for method 59 of type needle-fish +;; INFO: Used lq/sq +(defmethod enemy-common-post ((this needle-fish)) + (when (not (-> this tail-initialized)) + (set! (-> this tail-initialized) #t) + (initialize-chain-joints (-> this tail)) + ) + (update (-> this tail) this) + (let ((a0-4 (handle->process (-> this focus handle)))) + (if a0-4 + (set! (-> this focus-pos quad) (-> (get-trans (the-as process-focusable a0-4) 3) quad)) + ) + ) + (+! (-> this tail-clock) + (* (lerp-scale 1.0 10.0 (vector-length (-> this root transv)) 0.0 16384.0) (seconds-per-frame)) + ) + ((method-of-type nav-enemy enemy-common-post) this) + (none) + ) + +;; definition for method 7 of type needle-fish +;; WARN: Return type mismatch nav-enemy vs needle-fish. +(defmethod relocate ((this needle-fish) (offset int)) + (if (nonzero? (-> this tail)) + (&+! (-> this tail) offset) + ) + (the-as needle-fish ((method-of-type nav-enemy relocate) this offset)) + ) + +;; definition for method 121 of type needle-fish +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this needle-fish)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-needle-fish" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *needle-fish-nav-enemy-info*) + (set! (-> this tail) (new 'process 'needle-fish-chain-physics)) + (chain-physics-initialize this (-> this tail) 25 1638.4 *needle-fish-chain-setup*) + (set! (-> this tail-initialized) #f) + (set! (-> this tail-clock) 0.0) + (set! (-> this tail-blend) 1.0) + (let ((a0-6 (-> this node-list data 25))) + (set! (-> a0-6 param0) needle-fish-joint-mod-tail) + (set! (-> a0-6 param1) this) + ) + (set-vector! (-> this root scale) 1.0 0.5 1.0 1.0) + (set! (-> this scared-timer) 0) + (setup-masks (-> this draw) 3 0) + 0 + (none) + ) + +;; definition of type sew-needle-fish +(deftype sew-needle-fish (needle-fish) + () + ) + +;; definition for method 3 of type sew-needle-fish +(defmethod inspect ((this sew-needle-fish)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type needle-fish inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +0 + + + + diff --git a/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc new file mode 100644 index 0000000000..4173b60447 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/sewer/sew-laser-turret_REF.gc @@ -0,0 +1,1319 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type gun-turret-params +(deftype gun-turret-params (structure) + ((normal-sg skeleton-group) + (explode-sg skeleton-group) + (enemy-info enemy-info) + (idle-anim int32) + (shoot-anim int32) + (track-joint int32) + (barrel-joint int32) + (gun-joint int32) + (hole-joints int32 8) + ) + ) + +;; definition for method 3 of type gun-turret-params +;; INFO: this function exists in multiple non-identical object files +(defmethod inspect ((this gun-turret-params)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'gun-turret-params) + (format #t "~1Tnormal-sg: ~A~%" (-> this normal-sg)) + (format #t "~1Texplode-sg: ~A~%" (-> this explode-sg)) + (format #t "~1Tenemy-info: ~A~%" (-> this enemy-info)) + (format #t "~1Tidle-anim: ~D~%" (-> this idle-anim)) + (format #t "~1Tshoot-anim: ~D~%" (-> this shoot-anim)) + (format #t "~1Ttrack-joint: ~D~%" (-> this track-joint)) + (format #t "~1Tbarrel-joint: ~D~%" (-> this barrel-joint)) + (format #t "~1Tgun-joint: ~D~%" (-> this gun-joint)) + (format #t "~1Thole-joints[8] @ #x~X~%" (-> this hole-joints)) + (label cfg-4) + this + ) + +;; definition of type sew-laser-turret +(deftype sew-laser-turret (enemy) + ((params gun-turret-params) + (aim-pos vector :inline) + (smoke-part sparticle-launch-control) + (casing-part sparticle-launch-control) + (flash-state symbol) + (can-shoot symbol) + (last-active-time time-frame) + (target-distance float) + (target-on-ground symbol) + (was-hit symbol) + (awareness-radius float) + (ring-rate time-frame) + (max-num-rings int32) + (last-spawn-index int32) + (spin-sound-id sound-id) + (last-play-time time-frame) + (strip prim-strip) + ) + (:state-methods + alert + spinning-up + spinning-down + turn-off + ) + (:methods + (start-firing (_type_ symbol int) none) + (sew-laser-turret-method-160 (_type_) none) + (generate-prim-verts! (_type_ float float) none) + (check-suitable-focus (_type_) symbol) + (sew-laser-turret-method-163 (_type_) none) + ) + ) + +;; definition for method 3 of type sew-laser-turret +(defmethod inspect ((this sew-laser-turret)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type enemy inspect))) + (t9-0 this) + ) + (format #t "~2Tparams: #~%" (-> this params)) + (format #t "~2Taim-pos: #~%" (-> this aim-pos)) + (format #t "~2Tsmoke-part: ~A~%" (-> this smoke-part)) + (format #t "~2Tcasing-part: ~A~%" (-> this casing-part)) + (format #t "~2Tflash-state: ~A~%" (-> this flash-state)) + (format #t "~2Tcan-shoot: ~A~%" (-> this can-shoot)) + (format #t "~2Tlast-active-time: ~D~%" (-> this last-active-time)) + (format #t "~2Ttarget-distance: ~f~%" (-> this target-distance)) + (format #t "~2Ttarget-on-ground: ~A~%" (-> this target-on-ground)) + (format #t "~2Twas-hit: ~A~%" (-> this was-hit)) + (format #t "~2Tawareness-radius: ~f~%" (-> this awareness-radius)) + (format #t "~2Tring-rate: ~D~%" (-> this ring-rate)) + (format #t "~2Tmax-num-rings: ~D~%" (-> this max-num-rings)) + (format #t "~2Tlast-spawn-index: ~D~%" (-> this last-spawn-index)) + (format #t "~2Tspin-sound-id: ~D~%" (-> this spin-sound-id)) + (format #t "~2Tlast-play-time: ~D~%" (-> this last-play-time)) + (format #t "~2Tstrip: ~A~%" (-> this strip)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-laser-turret-hit + :id 1518 + :duration (seconds 0.5) + :linger-duration (seconds 1) + :flags (sp0) + :bounds (static-bspherem 0 0 0 15) + :parts ((sp-item 4757 :period (seconds 5) :length (seconds 0.085) :offset -10) + (sp-item 4758 :fade-after (meters 60) :period (seconds 5) :length (seconds 0.1)) + (sp-item 4759 :fade-after (meters 60) :falloff-to (meters 60) :period (seconds 5) :length (seconds 0.335)) + (sp-item 4760 :fade-after (meters 200) :falloff-to (meters 200) :period (seconds 5) :length (seconds 0.167)) + (sp-item 4761 :period (seconds 5) :length (seconds 0.017) :offset -10) + (sp-item 4762 :fade-after (meters 150) :falloff-to (meters 150) :period (seconds 5) :length (seconds 0.167)) + ) + ) + +;; failed to figure out what this is: +(defpart 4760 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0) (degrees 360) :store) + (:scale-y (meters 0.8) (meters 0.2)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 32.0 32.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a -0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 4962) + (:conerot-x '*sp-temp*) + ) + ) + +;; failed to figure out what this is: +(defpart 4762 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 1.0 1.0) + (:scale-x (meters 1) (meters 1)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 0.0) + (:vel-y (meters 0.02) (meters 0.01)) + (:scalevel-x (meters 0.01) (meters 0.13333334)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.36) + (:fade-b -4.24) + (:fade-a 0.22068965) + (:friction 0.95) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.085) (seconds 0.015)) + (:next-launcher 4962) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4962 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:next-time (seconds 0.017) (seconds 0.065)) (:next-launcher 4963)) + ) + +;; failed to figure out what this is: +(defpart 4963 + :init-specs ((:scalevel-x (meters 0.016666668) (meters 0.016666668)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.44) + (:fade-g -2.36) + (:fade-b -2.64) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4964) + ) + ) + +;; failed to figure out what this is: +(defpart 4964 + :init-specs ((:scalevel-x (meters 0.008333334) (meters 0.008333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -1.2944444) + (:fade-g -0.7111111) + (:fade-b -0.094444446) + (:fade-a -0.06545454 -0.06545454) + (:next-time (seconds 0.5) (seconds 0.097)) + (:next-launcher 4965) + ) + ) + +;; failed to figure out what this is: +(defpart 4965 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0)) + ) + +;; failed to figure out what this is: +(defpart 4761 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 96.0) + (:scalevel-x (meters 0.5)) + (:rotvel-z (degrees 0.3)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -1.28) + (:fade-b -5.1) + (:fade-a 0.0) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.167)) + (:next-launcher 4966) + ) + ) + +;; failed to figure out what this is: +(defpart 4966 + :init-specs ((:scalevel-x (meters -0.2)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -2.56) + (:fade-b 0.0) + (:fade-a -1.92) + ) + ) + +;; failed to figure out what this is: +(defpart 4759 + :init-specs ((:texture (specs level-default-sprite)) + (:num 5.0 3.0) + (:x (meters 0.25)) + (:scale-x (meters 1) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 16.0 48.0) + (:vel-y (meters 0.083333336) (meters 0.083333336)) + (:scalevel-x (meters 0.006666667) (meters 0.0016666667)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g -0.18) + (:fade-b -2.12) + (:accel-y (meters -0.00016666666) (meters -0.00033333333)) + (:friction 0.87) + (:timer (seconds 3.335)) + (:flags (sp-cpuinfo-flag-2)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4967) + (:conerot-x (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4967 + :init-specs ((:scalevel-x (meters 0.0016666667)) + (:scalevel-y :copy scalevel-x) + (:fade-r 0.0) + (:fade-g 0.02) + (:fade-b 0.23555556) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4968) + ) + ) + +;; failed to figure out what this is: +(defpart 4968 + :init-specs ((:fade-r -0.5543478) (:fade-g -0.5543478) (:fade-a -0.13913043)) + ) + +;; failed to figure out what this is: +(defpart 4757 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0 1.0) + (:x (meters 0) (meters 0.6)) + (:scale-x (meters 2) (meters 1.5)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 70.0 20.0) + (:g 70.0 20.0) + (:b 70.0 20.0) + (:a 0.0 40.0) + (:vel-y (meters 0) (meters 0.1)) + (:scalevel-x (meters 0.033333335) (meters 0.016666668)) + (:rotvel-z (degrees -0.12) (degrees 0.24)) + (:scalevel-y :copy scalevel-x) + (:fade-r 3.3) + (:fade-g 3.12) + (:fade-b 1.18) + (:fade-a 1.76) + (:friction 0.88) + (:timer (seconds 2.367)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:next-time (seconds 0.117) (seconds 0.047)) + (:next-launcher 4969) + (:conerot-x (degrees 0) (degrees 360)) + (:conerot-y (degrees 0) (degrees 360)) + ) + ) + +;; failed to figure out what this is: +(defpart 4969 + :init-specs ((:scalevel-x (meters 0.0033333334)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.53333336) + (:fade-g -1.9666667) + (:fade-b -2.2) + (:fade-a -0.41666666) + (:next-time (seconds 0.15) (seconds 0.047)) + (:next-launcher 4970) + ) + ) + +;; failed to figure out what this is: +(defpart 4970 + :init-specs ((:scalevel-x (meters 0)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.38833332) + (:fade-g -0.21333334) + (:fade-b -0.028333334) + (:fade-a -0.38833332) + ) + ) + +;; failed to figure out what this is: +(defpart 4758 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 4.0 2.0) + (:scale-x (meters 0.1) (meters 0.25)) + (:rot-x 4) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y (meters 0.2) (meters 0.1)) + (:r 128.0 128.0) + (:g 96.0) + (:b 64.0) + (:a 64.0 64.0) + (:scalevel-x (meters 0.13333334) (meters 0.02)) + (:fade-g 1.6) + (:fade-b 3.2) + (:fade-a -1.6) + (:timer (seconds 0.267)) + (:flags (sp-cpuinfo-flag-2)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-laser-turret-smoke + :id 1519 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4971 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 4971 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 0.5) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0 64.0) + (:g :copy r) + (:b :copy g) + (:a 16.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.026666667 -0.10666667) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-sew-laser-turret-casing + :id 1520 + :duration (seconds 0.017) + :flags (sp0) + :bounds (static-bspherem 0 0 0 8) + :parts ((sp-item 4972 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + (sp-item 4973 :fade-after (meters 80) :falloff-to (meters 100) :flags (sp7)) + ) + ) + +;; failed to figure out what this is: +(defpart 4973 + :init-specs ((:texture (bigpuff level-default-sprite)) + (:num 3.0) + (:scale-x (meters 0.5) (meters 0.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 0.0) + (:a 32.0) + (:vel-z (meters 0.006666667) (meters 0.006666667)) + (:scalevel-x (meters 0.0033333334) (meters 0.004)) + (:rotvel-z (degrees -0.3) (degrees 0.6)) + (:scalevel-y :copy scalevel-x) + (:fade-r -2.56) + (:fade-g -2.56) + (:fade-b 2.56) + (:fade-a -0.32) + (:accel-y (meters 0.0001) (meters 0.000033333334)) + (:friction 0.98) + (:timer (seconds 2)) + (:flags (sp-cpuinfo-flag-2)) + (:userdata :data (new 'static 'boxed-array :type int32 40 1 0 #x400000 #x400000 #x400700)) + (:next-time (seconds 0.167)) + (:next-launcher 4974) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4974 + :init-specs ((:fade-r 0.0) (:fade-g 0.0) (:fade-b 0.0) (:fade-a -0.026666667 -0.10666667)) + ) + +;; failed to figure out what this is: +(defpart 4972 + :init-specs ((:texture (motion-blur-part level-default-sprite)) + (:num 1.0) + (:z (meters -0.4)) + (:scale-x (meters 2.5)) + (:rot-x 4) + (:scale-y (meters 0.15) (meters 0.02)) + (:r 255.0) + (:g 255.0) + (:b 255.0) + (:a 64.0 32.0) + (:omega (degrees 0.03375)) + (:vel-z (meters 0.033333335) (meters 0.06666667)) + (:fade-b -8.0) + (:accel-y (meters -0.0016666667) (meters -0.0016666667)) + (:friction 0.9 0.04) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'sparticle-motion-blur) + (:next-time (seconds 0.05)) + (:next-launcher 4975) + (:conerot-x (degrees -20) (degrees 40)) + (:conerot-z (degrees 0) (degrees 360)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 4975 + :init-specs ((:r 255.0) (:g 255.0) (:b 0.0) (:fade-r 0.0) (:fade-g -2.45) (:fade-a -0.384 -0.96)) + ) + +;; failed to figure out what this is: +(defskelgroup skel-sew-laser-turret sew-laser-turret sew-laser-turret-lod0-jg sew-laser-turret-idle-ja + ((sew-laser-turret-lod0-mg (meters 999999))) + :bounds (static-spherem 0 0 0 5) + ) + +;; definition for symbol *sew-laser-turret-enemy-info*, type enemy-info +(define *sew-laser-turret-enemy-info* + (new 'static 'enemy-info + :use-die-falling #f + :use-victory #f + :use-jump-blocked #f + :debug-draw-neck #f + :jump-debug-draw #f + :move-to-ground #f + :hover-if-no-ground #f + :idle-anim-script (new 'static 'inline-array idle-control-frame 2 + (new 'static 'idle-control-frame + :command (idle-control-cmd play) + :anim #x3 + :param0 1 + :param1 1 + :param2 '((new 'static 'bfloat :data 1.0) (new 'static 'bfloat :data 1.0)) + ) + (new 'static 'idle-control-frame) + ) + :idle-anim 3 + :notice-anim 3 + :hostile-anim 3 + :hit-anim 3 + :knocked-anim -1 + :knocked-land-anim -1 + :die-anim 3 + :die-falling-anim -1 + :victory-anim -1 + :jump-wind-up-anim -1 + :jump-in-air-anim -1 + :jump-land-anim -1 + :neck-joint -1 + :notice-distance (meters 150) + :notice-distance-delta (meters 10) + :proximity-notice-distance (meters 150) + :default-hit-points 10.0 + :gnd-collide-with (collide-spec backgnd) + :overlaps-others-collide-with-filter (collide-spec jak bot player-list) + :movement-gravity (meters -100) + :friction 0.8 + :attack-shove-back (meters 3) + :attack-shove-up (meters 2) + :attack-mode 'generic + :attack-damage 2 + :recover-gnd-collide-with (collide-spec backgnd crate obstacle hit-by-others-list pusher) + :knocked-can-land-timeout (seconds 0.1) + :knocked-recover-timeout (seconds 2) + :ragdoll-blend-out-time (seconds 0.25) + :ragdoll-rotate-velocity-mult 1.0 + :jump-height-min (meters 3) + :jump-height-factor 0.5 + :knocked-seek-ry-clamp 2730.6667 + :knocked-soft-vxz-lo 72089.6 + :knocked-soft-vxz-hi 108134.4 + :knocked-soft-vy-lo 81920.0 + :knocked-soft-vy-hi 122880.0 + :knocked-medium-vxz-lo 147456.0 + :knocked-medium-vxz-hi 196608.0 + :knocked-medium-vy-lo 135168.0 + :knocked-medium-vy-hi 151552.0 + :knocked-hard-vxz-lo 78643.2 + :knocked-hard-vxz-hi 117964.8 + :knocked-hard-vy-lo 183500.8 + :knocked-hard-vy-hi 209715.2 + :knocked-huge-vxz-lo 164659.2 + :knocked-huge-vxz-hi 249036.8 + :knocked-huge-vy-lo 183500.8 + :knocked-huge-vy-hi 217907.2 + :knocked-yellow-vxz-lo 40960.0 + :knocked-yellow-vxz-hi 49152.0 + :knocked-yellow-vy-lo 57344.0 + :knocked-yellow-vy-hi 81920.0 + :knocked-red-vxz-lo 24576.0 + :knocked-red-vxz-hi 196608.0 + :knocked-red-vy-lo 94208.0 + :knocked-red-vy-hi 151552.0 + :knocked-blue-vxz-lo 40960.0 + :knocked-blue-vxz-hi 49152.0 + :knocked-blue-vy-lo 24576.0 + :knocked-blue-vy-hi 81920.0 + :ragdoll-info #f + :shadow-size (meters 1) + :shadow-max-y (meters 1) + :shadow-min-y (meters -1) + :shadow-locus-dist (meters 150) + :gem-joint -1 + :gem-offset (new 'static 'sphere :r 163840.0) + :knocked-off #t + ) + ) + +;; failed to figure out what this is: +(set! (-> *sew-laser-turret-enemy-info* fact-defaults) *fact-info-enemy-defaults*) + +;; definition for method 159 of type sew-laser-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch symbol vs none. +(defmethod start-firing ((this sew-laser-turret) (arg0 symbol) (arg1 int)) + (let ((a0-2 (vector<-cspace! (new 'stack-no-clear 'vector) (-> this node-list data arg1)))) + (new 'stack-no-clear 'vector) + (let ((a1-3 (new 'stack-no-clear 'vector))) + (-> a0-2 y) + (set! (-> a1-3 quad) (-> this node-list data arg1 bone transform fvec quad)) + (set! (-> a1-3 y) (* 0.5 (-> a1-3 y))) + (fire-laser! a0-2 a1-3 (the-as sew-laser-guard this) 491520.0) + ) + ) + (if arg0 + (sound-play "gtur-shot-fire") + ) + (set! (-> this flash-state) #t) + (none) + ) + +;; definition for function do-spin +(defun do-spin ((arg0 sew-laser-turret) (arg1 float)) + (let ((s5-0 (new 'stack-no-clear 'quaternion))) + (quaternion-vector-angle! s5-0 *up-vector* (* 182.04445 (seconds-per-frame) arg1)) + (quaternion*! (-> arg0 root quat) (-> arg0 root quat) s5-0) + ) + (quaternion-normalize! (-> arg0 root quat)) + ) + +;; definition for method 163 of type sew-laser-turret +;; WARN: Return type mismatch symbol vs none. +(defmethod sew-laser-turret-method-163 ((this sew-laser-turret)) + (let* ((s5-0 *target*) + (a0-2 (if (type? s5-0 process-focusable) + s5-0 + ) + ) + ) + (cond + (a0-2 + (set! (-> this target-distance) (vector-vector-xz-distance (get-trans a0-2 0) (-> this root trans))) + (set! (-> this target-on-ground) (logtest? (-> *target* control status) (collide-status on-surface))) + ) + (else + (set! (-> this target-on-ground) #f) + ) + ) + ) + (none) + ) + +;; definition for method 162 of type sew-laser-turret +;; INFO: Used lq/sq +(defmethod check-suitable-focus ((this sew-laser-turret)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> this root trans quad)) + (set! (-> s5-0 w) (-> this awareness-radius)) + (let ((s4-0 (new 'stack-no-clear 'array 'collide-shape 384))) + (countdown (s3-0 (fill-actor-list-for-box *actor-hash* s5-0 s4-0 384)) + (let* ((s2-0 (-> s4-0 s3-0)) + (v1-4 (if (type? s2-0 collide-shape) + s2-0 + ) + ) + ) + (when v1-4 + (let* ((s2-1 (-> v1-4 process)) + (v1-5 (if (type? s2-1 process-focusable) + s2-1 + ) + ) + ) + (when v1-5 + (if (and (!= this v1-5) + (not (focus-test? (the-as process-focusable v1-5) inactive)) + (not (focus-test? (the-as process-focusable v1-5) disable)) + (not (focus-test? (the-as process-focusable v1-5) dead)) + (not (logtest? (process-mask crate) (-> v1-5 mask))) + (not (logtest? (process-mask vehicle) (-> v1-5 mask))) + ) + (return #t) + ) + ) + ) + ) + ) + ) + ) + (let* ((s3-1 *target*) + (s4-1 (if (type? s3-1 process-focusable) + s3-1 + ) + ) + ) + (when (and s4-1 (< (vector-vector-distance (get-trans s4-1 0) s5-0) (-> s5-0 w))) + (if (and (!= this s4-1) + (not (focus-test? s4-1 inactive)) + (not (focus-test? s4-1 disable)) + (not (focus-test? s4-1 dead)) + (not (logtest? (process-mask crate) (-> s4-1 mask))) + (not (logtest? (process-mask vehicle) (-> s4-1 mask))) + ) + (return #t) + ) + ) + ) + ) + #f + ) + +;; definition for function compute-ring-period +(defun compute-ring-period ((arg0 int)) + (/ 1.0 (the float arg0)) + ) + +;; definition for function compute-ring-position +(defun compute-ring-position ((arg0 int) (arg1 int)) + (* (compute-ring-period arg1) (the float (- arg1 arg0))) + ) + +;; definition for function compute-num-rings-to-draw +(defun compute-num-rings-to-draw ((arg0 time-frame) (arg1 time-frame) (arg2 float) (arg3 int)) + (if (< arg1 arg0) + arg3 + (+ (the int (/ arg2 (compute-ring-period arg3))) 1) + ) + ) + +;; definition for function compute-ring-size +(defun compute-ring-size ((arg0 float) (arg1 float)) + (let ((f0-1 (- arg0 (- 1.0 arg1)))) + (if (< f0-1 0.0) + (set! f0-1 (+ 1.0 f0-1)) + ) + f0-1 + ) + ) + +;; definition for function check-enemy +(defun check-enemy ((turret sew-laser-turret) (radius float) (pfoc process-focusable)) + (vector-vector-xz-distance (get-trans pfoc 0) (-> turret root trans)) + (let ((a0-3 (-> pfoc root))) + (b! (not a0-3) cfg-3 :likely-delay (set! v1-2 (the-as collide-shape-moving a0-3))) + (logtest? (-> (the-as collide-shape-moving a0-3) status) (collide-status on-surface)) + ) + (label cfg-3) + (if (and (-> turret target-on-ground) + (>= (-> turret target-distance) (+ -409.6 radius)) + (>= (+ 409.6 radius) (-> turret target-distance)) + ) + (return #t) + ) + #f + ) + +;; failed to figure out what this is: +(defstate spinning-up (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (until #f + (if (time-elapsed? (-> self state-time) (seconds 1.2)) + (go-hostile self) + ) + (let ((f0-1 (* 0.0027777778 (the float (mod (- (current-time) (-> self state-time)) 360))))) + (do-spin self (* 240.0 f0-1)) + ) + (suspend) + ) + #f + ) + :post enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate spinning-down (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (until #f + (if (time-elapsed? (-> self state-time) (seconds 1.2)) + (go-virtual alert) + ) + (let ((f0-1 (* 0.0027777778 (the float (mod (- (current-time) (-> self state-time)) 360))))) + (do-spin self (* 240.0 (- 1.0 f0-1))) + ) + (suspend) + ) + #f + ) + :post enemy-simple-post + ) + +;; definition for method 161 of type sew-laser-turret +;; INFO: Used lq/sq +;; WARN: Return type mismatch uint vs none. +(defmethod generate-prim-verts! ((this sew-laser-turret) (arg0 float) (arg1 float)) + (let ((s3-0 (new 'stack-no-clear 'vector))) + (set! (-> s3-0 quad) (-> *x-vector* quad)) + (let ((s5-0 (new 'stack-no-clear 'vector))) + (set! (-> s5-0 quad) (-> *z-vector* quad)) + (let ((s4-0 (new 'stack-no-clear 'vector)) + (s0-0 (new 'stack-no-clear 'rgbaf)) + ) + 0.0 + (let* ((s2-0 (* arg1 arg1)) + (f30-0 (lerp 128.0 0.0 s2-0)) + (s2-1 (* s2-0 s2-0)) + (s2-2 + (logior (logand (logior (logand (logior (logand (logior (logand s0-0 (the-as uint -256)) + (shr (shl (the int (lerp (the float (-> *color-red* r)) (the float (-> *color-green* r)) s2-1)) 56) 56) + ) + -65281 + ) + (shr (shl (the int (lerp (the float (-> *color-red* g)) (the float (-> *color-green* g)) s2-1)) 56) 48) + ) + -16711681 + ) + (shr (shl (the int (lerp (the float (-> *color-red* b)) (the float (-> *color-green* b)) s2-1)) 56) 40) + ) + (the-as uint #xffffffff00ffffff) + ) + (shr (shl (-> *color-gray* a) 56) 32) + ) + ) + ) + (set! (-> s3-0 y) 0.0) + (set! (-> s3-0 z) 0.0) + (vector-normalize! s3-0 arg0) + (vector-normalize! s5-0 arg0) + (vector+! s4-0 (-> this root trans) s3-0) + (vector+! s4-0 s4-0 s5-0) + (dotimes (v1-39 3) + (let ((a0-21 (-> this strip data (-> this strip num-verts)))) + (set! (-> a0-21 pos quad) (-> s4-0 quad)) + (set! (-> a0-21 stq z) (the-as float #x1)) + ) + (+! (-> this strip num-verts) 1) + ) + (let ((v1-46 (-> this strip data (-> this strip num-verts)))) + (set! (-> v1-46 pos quad) (-> s4-0 quad)) + (set! (-> v1-46 stq z) 0.0) + (set! (-> v1-46 stq x) 0.0) + (set! (-> v1-46 stq y) 0.0) + (set! (-> v1-46 col) (the-as rgba s2-2)) + (set! (-> v1-46 col a) (the int f30-0)) + (let ((v1-47 (&+ v1-46 32))) + (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) + (vector+! s4-0 s4-0 s5-0) + (set! (-> v1-47 pos quad) (-> s4-0 quad)) + (set! (-> v1-47 stq z) 0.0) + (set! (-> v1-47 stq x) 1.0) + (set! (-> v1-47 stq y) 0.0) + (set! (-> v1-47 col) (the-as rgba s2-2)) + (set! (-> v1-47 col a) (the int f30-0)) + (let ((v1-48 (&+ v1-47 32))) + (vector+! s4-0 (-> this root trans) s3-0) + (vector+float*! s4-0 s4-0 s5-0 -1.0) + (set! (-> v1-48 pos quad) (-> s4-0 quad)) + (set! (-> v1-48 stq z) 0.0) + (set! (-> v1-48 stq x) 0.0) + (set! (-> v1-48 stq y) 1.0) + (set! (-> v1-48 col) (the-as rgba s2-2)) + (set! (-> v1-48 col a) (the int f30-0)) + (let ((v1-49 (&+ v1-48 32))) + (vector+float*! s4-0 (-> this root trans) s3-0 -1.0) + (vector+float*! s4-0 s4-0 s5-0 -1.0) + (set! (-> v1-49 pos quad) (-> s4-0 quad)) + (set! (-> v1-49 stq z) 0.0) + (set! (-> v1-49 stq x) 1.0) + (set! (-> v1-49 stq y) 1.0) + (set! (-> v1-49 col) (the-as rgba s2-2)) + (set! (-> v1-49 col a) (the int f30-0)) + (&+ v1-49 32) + ) + ) + ) + ) + ) + ) + ) + ) + (+! (-> this strip num-verts) 4) + (none) + ) + +;; failed to figure out what this is: +(defstate alert (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set! (-> self last-spawn-index) -1) + (set-time! (-> self state-time)) + ) + :exit (behavior () + (set! (-> self strip num-verts) (the-as uint 0)) + 0 + ) + :trans (behavior () + (sew-laser-turret-method-163 self) + (when (-> self was-hit) + (set! (-> self was-hit) #f) + (go-virtual spinning-up) + ) + (if (and (logtest? (-> self enemy-flags) (enemy-flag victory)) (-> self enemy-info use-victory)) + (go-virtual victory) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + (set! (-> self strip num-verts) (the-as uint 0)) + (set! (-> self strip alpha) (new 'static 'gs-alpha :b #x2 :d #x1)) + (set! (-> self strip adnops 0 cmds) (gs-reg64 test-1)) + (set! (-> self strip data0) (new 'static 'gs-test + :ate #x1 + :atst (gs-atest greater-equal) + :aref #x80 + :afail #x1 + :zte #x1 + :ztst (gs-ztest greater-equal) + ) + ) + (setup-dma-and-tex (-> self strip) (-> self draw)) + (let ((gp-0 (new 'stack-no-clear 'vector))) + (set! (-> gp-0 quad) (-> self root trans quad)) + (set! (-> gp-0 w) (-> self awareness-radius)) + (let* ((s5-0 (new 'stack-no-clear 'array 'collide-shape 384)) + (s4-0 (fill-actor-list-for-box *actor-hash* gp-0 s5-0 384)) + (f30-0 (/ (the float (mod (- (current-time) (-> self state-time)) (-> self ring-rate))) + (the float (-> self ring-rate)) + ) + ) + (s3-1 (min (-> self max-num-rings) (compute-num-rings-to-draw + (- (current-time) (-> self state-time)) + (-> self ring-rate) + f30-0 + (-> self max-num-rings) + ) + ) + ) + ) + (dotimes (s2-0 s3-1) + (let* ((f0-3 (compute-ring-position s2-0 (-> self max-num-rings))) + (f26-0 (compute-ring-size f0-3 f30-0)) + (f28-0 (* (-> self awareness-radius) f26-0)) + ) + (generate-prim-verts! self (* 1.15 f28-0) f26-0) + (when (and (!= (-> self last-spawn-index) s2-0) (< f26-0 0.1)) + (set! (-> self last-spawn-index) s2-0) + (sound-play "las-tur-sonar") + ) + (if (and (< 0.1 f26-0) (= (-> self last-spawn-index) s2-0)) + (set! (-> self last-spawn-index) -1) + ) + (when (< f26-0 0.9) + (countdown (s1-1 s4-0) + (let* ((s0-1 (-> s5-0 s1-1)) + (v1-53 (if (type? s0-1 collide-shape) + s0-1 + ) + ) + ) + (when v1-53 + (let* ((s0-2 (-> v1-53 process)) + (a2-4 (if (type? s0-2 process-focusable) + s0-2 + ) + ) + ) + (when a2-4 + (when (and (!= self a2-4) + (not (focus-test? (the-as process-focusable a2-4) inactive)) + (not (focus-test? (the-as process-focusable a2-4) disable)) + (not (focus-test? (the-as process-focusable a2-4) dead)) + (not (logtest? (process-mask crate) (-> a2-4 mask))) + (not (logtest? (process-mask vehicle) (-> a2-4 mask))) + ) + (if (check-enemy self f28-0 (the-as process-focusable a2-4)) + (go-virtual spinning-up) + ) + ) + ) + ) + ) + ) + ) + (let* ((s0-3 *target*) + (s1-2 (if (type? s0-3 process-focusable) + s0-3 + ) + ) + ) + (when (and s1-2 (< (vector-vector-distance (get-trans s1-2 0) gp-0) (-> gp-0 w))) + (when (and (!= self s1-2) + (not (focus-test? s1-2 inactive)) + (not (focus-test? s1-2 disable)) + (not (focus-test? s1-2 dead)) + (not (logtest? (process-mask crate) (-> s1-2 mask))) + (not (logtest? (process-mask vehicle) (-> s1-2 mask))) + ) + (if (check-enemy self f28-0 s1-2) + (go-virtual spinning-up) + ) + ) + ) + ) + ) + ) + ) + ) + ) + ) + :code sleep-code + :post enemy-simple-post + ) + +;; failed to figure out what this is: +(defstate turn-off (sew-laser-turret) + :virtual #t + :code sleep-code + :post ja-post + ) + +;; failed to figure out what this is: +(defstate hostile (sew-laser-turret) + :virtual #t + :event enemy-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + (sound-play "las-tur-whoosh") + (set-time! (-> self last-play-time)) + (set! (-> self spin-sound-id) (new-sound-id)) + (set-sewd-light! 1.0) + ) + :exit (behavior () + (let ((t9-0 (-> (method-of-type enemy hostile) exit))) + (if t9-0 + (t9-0) + ) + ) + (set! (-> self flash-state) #f) + (if (not (and (-> self next-state) (= (-> self next-state name) 'hit))) + (set! (-> self was-hit) #f) + ) + (if (nonzero? (-> self spin-sound-id)) + (sound-stop (-> self spin-sound-id)) + ) + (set! (-> self spin-sound-id) (new 'static 'sound-id)) + (set-sewd-light! 0.0) + ) + :trans (behavior () + (sew-laser-turret-method-163 self) + (if (check-suitable-focus self) + (set-time! (-> self state-time)) + ) + (sound-play "las-tur-loop" :id (-> self spin-sound-id)) + (if (time-elapsed? (-> self state-time) (seconds 4)) + (go-virtual spinning-down) + ) + (when (time-elapsed? (-> self last-play-time) (seconds 0.5)) + (sound-play "las-tur-whoosh") + (set-time! (-> self last-play-time)) + ) + (set! (-> self root penetrated-by) (get-penetrated-by self)) + ) + :code (behavior () + (let ((f30-0 0.0)) + (until #f + (do-spin self 240.0) + (start-firing self #t 5) + (start-firing self #t 7) + (start-firing self #t 9) + (+! f30-0 (seconds-per-frame)) + (suspend) + ) + ) + #f + ) + ) + +;; definition for method 82 of type sew-laser-turret +(defmethod event-handler ((this sew-laser-turret) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('start) + (let ((v0-0 (the-as object #t))) + (set! (-> this can-shoot) (the-as symbol v0-0)) + v0-0 + ) + ) + (('attack) + (set! (-> this was-hit) #t) + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + (('stop) + (set! (-> this can-shoot) #f) + #f + ) + (('open) + (go (method-of-object this turn-off)) + ) + (('bonk) + (send-event arg0 'target-mech-get-off (seconds 0.3)) + (send-event arg0 'shove #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) + (shove-back (meters 2)) + (shove-up (meters 0.5)) + ) + ) + ) + #f + ) + (('flash-state) + (-> this flash-state) + ) + (else + ((method-of-type enemy event-handler) this arg0 arg1 arg2 arg3) + ) + ) + ) + +;; failed to figure out what this is: +(defstate die (sew-laser-turret) + :virtual #t + :enter (behavior () + (if (nonzero? (-> self spin-sound-id)) + (sound-stop (-> self spin-sound-id)) + ) + (set! (-> self spin-sound-id) (new 'static 'sound-id)) + (on-dying self) + (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 + (set! (-> self hit-points) 0.0) + (play-communicator-speech! (-> *talker-speech* 49)) + ) + :code (behavior () + (new 'stack 'joint-exploder-tuning (the-as uint 0)) + (activate! *camera-smush-control* 819.2 37 210 1.0 0.995 (-> *display* camera-clock)) + (sound-play "laser-tur-explo") + (suspend) + (cleanup-for-death self) + (ja-channel-set! 0) + (let ((gp-1 (new 'stack-no-clear 'vector))) + (set! (-> gp-1 quad) (-> self root trans quad)) + (+! (-> gp-1 y) 10240.0) + (let ((s5-1 (current-time))) + (until (time-elapsed? s5-1 (seconds 2)) + (spawn (-> self part) gp-1) + (suspend) + ) + ) + ) + (let ((gp-2 (current-time))) + (until (time-elapsed? gp-2 (seconds 1)) + (suspend) + ) + ) + (send-event self 'death-end) + (while (-> self child) + (suspend) + ) + ) + :post (behavior () + (enemy-common-post self) + ) + ) + +;; definition for method 120 of type sew-laser-turret +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy-collision! ((this sew-laser-turret)) + (let ((s5-0 (new 'process 'collide-shape-moving this (collide-list-enum usually-hit-by-player)))) + (set! (-> s5-0 dynam) (copy *standard-dynamics* 'process)) + (set! (-> s5-0 reaction) cshape-reaction-default) + (set! (-> s5-0 no-reaction) + (the-as (function collide-shape-moving collide-query vector vector object) nothing) + ) + (set! (-> s5-0 penetrated-by) (penetrate + generic-attack + lunge + flop + punch + spin + roll + uppercut + bonk + tube + flut-attack + board + mech-punch + dark-punch + dark-smack + flut + ) + ) + (let ((v1-7 (new 'process 'collide-shape-prim-sphere s5-0 (the-as uint 0)))) + (set! (-> v1-7 prim-core collide-as) (collide-spec enemy)) + (set! (-> v1-7 prim-core collide-with) (collide-spec jak player-list)) + (set! (-> v1-7 prim-core action) (collide-action solid no-standon)) + (set! (-> v1-7 transform-index) 3) + (set-vector! (-> v1-7 local-sphere) 0.0 -2048.0 0.0 10240.0) + (set! (-> s5-0 total-prims) (the-as uint 1)) + (set! (-> s5-0 root-prim) v1-7) + ) + (set! (-> s5-0 nav-radius) (* 0.75 (-> s5-0 root-prim local-sphere w))) + (let ((v1-10 (-> s5-0 root-prim))) + (set! (-> s5-0 backup-collide-as) (-> v1-10 prim-core collide-as)) + (set! (-> s5-0 backup-collide-with) (-> v1-10 prim-core collide-with)) + ) + (set! (-> this root) s5-0) + ) + 0 + (none) + ) + +;; definition for method 10 of type sew-laser-turret +(defmethod deactivate ((this sew-laser-turret)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this smoke-part)) + (kill-particles (-> this smoke-part)) + ) + (if (nonzero? (-> this casing-part)) + (kill-particles (-> this casing-part)) + ) + (if (nonzero? (-> this spin-sound-id)) + (sound-stop (-> this spin-sound-id)) + ) + ((method-of-type enemy deactivate) this) + (none) + ) + +;; definition for method 67 of type sew-laser-turret +(defmethod coin-flip? ((this sew-laser-turret)) + #f + ) + +;; definition for method 7 of type sew-laser-turret +;; WARN: Return type mismatch enemy vs sew-laser-turret. +(defmethod relocate ((this sew-laser-turret) (offset int)) + (if (nonzero? (-> this smoke-part)) + (&+! (-> this smoke-part) offset) + ) + (if (nonzero? (-> this casing-part)) + (&+! (-> this casing-part) offset) + ) + (if (nonzero? (-> this strip)) + (&+! (-> this strip) offset) + ) + (the-as sew-laser-turret ((method-of-type enemy relocate) this offset)) + ) + +;; definition for method 160 of type sew-laser-turret +;; WARN: Return type mismatch int vs none. +(defmethod sew-laser-turret-method-160 ((this sew-laser-turret)) + 0 + (none) + ) + +;; definition for method 121 of type sew-laser-turret +;; WARN: Return type mismatch int vs none. +(defmethod init-enemy! ((this sew-laser-turret)) + (initialize-skeleton + this + (the-as skeleton-group (art-group-get-by-name *level* "skel-sew-laser-turret" (the-as (pointer level) #f))) + (the-as pair 0) + ) + (init-enemy-defaults! this *sew-laser-turret-enemy-info*) + (logclear! (-> this mask) (process-mask actor-pause)) + (logclear! (-> this enemy-flags) (enemy-flag actor-pause-backup)) + (set! (-> this part) (create-launch-control (-> *part-group-id-table* 1518) this)) + (set! (-> this smoke-part) (create-launch-control (-> *part-group-id-table* 1519) this)) + (set! (-> this casing-part) (create-launch-control (-> *part-group-id-table* 1520) this)) + (set! (-> this max-num-rings) + (res-lump-value (-> this entity) 'sdt-num-rings int :default (the-as uint128 2) :time -1000000000.0) + ) + (set! (-> this ring-rate) + (the-as time-frame (the int (* 300.0 (res-lump-float (-> this entity) 'sdt-ring-rate :default 4.0)))) + ) + (set! (-> this awareness-radius) (res-lump-float (-> this entity) 'sdt-awareness-radius :default 90112.0)) + (let ((s5-1 (* 7 (-> this max-num-rings)))) + (set! (-> this strip) + (new 'process 'prim-strip s5-1 (lookup-texture-id-by-name "sonar-wave" (the-as string #f)) (the-as string #f)) + ) + ) + (logclear! (-> this enemy-flags) (enemy-flag vulnerable)) + (set! (-> this flash-state) #f) + (set! (-> this can-shoot) #t) + (set! (-> this was-hit) #f) + 0 + (none) + ) + +;; definition for method 122 of type sew-laser-turret +(defmethod go-idle2 ((this sew-laser-turret)) + (go (method-of-object this alert)) + ) + +;; definition for method 78 of type sew-laser-turret +(defmethod go-hostile ((this sew-laser-turret)) + (cond + ((and (not (and (-> this next-state) (let ((v1-3 (-> this next-state name))) + (or (= v1-3 'spinning-up) (= v1-3 'hostile)) + ) + ) + ) + (not (-> this was-hit)) + ) + (go (method-of-object this spinning-up)) + ) + ((not (and (-> this next-state) (= (-> this next-state name) 'hostile))) + (go (method-of-object this hostile)) + ) + ) + ) diff --git a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc index 5b28d055f5..7e4dfb814b 100644 --- a/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/sewer/sewer-obs_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Return type mismatch int vs none. (defun sewer-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 64 10) + (alloc-nav-network-for-level! *nav-network* 64 10) 0 (none) ) @@ -2290,7 +2290,3 @@ (call-parent-method this) (none) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc index 18ac3970e3..4608936aff 100644 --- a/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/temple/temple-obs_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Return type mismatch int vs none. (defun templea-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 64 10) + (alloc-nav-network-for-level! *nav-network* 64 10) 0 (none) ) @@ -2805,7 +2805,3 @@ (set! (-> this spawn-part) #f) (go (method-of-object this closed)) ) - - - - diff --git a/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc b/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc index bd21b9476b..fddcb36a67 100644 --- a/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc +++ b/test/decompiler/reference/jak3/levels/tower/tower-obs_REF.gc @@ -5,7 +5,7 @@ ;; WARN: Return type mismatch int vs none. (defun towera-login ((arg0 level)) (set! *nav-network* (new 'loading-level 'nav-network)) - (nav-network-method-9 *nav-network* 64 10) + (alloc-nav-network-for-level! *nav-network* 64 10) 0 (none) ) diff --git a/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc b/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc new file mode 100644 index 0000000000..0130807e52 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/bbush/des-bush-time-chase_REF.gc @@ -0,0 +1,2124 @@ +;;-*-Lisp-*- +(in-package goal) + +;; failed to figure out what this is: +(defpartgroup group-goal-explode + :id 1531 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5054 :period (seconds 20) :length (seconds 0.035)) + (sp-item 5055 :period (seconds 20) :length (seconds 0.035)) + ) + ) + +;; failed to figure out what this is: +(defpart 5054 + :init-specs ((:texture (explosion-nebula level-default-sprite)) + (:num 10.0) + (:scale-x (meters 3) (meters 2)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 255.0) + (:vel-y (meters 0) (meters 0.06666667)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.2) + (:fade-g -0.53333336) + (:fade-a -1.7 -1.7) + (:friction 0.93) + (:timer (seconds 0.5)) + (:flags (sp-cpuinfo-flag-3)) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpart 5055 + :init-specs ((:texture (explosion-edge level-default-sprite)) + (:num 20.0) + (:scale-x (meters 3) (meters 2)) + (:rot-x (degrees 0)) + (:rot-y (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 30.0) + (:g 80.0 20.0) + (:b 255.0) + (:a 128.0) + (:vel-y (meters 0.33333334) (meters 0.13333334)) + (:scalevel-x (meters 0.033333335)) + (:scalevel-y :copy scalevel-x) + (:fade-r -0.1) + (:fade-g -0.26666668) + (:fade-a -0.42666668 -0.42666668) + (:friction 0.75) + (:timer (seconds 1)) + (:flags (sp-cpuinfo-flag-0 sp-cpuinfo-flag-3)) + (:func 'sparticle-2d-spline-align-instant) + (:conerot-x (degrees 0) (degrees 360)) + (:rotate-y (degrees 0) (degrees 3600)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-trail-goal + :id 1532 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5056 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5056 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 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-trail-goal-touched + :id 1533 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 20) + :parts ((sp-item 5057 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5057 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +;; definition for symbol *tex-time-chase-level-list*, type (array symbol) +(define *tex-time-chase-level-list* (new 'static 'boxed-array :type symbol 'lbbtcha1 'lbbtcha2 'lbbtcha3)) + +;; definition for function find-time-chase-level-name +(defun find-time-chase-level-name () + (dotimes (gp-0 (-> *tex-time-chase-level-list* length)) + (let ((v1-3 (level-get *level* (-> *tex-time-chase-level-list* gp-0)))) + (if v1-3 + (return v1-3) + ) + ) + ) + (the-as level #f) + ) + +;; failed to figure out what this is: +(defpartgroup group-bb-finder + :id 1534 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5058 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5059 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:fade-a -0.055555556) + (:timer (seconds 6)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + ) + ) + +;; definition for symbol *bb-alpha*, type int +(define *bb-alpha* 50) + +;; failed to figure out what this is: +(defpartgroup group-bb-finder-nofade + :id 1535 + :flags (sp0 sp4) + :bounds (static-bspherem 0 0 0 640) + :parts ((sp-item 5060 :flags (sp7)) (sp-item 5058 :flags (sp7))) + ) + +;; failed to figure out what this is: +(defpart 5060 + :init-specs ((:texture (glow-soft level-default-sprite)) + (:num 1.0) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 0.0) + (:g 0.0) + (:b 128.0) + (:a 50.0) + (:fade-r 0.027777778) + (:fade-b -0.027777778) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:func 'spt-func-bb-fader) + ) + ) + +;; definition for function spt-func-bb-fader +;; WARN: Return type mismatch float vs none. +(defun spt-func-bb-fader ((arg0 sparticle-system) (arg1 sparticle-cpuinfo) (arg2 sparticle-launchinfo)) + (set! (-> arg2 coneradius) (the float *bb-alpha*)) + (none) + ) + +;; failed to figure out what this is: +(defpart 5058 + :init-specs ((:texture (starflash level-default-sprite)) + (:num 2.0) + (:x (meters -2) (meters 4)) + (:y (meters -1) (meters 2)) + (:scale-x (meters 0.1) (meters 0.2)) + (:scale-y :copy scale-x) + (:r 50.0) + (:g 50.0) + (:b 120.0) + (:a 64.0) + (:vel-y (meters 0.006666667) (meters 0.0016666667)) + (:scalevel-x (meters 0.00033333333)) + (:scalevel-y :copy scalevel-x) + (:fade-a 0.0) + (:accel-y (meters -0.00033333333) (meters -0.00016666666)) + (:timer (seconds 1.667)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3 glow)) + ) + ) + +;; definition of type trail-effect +(deftype trail-effect (process-drawable) + ((trail handle) + (goal-part sparticle-launch-control) + ) + (:state-methods + idle + dormant + ) + ) + +;; definition for method 3 of type trail-effect +(defmethod inspect ((this trail-effect)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Ttrail: ~D~%" (-> this trail)) + (format #t "~2Tgoal-part: ~A~%" (-> this goal-part)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (trail-effect) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0)))) + (set! (-> self root trans quad) (-> (the-as vector v1-1) quad)) + ) + (send-event (handle->process (-> self trail)) 'start-tracking) + ) + (('fadeout) + (send-event (handle->process (-> self trail)) 'fadeout) + ) + ) + ) + :trans (behavior () + '() + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate dormant (trail-effect) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('trans) + (let ((v1-1 (the-as object (-> block param 0))) + (v0-0 (the-as object (-> self root trans))) + ) + (set! (-> (the-as vector v0-0) quad) (-> (the-as vector v1-1) quad)) + v0-0 + ) + ) + (('active) + (go-virtual idle) + ) + ) + ) + :trans (behavior () + (spawn (-> self goal-part) (-> self root trans)) + ) + :code sleep-code + ) + +;; definition for method 7 of type trail-effect +;; WARN: Return type mismatch process-drawable vs trail-effect. +(defmethod relocate ((this trail-effect) (offset int)) + (if (nonzero? (-> this goal-part)) + (&+! (-> this goal-part) offset) + ) + (the-as trail-effect ((method-of-type process-drawable relocate) this offset)) + ) + +;; failed to figure out what this is: +(if (or (zero? *bb-timer-chase-trail*) (!= loading-level global)) + (set! *bb-timer-chase-trail* (new 'loading-level 'light-trail-composition)) + ) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* color-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* color-repeat-dist) 40960.0) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* alpha-1-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* alpha-2-mode) (the-as uint 4)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* base-alpha) 0.5) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* alpha-repeat-dist) 1228800.0) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* width-mode) (the-as uint 2)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* base-width) 4096.0) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* width-repeat-dist) 163840.0) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* uv-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* uv-repeat-dist) 163840.0) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* lie-mode) (the-as uint 0)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* max-age) (seconds 4)) + +;; failed to figure out what this is: +(if #f + (set! (-> *bb-timer-chase-trail* tex-id) + (the-as uint (lookup-texture-id-by-name (the-as string #f) (the-as string #f))) + ) + (set! (-> *bb-timer-chase-trail* tex-id) (the-as uint #x100300)) + ) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* width-curve) (the-as curve2d-piecewise *curve-linear-up*)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* color-curve) (the-as curve-color-piecewise *trail-color-curve-red*)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* alpha-curve-1) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* alpha-curve-2) (the-as curve2d-piecewise *curve-linear-down*)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* zbuffer?) #f) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* lie-vector quad) (-> *up-vector* quad)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* use-tape-mode?) #f) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* blend-mode) (the-as uint 1)) + +;; failed to figure out what this is: +(set! (-> *bb-timer-chase-trail* frame-stagger) (the-as uint 1)) + +;; definition of type timer-chase-trail +(deftype timer-chase-trail (light-trail-tracker-projectile) + ((time-offset time-frame :offset 192) + (start-tracking? symbol) + ) + (:state-methods + fadeout + ) + (:methods + (timer-chase-trail-method-23 (_type_) none) + ) + ) + +;; definition for method 3 of type timer-chase-trail +(defmethod inspect ((this timer-chase-trail)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type light-trail-tracker-projectile inspect))) + (t9-0 this) + ) + (format #t "~2Tstate-time: ~D~%" (-> this state-time)) + (format #t "~2Ttime-offset: ~D~%" (-> this time-offset)) + (format #t "~2Tstart-tracking?: ~A~%" (-> this start-tracking?)) + (label cfg-4) + this + ) + +;; definition for method 23 of type timer-chase-trail +;; WARN: Return type mismatch int vs none. +(defmethod timer-chase-trail-method-23 ((this timer-chase-trail)) + (+! (-> this trail start-marker) (the int (* 1200.0 (seconds-per-frame)))) + (if (time-elapsed? (-> this state-time) (seconds 2)) + (go empty-state) + ) + 0 + (none) + ) + +;; failed to figure out what this is: +(defstate tracking (timer-chase-trail) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('fadeout) + (format #t "fadeout~%") + (go-virtual fadeout) + ) + (('start-tracking) + (let ((v0-1 (the-as object #t))) + (set! (-> self start-tracking?) (the-as symbol v0-1)) + v0-1 + ) + ) + ) + ) + :enter (behavior () + (set-time! (-> self state-time)) + (set! (-> self start-tracking?) #f) + ) + :trans (behavior () + (let ((s5-0 (find-time-chase-level-name))) + (when s5-0 + (let ((s3-0 (-> s5-0 draw-index)) + (gp-0 4) + ) + (let ((s4-0 (vu1-bucket-map s3-0 gp-0 (merc-mode mercneric2))) + (v1-1 (vu1-bucket-map s3-0 gp-0 (merc-mode mm5))) + ) + (set! (-> self trail strip bucket) s4-0) + (set! (-> self trail strip sink) (the-as uint v1-1)) + ) + (set! (-> self trail strip level) s5-0) + (set! (-> self trail strip texture-index) (the-as uint gp-0)) + ) + (set! (-> self trail strip tex-id) + (lookup-texture-id-by-name "des-bush-timer-chase-trail" (the-as string #f)) + ) + ) + ) + (let ((gp-1 (handle->process (-> self tracked-object)))) + (cond + ((not gp-1) + (go-virtual hang-on) + ) + ((-> self start-tracking?) + (when (time-elapsed? (-> self time-offset) (seconds 0.05)) + (set-time! (-> self time-offset)) + (when (light-trail-tracker-method-17 self (the-as process-focusable gp-1)) + (set! (-> self trail start-marker) (the-as uint 0)) + (set! (-> self trail end-marker) (the-as uint 0)) + (light-trail-method-11 + (-> self trail) + (light-trail-tracker-method-16 self (the-as process-focusable gp-1) (new 'stack-no-clear 'vector)) + 0 + ) + ) + ) + ) + ) + ) + ) + ) + +;; failed to figure out what this is: +(defstate fadeout (timer-chase-trail) + :virtual #t + :enter (behavior () + (set-time! (-> self state-time)) + ) + :trans (behavior () + (timer-chase-trail-method-23 self) + ) + :code sleep-code + :post light-trail-tracker-common-post + ) + +;; definition for method 19 of type timer-chase-trail +(defmethod light-trail-tracker-method-19 ((this timer-chase-trail)) + #t + ) + +;; definition for function trail-effect-init-by-other +;; INFO: Used lq/sq +(defbehavior trail-effect-init-by-other trail-effect ((arg0 vector)) + (set! (-> self root) (new 'process 'trsqv)) + (set! (-> self root trans quad) (-> arg0 quad)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1534) self)) + (set! (-> self goal-part) (create-launch-control (-> *part-group-id-table* 1532) self)) + (let ((gp-1 (new 'stack-no-clear 'light-trail-tracker-spawn-params))) + (set! (-> gp-1 tracked-obj) (process->handle self)) + (set! (-> gp-1 appearance) *bb-timer-chase-trail*) + (set! (-> *bb-timer-chase-trail* tex-id) + (the-as uint (lookup-texture-id-by-name "des-bush-timer-chase-trail" (the-as string #f))) + ) + (set! (-> gp-1 max-num-crumbs) 500) + (set! (-> gp-1 track-immediately?) #f) + (let* ((v1-18 (estimate-light-trail-mem-usage + (the-as uint (-> gp-1 max-num-crumbs)) + (the-as uint (= (-> gp-1 appearance lie-mode) 3)) + ) + ) + (s5-0 (get-process *default-dead-pool* timer-chase-trail (+ v1-18 8192) 1)) + ) + (set! (-> self trail) (ppointer->handle (when s5-0 + (let ((t9-6 (method-of-type process activate))) + (t9-6 s5-0 self "light-trail" (the-as pointer #x70004000)) + ) + (run-now-in-process s5-0 light-trail-tracker-init-by-other gp-1) + (-> s5-0 ppointer) + ) + ) + ) + ) + ) + (go-virtual dormant) + ) + +;; failed to figure out what this is: +(defpartgroup group-bb-goal + :id 1536 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5061)) + ) + +;; failed to figure out what this is: +(defpart 5061 + :init-specs ((:texture (glow level-default-sprite)) + (:num 1.0) + (:scale-x (meters 5) (meters 0.25)) + (:rot-x (degrees 11.25)) + (:rot-z (degrees 0) (degrees 360)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-2 sp-cpuinfo-flag-3)) + (:userdata 4096.0) + ) + ) + +;; definition of type bb-goal +(deftype bb-goal (process-drawable) + ((activate-radius float) + (sound-id sound-id) + ) + (:state-methods + idle + die + ) + ) + +;; definition for method 3 of type bb-goal +(defmethod inspect ((this bb-goal)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tactivate-radius: ~f~%" (-> this activate-radius)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate idle (bb-goal) + :virtual #t + :trans (behavior () + (spawn (-> self part) (-> self root trans)) + (if (< (vector-vector-distance (target-pos 0) (-> self root trans)) 81920.0) + (set! (-> self sound-id) + (add-process *gui-control* self (gui-channel bbush) (gui-action queue) "miss001" -99.0 0) + ) + ) + (let ((f0-1 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-1 (-> self activate-radius)) + ) + (when (< f0-1 (* f1-1 f1-1)) + (send-event (ppointer->process (-> self parent)) 'goal) + (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) + ) + (go-virtual die) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (bb-goal) + :virtual #t + :enter (behavior () + (cond + ((logtest? (-> *part-group-id-table* 1531 flags) (sp-group-flag sp13)) + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker-subsampler :to self :group (-> *part-group-id-table* 1531)) + ) + (else + (set! (-> *launch-matrix* trans quad) (-> self root trans quad)) + (part-tracker-spawn part-tracker :to self :group (-> *part-group-id-table* 1531)) + ) + ) + ) + :code (behavior () + (while (-> self child) + (suspend) + ) + (cleanup-for-death self) + ) + ) + +;; definition for method 10 of type bb-goal +(defmethod deactivate ((this bb-goal)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 11 of type bb-goal +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this bb-goal) (arg0 entity-actor)) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for function bb-goal-init-by-other +(defbehavior bb-goal-init-by-other bb-goal ((arg0 entity-actor) (arg1 float)) + (process-entity-set! self arg0) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1536) self)) + (set! (-> self activate-radius) arg1) + (go-virtual idle) + ) + +;; failed to figure out what this is: +(defpartgroup group-bb-freeze-3 + :id 1537 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5066 :flags (sp6 sp7)) + (sp-item 5067 :flags (sp3 sp7)) + (sp-item 5068 :flags (sp6 sp7)) + (sp-item 5069 :flags (sp3) :binding 5062) + (sp-item 5062 :flags (sp2 sp3) :binding 5063) + (sp-item 5069 :flags (sp3) :binding 5064) + (sp-item 5064 :flags (sp2 sp3) :binding 5063) + (sp-item 5069 :flags (sp3) :binding 5065) + (sp-item 5065 :flags (sp2 sp3) :binding 5063) + ) + ) + +;; failed to figure out what this is: +(defpart 5066 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5067 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 4.8)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 16.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5070) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5070 + :init-specs ((:rot-z (degrees 1)) (:next-time (seconds 0.167)) (:next-launcher 5071)) + ) + +;; failed to figure out what this is: +(defpart 5071 + :init-specs ((:rot-z (degrees -9)) (:next-time (seconds 0.335)) (:next-launcher 5072)) + ) + +;; failed to figure out what this is: +(defpart 5072 + :init-specs ((:rot-z (degrees -8)) (:next-time (seconds 0.167)) (:next-launcher 5073)) + ) + +;; failed to figure out what this is: +(defpart 5073 + :init-specs ((:rot-z (degrees -18)) (:next-time (seconds 0.335)) (:next-launcher 5074)) + ) + +;; failed to figure out what this is: +(defpart 5074 + :init-specs ((:rot-z (degrees -17)) (:next-time (seconds 0.167)) (:next-launcher 5075)) + ) + +;; failed to figure out what this is: +(defpart 5075 + :init-specs ((:rot-z (degrees -27.000002)) (:next-time (seconds 0.335)) (:next-launcher 5076)) + ) + +;; failed to figure out what this is: +(defpart 5076 + :init-specs ((:rot-z (degrees -26.000002)) (:next-time (seconds 0.167)) (:next-launcher 5077)) + ) + +;; failed to figure out what this is: +(defpart 5077 + :init-specs ((:rot-z (degrees -36)) (:next-time (seconds 0.335)) (:next-launcher 5078)) + ) + +;; failed to figure out what this is: +(defpart 5078 + :init-specs ((:rot-z (degrees -35)) (:next-time (seconds 0.167)) (:next-launcher 5079)) + ) + +;; failed to figure out what this is: +(defpart 5079 + :init-specs ((:rot-z (degrees -45)) (:next-time (seconds 0.335)) (:next-launcher 5070)) + ) + +;; failed to figure out what this is: +(defpart 5068 + :init-specs ((:texture (time-bubble lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 32.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5069 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5062 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:y (meters 2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5064 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:y (meters -2)) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 45)) + (:vel-x (meters -0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5065 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 64.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 90)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5063 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 0.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bb-freeze-2 + :id 1538 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5083 :flags (sp6 sp7)) + (sp-item 5084 :flags (sp3 sp7)) + (sp-item 5085 :flags (sp6 sp7)) + (sp-item 5086 :flags (sp3) :binding 5080) + (sp-item 5080 :flags (sp2 sp3) :binding 5081) + (sp-item 5086 :flags (sp3) :binding 5082) + (sp-item 5082 :flags (sp2 sp3) :binding 5081) + ) + ) + +;; failed to figure out what this is: +(defpart 5083 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5084 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 4.8)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 16.0) + (:a 255.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5087) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5087 + :init-specs ((:rot-z (degrees 1)) (:next-time (seconds 0.167)) (:next-launcher 5088)) + ) + +;; failed to figure out what this is: +(defpart 5088 + :init-specs ((:rot-z (degrees -9)) (:next-time (seconds 0.335)) (:next-launcher 5089)) + ) + +;; failed to figure out what this is: +(defpart 5089 + :init-specs ((:rot-z (degrees -8)) (:next-time (seconds 0.167)) (:next-launcher 5090)) + ) + +;; failed to figure out what this is: +(defpart 5090 + :init-specs ((:rot-z (degrees -18)) (:next-time (seconds 0.335)) (:next-launcher 5091)) + ) + +;; failed to figure out what this is: +(defpart 5091 + :init-specs ((:rot-z (degrees -17)) (:next-time (seconds 0.167)) (:next-launcher 5092)) + ) + +;; failed to figure out what this is: +(defpart 5092 + :init-specs ((:rot-z (degrees -27.000002)) (:next-time (seconds 0.335)) (:next-launcher 5093)) + ) + +;; failed to figure out what this is: +(defpart 5093 + :init-specs ((:rot-z (degrees -26.000002)) (:next-time (seconds 0.167)) (:next-launcher 5094)) + ) + +;; failed to figure out what this is: +(defpart 5094 + :init-specs ((:rot-z (degrees -36)) (:next-time (seconds 0.335)) (:next-launcher 5095)) + ) + +;; failed to figure out what this is: +(defpart 5095 + :init-specs ((:rot-z (degrees -35)) (:next-time (seconds 0.167)) (:next-launcher 5096)) + ) + +;; failed to figure out what this is: +(defpart 5096 + :init-specs ((:rot-z (degrees -45)) (:next-time (seconds 0.335)) (:next-launcher 5087)) + ) + +;; failed to figure out what this is: +(defpart 5085 + :init-specs ((:texture (time-bubble lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 32.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5086 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5080 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5082 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:z (meters 2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 255.0) + (:g 255.0) + (:b 64.0) + (:a 128.0) + (:omega (degrees 180)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5081 + :init-specs ((:texture (middot level-default-sprite)) + (:num 1.0) + (:scale-x (meters 0.8)) + (:scale-y :copy scale-x) + (:r 128.0) + (:g 128.0) + (:b 0.0) + (:a 32.0) + (:scalevel-x (meters -0.006666667)) + (:scalevel-y :copy scalevel-x) + (:fade-a -0.32) + (:timer (seconds 0.335)) + (:flags (sp-cpuinfo-flag-3)) + ) + ) + +;; failed to figure out what this is: +(defpartgroup group-bb-freeze + :id 1539 + :linger-duration (seconds 2) + :flags (sp0) + :bounds (static-bspherem 0 0 0 2) + :parts ((sp-item 5100 :flags (sp6 sp7)) + (sp-item 5101 :flags (sp3 sp7)) + (sp-item 5102 :flags (sp6 sp7)) + (sp-item 5103 :flags (sp3) :binding 5097) + (sp-item 5097 :flags (sp2 sp3) :binding 5098) + (sp-item 5103 :flags (sp3) :binding 5099) + ) + ) + +;; failed to figure out what this is: +(defpart 5100 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 5)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 16.0) + (:b 255.0) + (:a 255.0) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5101 + :init-specs ((:texture (time-bubble-clock lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 4.8)) + (:rot-z (degrees 0)) + (:scale-y :copy scale-x) + (:r 16.0) + (:g 16.0) + (:b 255.0) + (:a 255.0) + (:timer (seconds -0.005)) + (:flags (sp-cpuinfo-flag-3)) + (:next-time (seconds 0.335)) + (:next-launcher 5104) + (:rotate-y (degrees 0)) + ) + ) + +;; failed to figure out what this is: +(defpart 5104 + :init-specs ((:rot-z (degrees 1)) (:next-time (seconds 0.167)) (:next-launcher 5105)) + ) + +;; failed to figure out what this is: +(defpart 5105 + :init-specs ((:rot-z (degrees -9)) (:next-time (seconds 0.335)) (:next-launcher 5106)) + ) + +;; failed to figure out what this is: +(defpart 5106 + :init-specs ((:rot-z (degrees -8)) (:next-time (seconds 0.167)) (:next-launcher 5107)) + ) + +;; failed to figure out what this is: +(defpart 5107 + :init-specs ((:rot-z (degrees -18)) (:next-time (seconds 0.335)) (:next-launcher 5108)) + ) + +;; failed to figure out what this is: +(defpart 5108 + :init-specs ((:rot-z (degrees -17)) (:next-time (seconds 0.167)) (:next-launcher 5109)) + ) + +;; failed to figure out what this is: +(defpart 5109 + :init-specs ((:rot-z (degrees -27.000002)) (:next-time (seconds 0.335)) (:next-launcher 5110)) + ) + +;; failed to figure out what this is: +(defpart 5110 + :init-specs ((:rot-z (degrees -26.000002)) (:next-time (seconds 0.167)) (:next-launcher 5111)) + ) + +;; failed to figure out what this is: +(defpart 5111 + :init-specs ((:rot-z (degrees -36)) (:next-time (seconds 0.335)) (:next-launcher 5112)) + ) + +;; failed to figure out what this is: +(defpart 5112 + :init-specs ((:rot-z (degrees -35)) (:next-time (seconds 0.167)) (:next-launcher 5113)) + ) + +;; failed to figure out what this is: +(defpart 5113 + :init-specs ((:rot-z (degrees -45)) (:next-time (seconds 0.335)) (:next-launcher 5104)) + ) + +;; failed to figure out what this is: +(defpart 5102 + :init-specs ((:texture (time-bubble lbbtcha1-sprite)) + (:num 1.0) + (:scale-x (meters 6)) + (:rot-x (degrees 22.5)) + (:scale-y :copy scale-x) + (:r 32.0) + (:g 32.0) + (:b 255.0) + (:a 64.0) + (:omega (degrees 4511.25)) + (:timer (seconds 0.017)) + (:flags (sp-cpuinfo-flag-3)) + (:userdata 409.6) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5103 + :init-specs ((:texture (hotdot level-default-sprite)) + (:num 1.0) + (: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)) + (:flags (sp-cpuinfo-flag-3)) + (:rotate-y (degrees 90)) + ) + ) + +;; failed to figure out what this is: +(defpart 5097 + :init-specs ((:texture (time-bubble-orbiter lbbtcha1-sprite)) + (:num 1.0) + (:y (meters 4)) + (:z (meters 0.2)) + (:scale-x (meters 1)) + (:scale-y :copy scale-x) + (:r 64.0) + (:g 64.0) + (:b 255.0) + (:a 128.0) + (:omega (degrees 0)) + (:vel-x (meters 0.053333335)) + (:vel-y (meters 0)) + (:timer (seconds -0.005)) + (:flags (ready-to-launch aux-list)) + (:rotate-y (degrees 0)) + ) + ) + +;; definition (debug) for function bb-pickup-type->string +(defun-debug bb-pickup-type->string ((arg0 bb-pickup-type)) + (case arg0 + (((bb-pickup-type large)) + "large" + ) + (((bb-pickup-type small)) + "small" + ) + (((bb-pickup-type medium)) + "medium" + ) + (else + "*unknown*" + ) + ) + ) + +;; definition for function set-time-chase-particle-texture +;; WARN: Return type mismatch texture-id vs none. +(defun set-time-chase-particle-texture () + (let ((gp-0 (find-time-chase-level-name))) + (when gp-0 + (set! (-> *part-id-table* 5067 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5066 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5068 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble" gp-0 7)) + ) + (set! (-> *part-id-table* 5069 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "hotdot" gp-0 7)) + ) + (set! (-> *part-id-table* 5062 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5064 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5065 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5063 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5084 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5083 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5085 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble" gp-0 7)) + ) + (set! (-> *part-id-table* 5086 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "hotdot" gp-0 7)) + ) + (set! (-> *part-id-table* 5080 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5082 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + (set! (-> *part-id-table* 5081 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5101 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5100 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-clock" gp-0 7)) + ) + (set! (-> *part-id-table* 5102 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble" gp-0 7)) + ) + (set! (-> *part-id-table* 5103 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "hotdot" gp-0 7)) + ) + (set! (-> *part-id-table* 5097 init-specs 0 initial-valuef) + (the-as float (lookup-level-texture-id-by-name "time-bubble-orbiter" gp-0 7)) + ) + ) + ) + (none) + ) + +;; definition of type bb-freeze +(deftype bb-freeze (process-drawable) + ((launch-pos vector :inline) + (activate-radius float) + (freeze-time float) + (freeze-pickup-radius float) + (bb-pickup-type bb-pickup-type) + ) + (:state-methods + idle + dormant + die + ) + ) + +;; definition for method 3 of type bb-freeze +(defmethod inspect ((this bb-freeze)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type process-drawable inspect))) + (t9-0 this) + ) + (format #t "~2Tlaunch-pos: #~%" (-> this launch-pos)) + (format #t "~2Tactivate-radius: ~f~%" (-> this activate-radius)) + (format #t "~2Tfreeze-time: ~f~%" (-> this freeze-time)) + (format #t "~2Tfreeze-pickup-radius: ~f~%" (-> this freeze-pickup-radius)) + (format #t "~2Tbb-pickup-type: ~D~%" (-> this bb-pickup-type)) + (label cfg-4) + this + ) + +;; failed to figure out what this is: +(defstate dormant (bb-freeze) + :virtual #t + :trans (behavior () + (let ((f0-0 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 (-> self activate-radius)) + ) + (if (< f0-0 (* f1-0 f1-0)) + (go-virtual idle) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate idle (bb-freeze) + :virtual #t + :enter (behavior () + '() + ) + :exit (behavior () + (if (nonzero? (-> self part)) + (kill-particles (-> self part)) + ) + ) + :trans (behavior () + (let ((f0-0 (-> self activate-radius))) + (if (< (* f0-0 f0-0) (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (go-virtual dormant) + ) + ) + (spawn (-> self part) (-> self root trans)) + (let ((f0-3 (vector-vector-distance-squared (target-pos 0) (-> self root trans))) + (f1-0 (-> self freeze-pickup-radius)) + ) + (when (< f0-3 (* f1-0 f1-0)) + (send-event (ppointer->process (-> self parent)) 'freeze (-> self freeze-time)) + (case (-> self bb-pickup-type) + (((bb-pickup-type small)) + (sound-play "small-pickup") + ) + (((bb-pickup-type medium)) + (sound-play "medium-pickup") + ) + (((bb-pickup-type large)) + (sound-play "large-pickup") + ) + ) + (go-virtual die) + ) + ) + ) + :code sleep-code + ) + +;; failed to figure out what this is: +(defstate die (bb-freeze) + :virtual #t + :code (behavior () + (cleanup-for-death self) + ) + ) + +;; definition for method 10 of type bb-freeze +(defmethod deactivate ((this bb-freeze)) + "Make a process dead, clean it up, remove it from the active pool, and return to dead pool." + (if (nonzero? (-> this part)) + (kill-particles (-> this part)) + ) + ((method-of-type process-drawable deactivate) this) + (none) + ) + +;; definition for method 11 of type bb-freeze +;; WARN: Return type mismatch entity-perm-status vs object. +(defmethod init-from-entity! ((this bb-freeze) (arg0 entity-actor)) + (stack-size-set! (-> this main-thread) 32) + (process-entity-status! this (entity-perm-status dead) #t) + ) + +;; definition for function bb-freeze-init-by-other +(defbehavior bb-freeze-init-by-other bb-freeze ((arg0 entity-actor) (arg1 object) (arg2 float) (arg3 float) (arg4 float)) + (process-entity-set! self arg0) + (set! (-> self bb-pickup-type) (bb-pickup-type small)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self activate-radius) arg2) + (set! (-> self freeze-time) arg3) + (set! (-> self freeze-pickup-radius) arg4) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1539) self)) + (go-virtual dormant) + ) + +;; definition of type a-bb-freeze +(deftype a-bb-freeze (bb-freeze) + () + ) + +;; definition for method 3 of type a-bb-freeze +(defmethod inspect ((this a-bb-freeze)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bb-freeze inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for function a-bb-freeze-init-by-other +(defbehavior a-bb-freeze-init-by-other a-bb-freeze ((arg0 entity-actor) (arg1 object) (arg2 float) (arg3 float) (arg4 float)) + (stack-size-set! (-> self main-thread) 32) + (process-entity-set! self arg0) + (set! (-> self bb-pickup-type) (bb-pickup-type medium)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self activate-radius) arg2) + (set! (-> self freeze-time) arg3) + (set! (-> self freeze-pickup-radius) arg4) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1538) self)) + (go-virtual dormant) + ) + +;; definition of type b-bb-freeze +(deftype b-bb-freeze (bb-freeze) + () + ) + +;; definition for method 3 of type b-bb-freeze +(defmethod inspect ((this b-bb-freeze)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type bb-freeze inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for function b-bb-freeze-init-by-other +(defbehavior b-bb-freeze-init-by-other b-bb-freeze ((arg0 entity-actor) (arg1 object) (arg2 float) (arg3 float) (arg4 float)) + (stack-size-set! (-> self main-thread) 32) + (process-entity-set! self arg0) + (set! (-> self bb-pickup-type) (bb-pickup-type large)) + (set! (-> self root) (new 'process 'trsqv)) + (process-drawable-from-entity! self arg0) + (logclear! (-> self mask) (process-mask actor-pause)) + (set! (-> self activate-radius) arg2) + (set! (-> self freeze-time) arg3) + (set! (-> self freeze-pickup-radius) arg4) + (set! (-> self part) (create-launch-control (-> *part-group-id-table* 1537) self)) + (go-virtual dormant) + ) + +;; definition of type freeze-time-hud +(deftype freeze-time-hud (hud-goal) + () + ) + +;; definition for method 3 of type freeze-time-hud +(defmethod inspect ((this freeze-time-hud)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type hud-goal inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 15 of type freeze-time-hud +;; WARN: Return type mismatch int vs none. +(defmethod draw ((this freeze-time-hud)) + (set-hud-piece-position! (the-as hud-sprite (-> this sprites)) 447 70) + (format (clear (-> this strings 0 text)) "~2,'0D" (/ (-> this values 0 current) 100)) + (format (clear (-> this strings 2 text)) ":") + (format (clear (-> this strings 3 text)) "~2,'0D" (mod (-> this values 0 current) 100)) + (set-as-offset-from! (the-as hud-sprite (-> this strings 0 pos)) (the-as vector4w (-> this sprites)) -15 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 2 pos)) (the-as vector4w (-> this sprites)) 0 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 3 pos)) (the-as vector4w (-> this sprites)) 15 -8) + (set-as-offset-from! (the-as hud-sprite (-> this strings 1 pos)) (the-as vector4w (-> this sprites)) 0 -40) + (let ((s5-3 (new + 'stack + 'font-context + *font-default-matrix* + (+ (-> this strings 1 pos x) -80) + (+ (-> this strings 1 pos y) -20) + 0.0 + (font-color default) + (font-flags shadow kerning) + ) + ) + ) + (set! (-> s5-3 flags) (font-flags kerning middle large)) + (let ((v1-6 s5-3)) + (set! (-> v1-6 width) (the float 160)) + ) + (let ((v1-7 s5-3)) + (set! (-> v1-7 height) (the float 80)) + ) + (let ((v1-8 s5-3)) + (set! (-> v1-8 scale) 0.6) + ) + (let ((a0-16 s5-3)) + (set! (-> a0-16 color) (-> this strings 1 color)) + ) + (let ((s4-0 print-game-text)) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0861) #f)) + (s4-0 *temp-string* s5-3 #f 44 (bucket-id hud-draw-hud-alpha)) + ) + ) + ((method-of-type hud draw) this) + 0 + (none) + ) + +;; definition for method 16 of type freeze-time-hud +;; WARN: Return type mismatch int vs none. +(defmethod update-values! ((this freeze-time-hud)) + (set! (-> this values 0 target) (the int (-> *game-info* score))) + ((method-of-type hud update-values!) this) + 0 + (none) + ) + +;; definition for method 17 of type freeze-time-hud +;; WARN: Return type mismatch int vs none. +(defmethod init-callback ((this freeze-time-hud)) + (set! (-> this gui-id) + (add-process *gui-control* this (gui-channel hud-upper-right) (gui-action hidden) (-> this name) 81920.0 0) + ) + (logior! (-> this flags) (hud-flags show)) + (set! (-> this sprites 0 tid) (the-as texture-id (get-texture hud-scoreboard-01 level-default-minimap))) + (set! (-> this sprites 0 scale-x) 1.2) + (set! (-> this sprites 0 flags) (hud-sprite-flags hsf3)) + (alloc-string-if-needed this 0) + (set! (-> this strings 0 scale) 0.5) + (set! (-> this strings 0 flags) (font-flags kerning middle large)) + (set! (-> this strings 0 color) (font-color red)) + (alloc-string-if-needed this 2) + (set! (-> this strings 2 scale) 0.5) + (set! (-> this strings 2 flags) (font-flags kerning middle large)) + (set! (-> this strings 2 color) (font-color red)) + (alloc-string-if-needed this 3) + (set! (-> this strings 3 scale) 0.5) + (set! (-> this strings 3 flags) (font-flags kerning middle large)) + (set! (-> this strings 3 color) (font-color red)) + (alloc-string-if-needed this 1) + (set! (-> this strings 1 scale) 0.75) + (set! (-> this strings 1 flags) (font-flags kerning middle large)) + (set! (-> this strings 1 color) (font-color red)) + (let ((s5-0 format) + (gp-1 (clear (-> this strings 1 text))) + (s4-0 "") + ) + (format (clear *temp-string*) (lookup-text! *common-text* (text-id text-0861) #f)) + *temp-string* + (s5-0 gp-1 s4-0) + ) + 0 + (none) + ) + +;; definition of type task-manager-bbush-timer-chase +(deftype task-manager-bbush-timer-chase (task-manager) + ((actor-group (pointer actor-group)) + (actor-group-count int32) + (freeze-time float) + (path-pos float) + (trail-effect handle) + (trans vector :inline) + (freeze-activation-radius float) + (goal-activation-radius float) + (total-time float) + (touched symbol) + (freeze-time-1 float :offset 308) + (freeze-time-2 float) + (freeze-time-3 float) + (freeze-pickup-radius float) + (freeze-time-hud handle) + (sound-id sound-id) + (color-flash-time time-frame) + ) + (:methods + (get-entity-name (_type_) string) + (set-sbanks (_type_) none) + (get-node-array (_type_) (array timer-chase-node)) + ) + ) + +;; definition for method 3 of type task-manager-bbush-timer-chase +(defmethod inspect ((this task-manager-bbush-timer-chase)) + (when (not this) + (set! this this) + (goto cfg-7) + ) + (let ((t9-0 (method-of-type task-manager inspect))) + (t9-0 this) + ) + (format #t "~2Tactor-group: #x~X~%" (-> this actor-group)) + (dotimes (s5-0 (-> this actor-group-count)) + (format #t "~T [~D]~2Tactor-group: ~`actor-group`P~%" s5-0 (-> this actor-group s5-0)) + ) + (format #t "~2Tactor-group-count: ~D~%" (-> this actor-group-count)) + (format #t "~2Tfreeze-time: ~f~%" (-> this freeze-time)) + (format #t "~2Tpath-pos: ~f~%" (-> this path-pos)) + (format #t "~2Ttrail-effect: ~D~%" (-> this trail-effect)) + (format #t "~2Ttrans: #~%" (-> this trans)) + (format #t "~2Tfreeze-activation-radius: ~f~%" (-> this freeze-activation-radius)) + (format #t "~2Tgoal-activation-radius: ~f~%" (-> this goal-activation-radius)) + (format #t "~2Ttotal-time: ~f~%" (-> this total-time)) + (format #t "~2Ttouched: ~A~%" (-> this touched)) + (format #t "~2Tfreeze-time: ~f~%" (-> this freeze-time)) + (format #t "~2Tfreeze-time-1: ~f~%" (-> this freeze-time-1)) + (format #t "~2Tfreeze-time-2: ~f~%" (-> this freeze-time-2)) + (format #t "~2Tfreeze-time-3: ~f~%" (-> this freeze-time-3)) + (format #t "~2Tfreeze-pickup-radius: ~f~%" (-> this freeze-pickup-radius)) + (format #t "~2Tfreeze-time-hud: ~D~%" (-> this freeze-time-hud)) + (format #t "~2Tsound-id: ~D~%" (-> this sound-id)) + (format #t "~2Tcolor-flash-time: ~D~%" (-> this color-flash-time)) + (label cfg-7) + this + ) + +;; failed to figure out what this is: +(defstate resolution (task-manager-bbush-timer-chase) + :virtual #t + :event task-manager-event-handler + :enter (behavior () + (set-time! (-> self state-time)) + ) + :code (behavior () + (local-vars (v1-34 object)) + (when (logtest? (-> self info mask) (task-manager-mask resolution-scene)) + (let ((gp-1 (ppointer->handle (process-spawn + scene-player + :init scene-player-init + (-> self info resolution-scene) + #t + (-> self info resolution-scene-continue) + :name "scene-player" + ) + ) + ) + ) + (while (handle->process (the-as handle gp-1)) + (suspend) + ) + ) + ) + (task-manager-method-27 self) + (give *game-info* 'skill (the float (-> self info user-count)) (the-as handle #f)) + (until (< (* 45 (-> self info user-count)) (- (current-time) (-> self state-time))) + (suspend) + ) + (let ((gp-2 (-> self info on-complete))) + (if gp-2 + (script-eval gp-2) + ) + ) + (task-node-close! (-> self info final-node) 'event) + (remove-setting! 'allow-progress) + (while (begin + (set! v1-34 (or (handle->process (-> self arrow)) (begin + (countdown (v1-35 4) + (when (handle->process (-> self hud v1-35)) + (set! v1-34 #t) + (goto cfg-41) + ) + ) + #f + ) + ) + ) + (label cfg-41) + v1-34 + ) + (suspend) + ) + ) + ) + +;; definition for method 33 of type task-manager-bbush-timer-chase +;; WARN: Return type mismatch int vs none. +(defmethod set-sbanks ((this task-manager-bbush-timer-chase)) + (cond + ((= (status-of-level-and-borrows *level* 'waswide #f) 'active) + (set-setting! 'extra-bank '((wascity3 bbush1)) 0.0 0) + (set-setting! 'music 'wastimer 0.0 0) + ) + (else + (set-setting! 'extra-bank '((desert2 bbush1) (nest2 bbush1)) 0.0 0) + (set-setting! 'music 'destimer 0.0 0) + ) + ) + 0 + (none) + ) + +;; definition for method 32 of type task-manager-bbush-timer-chase +(defmethod get-entity-name ((this task-manager-bbush-timer-chase)) + (format 0 "tag2~%") + "tmanager-3" + ) + +;; definition for method 34 of type task-manager-bbush-timer-chase +(defmethod get-node-array ((this task-manager-bbush-timer-chase)) + *timer-chase-path-0* + ) + +;; definition for method 21 of type task-manager-bbush-timer-chase +;; INFO: Used lq/sq +;; WARN: Return type mismatch object vs none. +(defmethod set-time-limit ((this task-manager-bbush-timer-chase)) + (local-vars (s4-0 object) (sv-96 res-tag)) + (let ((t9-0 (method-of-type task-manager set-time-limit))) + (t9-0 this) + ) + (set-time-chase-particle-texture) + (set-setting! 'airlock #f 0.0 0) + (set! (-> this freeze-time) 0.0) + (set-sbanks this) + (set! (-> this trail-effect) + (ppointer->handle (process-spawn trail-effect *null-vector* :name "trail-effect" :to this)) + ) + (set! (-> this freeze-time-hud) + (ppointer->handle (process-spawn freeze-time-hud :init hud-init-by-other :name "freeze-time-hud" :to this)) + ) + (if (handle->process (-> this freeze-time-hud)) + (send-event (handle->process (-> this freeze-time-hud)) 'force-hide) + ) + (set! (-> *game-info* score) 0.0) + (set! (-> this touched) #f) + (let ((s5-3 (entity-by-name (get-entity-name this)))) + (set! s4-0 + (when s5-3 + (set! (-> this entity) (the-as entity-actor s5-3)) + (set! (-> this freeze-activation-radius) (res-lump-float s5-3 'freezer-activation-radius :default 40960.0)) + (set! (-> this freeze-pickup-radius) (res-lump-float s5-3 'freeze-pickup-radius :default 10.0)) + (set! (-> this goal-activation-radius) (res-lump-float s5-3 'goal-activation-radius :default 40960.0)) + (set! (-> this total-time) (res-lump-float s5-3 'time-limit :default 10.0)) + (set! (-> this freeze-time) 0.0) + (set! (-> this freeze-time-1) (res-lump-float s5-3 'freeze-time :default 10.0)) + (set! (-> this freeze-time-2) (res-lump-float s5-3 'a-freeze-time :default 10.0)) + (set! (-> this freeze-time-3) (res-lump-float s5-3 'b-freeze-time :default 10.0)) + (set! sv-96 (new 'static 'res-tag)) + (set! s4-0 (res-lump-data s5-3 'actor-groups pointer :tag-ptr (& sv-96))) + (cond + ((and (the-as pointer s4-0) (nonzero? (-> sv-96 elt-count))) + (format 0 "elt: ~d~%" (the-as pointer s4-0)) + (format 0 "elt2: ~d~%" (-> sv-96 elt-count)) + (set! (-> this actor-group-count) (the-as int (-> sv-96 elt-count))) + (set! (-> this actor-group) (the-as (pointer actor-group) s4-0)) + s4-0 + ) + (else + (format 0 "ERROR: ~s: entity missing actor-group!~%" (game-task->string (-> this node-info task))) + ) + ) + ) + ) + ) + (none) + ) + +;; failed to figure out what this is: +(defstate active (task-manager-bbush-timer-chase) + :virtual #t + :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) + (case message + (('freeze) + (let ((f0-0 (the-as float (-> block param 0)))) + (+! (-> self time-limit) (the int (* 300.0 f0-0))) + (+! (-> self freeze-time) f0-0) + (when (-> self freeze-time-hud) + (cond + ((= f0-0 (-> self freeze-time-1)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color cyan) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color cyan) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color cyan) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color cyan) + ) + ) + ((= f0-0 (-> self freeze-time-2)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color yellow) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color yellow) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color yellow) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color yellow) + ) + ) + ((= f0-0 (-> self freeze-time-3)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color red) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color red) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color red) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color red) + ) + ) + ) + (let ((v0-0 (the-as object (current-time)))) + (set! (-> self color-flash-time) (the-as time-frame v0-0)) + v0-0 + ) + ) + ) + ) + (('goal) + (send-event (handle->process (-> self trail-effect)) 'fadeout) + (send-event self 'complete) + ) + (('start) + (when (and (nonzero? (-> self actor-group)) (-> self touched)) + (dotimes (gp-0 3) + (dotimes (s5-0 (length (-> self actor-group gp-0))) + (let ((s4-0 (-> self actor-group gp-0 data s5-0))) + (cond + ((and (zero? s5-0) (zero? gp-0)) + (process-spawn bb-goal (-> s4-0 actor) (-> self goal-activation-radius) :name "bb-goal" :to self) + ) + (else + (cond + ((zero? gp-0) + (process-spawn + bb-freeze + (-> s4-0 actor) + (get-node-array self) + (-> self freeze-activation-radius) + (-> self freeze-time-1) + (-> self freeze-pickup-radius) + :name "bb-freeze" + :to self + ) + ) + ((= gp-0 1) + (process-spawn + a-bb-freeze + (-> s4-0 actor) + (get-node-array self) + (-> self freeze-activation-radius) + (-> self freeze-time-2) + (-> self freeze-pickup-radius) + :name "a-bb-freeze" + :to self + ) + ) + ((= gp-0 2) + (process-spawn + b-bb-freeze + (-> s4-0 actor) + (get-node-array self) + (-> self freeze-activation-radius) + (-> self freeze-time-3) + (-> self freeze-pickup-radius) + :name "b-bb-freeze" + :to self + ) + ) + ) + ) + ) + ) + ) + ) + #f + ) + ) + (else + (task-manager-event-handler proc argc message block) + ) + ) + ) + :enter (behavior () + (when (-> self touched) + (+! (-> self path-pos) (* 0.1 (seconds-per-frame))) + (when (< (the float (+ (length (-> self actor-group 0)) -1)) (-> self path-pos)) + (set! (-> self path-pos) (the float (+ (length (-> self actor-group 0)) -1))) + (send-event self 'complete) + ) + ) + ) + :exit (behavior () + '() + ) + :trans (behavior () + (local-vars (sv-208 (function vector float vector)) (sv-224 vector) (sv-240 (function vector float vector))) + (seek! (-> self freeze-time) 0.0 (seconds-per-frame)) + (when (time-elapsed? (-> self color-flash-time) (seconds 1)) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 0 color) + (font-color green) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 1 color) + (font-color green) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 2 color) + (font-color green) + ) + (set! (-> (the-as freeze-time-hud (handle->process (-> self freeze-time-hud))) strings 3 color) + (font-color green) + ) + ) + (if (and (-> self touched) (= (-> self freeze-time) 0.0)) + (hud-timer-handler self) + ) + (set! (-> *game-info* score) (* 100.0 (-> self freeze-time))) + (dotimes (gp-0 (+ (length (-> self actor-group (+ (-> self actor-group-count) -1))) -1)) + (when (and (>= (-> self path-pos) (the float gp-0)) (>= (the float (+ gp-0 1)) (-> self path-pos))) + (let ((v1-22 (-> self actor-group (+ (-> self actor-group-count) -1) data gp-0)) + (a1-23 (-> self actor-group (+ (-> self actor-group-count) -1) data (+ gp-0 1))) + ) + (when (and v1-22 a1-23) + (let ((s3-0 (-> v1-22 actor)) + (s4-0 (-> a1-23 actor)) + (s5-0 (new 'stack 'cubic-curve)) + ) + (new 'stack-no-clear 'vector) + (when (and s3-0 s4-0) + (let ((s2-0 s5-0) + (s1-0 (method-of-type cubic-curve cubic-curve-method-9)) + (s0-0 (-> s3-0 trans)) + ) + (set! sv-208 vector-normalize!) + (let* ((a0-26 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s3-0 quat))) + (a1-26 204800.0) + (s3-1 (sv-208 a0-26 a1-26)) + ) + (set! sv-224 (-> s4-0 trans)) + (set! sv-240 vector-normalize!) + (let* ((a0-28 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> s4-0 quat))) + (a1-28 204800.0) + (t0-0 (sv-240 a0-28 a1-28)) + ) + (s1-0 s2-0 s0-0 s3-1 sv-224 t0-0) + ) + ) + ) + (cubic-curve-method-10 s5-0 (-> self trans) (- (-> self path-pos) (the float gp-0))) + ) + ) + ) + ) + ) + ) + (send-event (handle->process (-> self trail-effect)) 'trans (-> self trans)) + (cond + ((-> self touched) + (+! (-> self path-pos) (* 2.0 (seconds-per-frame))) + ) + (else + (set-time! (-> self start-time)) + (when (< (vector-vector-distance (target-pos 0) (-> self trans)) 20480.0) + (set! (-> self touched) #t) + (if (handle->process (-> self freeze-time-hud)) + (send-event (handle->process (-> self freeze-time-hud)) 'force-show) + ) + (sound-play "start-pickup") + (send-event self 'start) + (set! (-> self time-limit) (the-as time-frame (the int (* 300.0 (-> self total-time))))) + (send-event (handle->process (-> self trail-effect)) 'active) + ) + (if (< 409600.0 (vector-vector-distance (target-pos 0) (-> self trans))) + (send-event self 'fail) + ) + ) + ) + ) + :code (behavior () + (until #f + (suspend) + ) + #f + ) + ) + +;; definition of type task-manager-bbush-timer-chase-2 +(deftype task-manager-bbush-timer-chase-2 (task-manager-bbush-timer-chase) + () + ) + +;; definition for method 3 of type task-manager-bbush-timer-chase-2 +(defmethod inspect ((this task-manager-bbush-timer-chase-2)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-bbush-timer-chase inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-bbush-timer-chase-2 +(defmethod get-entity-name ((this task-manager-bbush-timer-chase-2)) + "t-manager-9" + ) + +;; definition for method 34 of type task-manager-bbush-timer-chase-2 +(defmethod get-node-array ((this task-manager-bbush-timer-chase-2)) + *timer-chase-path-1* + ) + +;; definition of type task-manager-bbush-timer-chase-3 +(deftype task-manager-bbush-timer-chase-3 (task-manager-bbush-timer-chase) + () + ) + +;; definition for method 3 of type task-manager-bbush-timer-chase-3 +(defmethod inspect ((this task-manager-bbush-timer-chase-3)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (let ((t9-0 (method-of-type task-manager-bbush-timer-chase inspect))) + (t9-0 this) + ) + (label cfg-4) + this + ) + +;; definition for method 32 of type task-manager-bbush-timer-chase-3 +(defmethod get-entity-name ((this task-manager-bbush-timer-chase-3)) + "t-manager-11" + ) + +;; definition for method 33 of type task-manager-bbush-timer-chase-3 +;; WARN: Return type mismatch int vs none. +(defmethod set-sbanks ((this task-manager-bbush-timer-chase-3)) + (set-setting! 'city-sound '(citybb1) 0.0 2) + (set-setting! 'music 'ctytimer 0.0 0) + 0 + (none) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/bbush/timer-path_REF.gc b/test/decompiler/reference/jak3/levels/wascity/bbush/timer-path_REF.gc new file mode 100644 index 0000000000..24c45aab9b --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/bbush/timer-path_REF.gc @@ -0,0 +1,632 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type timer-chase-node +(deftype timer-chase-node (structure) + ((pos vector :inline) + (is-spawn? symbol) + ) + ) + +;; definition for method 3 of type timer-chase-node +(defmethod inspect ((this timer-chase-node)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'timer-chase-node) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tis-spawn?: ~A~%" (-> this is-spawn?)) + (label cfg-4) + this + ) + +;; definition for symbol *timer-chase-path-0*, type (array timer-chase-node) +(define *timer-chase-path-0* (new 'static 'boxed-array :type timer-chase-node + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11662866.0 :y 221034.5 :z 4081106.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11621823.0 :y 179699.72 :z 4237392.5 :w 1.0) + :is-spawn? #t + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11689940.0 :y 135861.05 :z 4420852.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11793282.0 :y 107726.85 :z 4585757.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11855254.0 :y 99959.6 :z 4681030.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11943933.0 :y 97535.59 :z 4734605.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12076113.0 :y 104384.1 :z 4851341.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12142958.0 :y 123763.09 :z 4950751.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12147382.0 :y 136815.83 :z 5067283.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12146604.0 :y 159249.2 :z 5145066.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12183426.0 :y 180995.69 :z 5215026.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12254655.0 :y 196199.62 :z 5272861.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12293773.0 :y 189432.62 :z 5314436.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12348617.0 :y 176897.64 :z 5358877.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12412761.0 :y 167104.92 :z 5400984.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12465477.0 :y 161542.55 :z 5465701.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12546824.0 :y 159456.45 :z 5498960.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12689732.0 :y 140263.02 :z 5554666.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12903298.0 :y 123974.04 :z 5641174.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12972070.0 :y 135716.05 :z 5688564.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13058250.0 :y 145242.94 :z 5748612.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13152867.0 :y 159722.7 :z 5775522.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13203822.0 :y 174543.67 :z 5817916.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13260878.0 :y 195249.36 :z 5861293.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13314946.0 :y 210316.5 :z 5885541.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13373233.0 :y 217735.98 :z 5943704.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13451548.0 :y 216344.58 :z 6013952.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13530069.0 :y 214853.22 :z 6049544.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13562960.0 :y 215314.44 :z 6071213.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13625792.0 :y 212812.6 :z 6103693.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13850744.0 :y 166247.62 :z 6141952.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14093310.0 :y 136698.27 :z 6154853.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14336366.0 :y 88510.875 :z 6271466.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14436309.0 :y 78679.66 :z 6702815.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14454700.0 :y 93333.914 :z 6825819.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14475752.0 :y 84293.63 :z 7018044.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14500042.0 :y 93302.375 :z 7144528.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14537480.0 :y 53508.504 :z 7338678.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14634554.0 :y 76670.56 :z 7735499.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14679488.0 :y 107677.695 :z 7989124.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14732121.0 :y 133817.95 :z 8211536.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14755674.0 :y 151914.5 :z 8290425.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14780946.0 :y 166041.19 :z 8354282.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14814164.0 :y 176115.72 :z 8404867.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14825796.0 :y 187811.44 :z 8480274.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14833539.0 :y 198363.95 :z 8553265.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14862006.0 :y 211248.33 :z 8626010.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14873351.0 :y 234013.08 :z 8708708.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14891824.0 :y 263639.44 :z 8799844.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14902064.0 :y 281009.78 :z 8866404.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14931146.0 :y 291222.3 :z 8915433.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 15000983.0 :y 292676.4 :z 9001941.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 15092365.0 :y 268016.44 :z 9085458.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 15121978.0 :y 201281.12 :z 9407608.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14825509.0 :y 173629.44 :z 9635592.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14484436.0 :y 217798.25 :z 9952745.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14411650.0 :y 154336.88 :z 10427799.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14292211.0 :y 150299.44 :z 10556249.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14224954.0 :y 144734.2 :z 10602289.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 14041004.0 :y 123476.79 :z 10684454.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13806302.0 :y 111191.66 :z 10796971.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13717215.0 :y 134289.0 :z 10767071.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13600561.0 :y 147339.67 :z 10717918.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13400347.0 :y 142908.62 :z 10718082.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 13205583.0 :y 118439.12 :z 10817779.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12929184.0 :y 92757.195 :z 10957534.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12691903.0 :y 97937.0 :z 11117442.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12407109.0 :y 101740.55 :z 11141773.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 12103472.0 :y 100392.96 :z 11221439.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11971909.0 :y 102868.17 :z 11217998.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11832891.0 :y 91679.54 :z 11195634.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11742042.0 :y 94658.56 :z 11258591.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11696862.0 :y 102268.11 :z 11372950.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11579963.0 :y 119266.1 :z 11690472.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11407398.0 :y 93837.31 :z 11992348.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11290170.0 :y 133498.06 :z 12324902.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11377128.0 :y 156357.02 :z 12513809.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11404654.0 :y 172135.62 :z 12633782.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11402442.0 :y 184381.84 :z 12769768.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11380487.0 :y 188515.94 :z 12890847.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11305490.0 :y 186036.64 :z 13021058.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11237210.0 :y 175171.58 :z 13141440.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 11165202.0 :y 156057.19 :z 13254571.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10993866.0 :y 123564.85 :z 13377943.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10821752.0 :y 113522.69 :z 13547520.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10723734.0 :y 101874.07 :z 13768947.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10618303.0 :y 88096.36 :z 13900346.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10603886.0 :y 88534.22 :z 14080242.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10628707.0 :y 105060.35 :z 14243550.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10679498.0 :y 112945.15 :z 14354348.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10737375.0 :y 112455.27 :z 14461826.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 10778293.0 :y 108901.58 :z 14529943.0 :w 1.0) + :is-spawn? #f + ) + ) + ) + +;; definition for symbol *timer-chase-path-1*, type (array timer-chase-node) +(define *timer-chase-path-1* (new 'static 'boxed-array :type timer-chase-node + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9191299.0 :y 103415.805 :z 254029.83 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9221978.0 :y 91179.414 :z 224322.36 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9224353.0 :y 84404.63 :z 180507.44 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9202604.0 :y 77736.76 :z 131431.62 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9187817.0 :y 60112.895 :z 51052.133 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9167992.0 :y 44095.49 :z -60146.895 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9165248.0 :y 32416.154 :z -225542.14 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9206167.0 :y 30528.307 :z -294044.88 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9195395.0 :y 30397.645 :z -379459.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9161728.0 :y 31997.543 :z -467340.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9094961.0 :y 41626.008 :z -530640.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9067477.0 :y 38292.273 :z -598134.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9041303.0 :y 36459.316 :z -659652.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9031268.0 :y 35156.79 :z -723029.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9045932.0 :y 36037.02 :z -790945.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 9030490.0 :y 51421.184 :z -855944.8 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8968886.0 :y 67532.39 :z -898604.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8928172.0 :y 77001.93 :z -908590.7 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8817252.0 :y 90379.47 :z -955645.56 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8716081.0 :y 109561.04 :z -1041792.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8663040.0 :y 114063.77 :z -1116819.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8614582.0 :y 113920.82 :z -1228095.1 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8520456.0 :y 114579.87 :z -1336909.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8401590.0 :y 130158.59 :z -1428471.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8293989.0 :y 145850.38 :z -1459523.1 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8195931.0 :y 154208.67 :z -1437929.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8165743.5 :y 153191.22 :z -1375674.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8123677.5 :y 154375.38 :z -1284136.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8117288.0 :y 152758.27 :z -1240698.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 8049416.5 :y 141521.31 :z -1116901.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7989165.0 :y 135367.06 :z -1074011.8 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7871405.0 :y 127031.3 :z -1070362.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7798495.5 :y 125217.586 :z -1111867.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7722064.5 :y 121516.445 :z -1174691.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7653579.0 :y 118677.914 :z -1259282.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7596071.5 :y 114234.164 :z -1293344.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7499611.0 :y 118466.97 :z -1312587.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7437761.5 :y 124832.16 :z -1291738.8 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7393401.0 :y 131270.25 :z -1253359.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7289977.0 :y 146183.78 :z -1204772.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7238900.0 :y 147383.9 :z -1194675.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7146740.0 :y 136803.53 :z -1187081.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 7002684.0 :y 149120.61 :z -1160261.2 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6972210.0 :y 163582.77 :z -1148182.1 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6938909.5 :y 170448.08 :z -1137737.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6896557.0 :y 169711.61 :z -1123724.9 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6839499.0 :y 158490.62 :z -1119690.4 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6732962.0 :y 142339.28 :z -1126231.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6666893.5 :y 143119.97 :z -1122746.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6595419.0 :y 151475.4 :z -1109647.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6467951.5 :y 153472.61 :z -1085357.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6399548.0 :y 154023.11 :z -1079910.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6343228.0 :y 162228.64 :z -1066917.5 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6283016.5 :y 174840.62 :z -1052802.6 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6199172.0 :y 196677.22 :z -1045180.0 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6166936.5 :y 209845.86 :z -1048538.75 :w 1.0) + :is-spawn? #f + ) + (new 'static 'timer-chase-node + :pos (new 'static 'vector :x 6127656.0 :y 213454.44 :z -1059573.4 :w 1.0) + :is-spawn? #f + ) + ) + ) + + + + diff --git a/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc b/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc new file mode 100644 index 0000000000..067561dbb3 --- /dev/null +++ b/test/decompiler/reference/jak3/levels/wascity/mission-squad-control-h_REF.gc @@ -0,0 +1,223 @@ +;;-*-Lisp-*- +(in-package goal) + +;; definition of type city-attacker-info +(deftype city-attacker-info (structure) + ((proc handle) + (enemy handle) + (next-update-target-time time-frame) + (flags city-attacker-info-flag) + (num-current-attackers uint8) + (max-num-attackers uint8) + (self-type int16) + (enemy-type int16) + (self-index int16) + (enemy-index int16) + (callback function) + (hatred-map-callback function) + ) + (:methods + (city-attacker-info-method-9 () none) + (city-attacker-info-method-10 () none) + ) + ) + +;; definition for method 3 of type city-attacker-info +(defmethod inspect ((this city-attacker-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-attacker-info) + (format #t "~1Tproc: ~D~%" (-> this proc)) + (format #t "~1Tenemy: ~D~%" (-> this enemy)) + (format #t "~1Tnext-update-target-time: ~D~%" (-> this next-update-target-time)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tnum-current-attackers: ~D~%" (-> this num-current-attackers)) + (format #t "~1Tmax-num-attackers: ~D~%" (-> this max-num-attackers)) + (format #t "~1Tself-type: ~D~%" (-> this self-type)) + (format #t "~1Tenemy-type: ~D~%" (-> this enemy-type)) + (format #t "~1Tself-index: ~D~%" (-> this self-index)) + (format #t "~1Tenemy-index: ~D~%" (-> this enemy-index)) + (format #t "~1Tcallback: ~A~%" (-> this callback)) + (format #t "~1Thatred-map-callback: ~A~%" (-> this hatred-map-callback)) + (label cfg-4) + this + ) + +;; definition of type city-attacker-cache +(deftype city-attacker-cache (structure) + ((pos vector) + (proc basic) + (attackable? symbol) + ) + ) + +;; definition for method 3 of type city-attacker-cache +(defmethod inspect ((this city-attacker-cache)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-attacker-cache) + (format #t "~1Tpos: #~%" (-> this pos)) + (format #t "~1Tproc: ~A~%" (-> this proc)) + (format #t "~1Tattackable?: ~A~%" (-> this attackable?)) + (label cfg-4) + this + ) + +;; definition of type city-hatred-info +(deftype city-hatred-info (structure) + ((hatred float) + (max-consider-dist float) + (hatred-dist float) + (dist-scale float) + (attacker-scale float) + (flags city-hatred-info-flag) + (index uint8) + (pad uint8) + ) + ) + +;; definition for method 3 of type city-hatred-info +(defmethod inspect ((this city-hatred-info)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this 'city-hatred-info) + (format #t "~1Thatred: ~f~%" (-> this hatred)) + (format #t "~1Tmax-consider-dist: ~f~%" (-> this max-consider-dist)) + (format #t "~1Thatred-dist: ~f~%" (-> this hatred-dist)) + (format #t "~1Tdist-scale: ~f~%" (-> this dist-scale)) + (format #t "~1Tattacker-scale: ~f~%" (-> this attacker-scale)) + (format #t "~1Tflags: ~D~%" (-> this flags)) + (format #t "~1Tindex: ~D~%" (-> this index)) + (format #t "~1Tpad: ~D~%" (-> this pad)) + (label cfg-4) + this + ) + +;; definition of type city-attacker-array +(deftype city-attacker-array (inline-array-class) + ((data city-attacker-info :inline :dynamic) + ) + ) + +;; definition for method 3 of type city-attacker-array +(defmethod inspect ((this city-attacker-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! (-> city-attacker-array heap-base) (the-as uint 48)) + +;; definition of type city-hatred-array +(deftype city-hatred-array (inline-array-class) + ((data city-hatred-info :inline :dynamic) + ) + ) + +;; definition for method 3 of type city-hatred-array +(defmethod inspect ((this city-hatred-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! (-> city-hatred-array heap-base) (the-as uint 24)) + +;; definition of type city-attacker-cache-array +(deftype city-attacker-cache-array (inline-array-class) + ((data city-attacker-cache :inline :dynamic) + ) + ) + +;; definition for method 3 of type city-attacker-cache-array +(defmethod inspect ((this city-attacker-cache-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! (-> city-attacker-cache-array heap-base) (the-as uint 12)) + +;; definition of type mission-squad-control +(deftype mission-squad-control (basic) + ((attackers city-attacker-array) + (unused-list basic) + (hatred-vals basic) + (hatred-indices basic) + (attacker-cache city-attacker-cache-array) + (target-attacker city-attacker-info) + (max-num-object-types int32) + ) + (:methods + (mission-squad-control-method-9 () none) + (mission-squad-control-method-10 () none) + (mission-squad-control-method-11 () none) + (mission-squad-control-method-12 () none) + (mission-squad-control-method-13 () none) + (mission-squad-control-method-14 () none) + (mission-squad-control-method-15 () none) + (mission-squad-control-method-16 () none) + (mission-squad-control-method-17 () none) + (mission-squad-control-method-18 () none) + (mission-squad-control-method-19 () none) + (mission-squad-control-method-20 () none) + (mission-squad-control-method-21 () none) + (mission-squad-control-method-22 () none) + (mission-squad-control-method-23 () none) + ) + ) + +;; definition for method 3 of type mission-squad-control +(defmethod inspect ((this mission-squad-control)) + (when (not this) + (set! this this) + (goto cfg-4) + ) + (format #t "[~8x] ~A~%" this (-> this type)) + (format #t "~1Tattackers: ~A~%" (-> this attackers)) + (format #t "~1Tunused-list: ~A~%" (-> this unused-list)) + (format #t "~1Thatred-vals: ~A~%" (-> this hatred-vals)) + (format #t "~1Thatred-indices: ~A~%" (-> this hatred-indices)) + (format #t "~1Tattacker-cache: ~A~%" (-> this attacker-cache)) + (format #t "~1Ttarget-attacker: #~%" (-> this target-attacker)) + (format #t "~1Tmax-num-object-types: ~D~%" (-> this max-num-object-types)) + (label cfg-4) + this + ) + +;; 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 3e6cbe7d15..5f3b2e4da4 100644 --- a/test/offline/config/jak3/config.jsonc +++ b/test/offline/config/jak3/config.jsonc @@ -57,7 +57,37 @@ "DGO/DESW.DGO", "DGO/DESBOSS1.DGO", "DGO/DESBOSS2.DGO", - "DGO/MINEE.DGO" + "DGO/MINEE.DGO", + "DGO/LBBRING1.DGO", + "DGO/LBBRING2.DGO", + "DGO/LBBRING3.DGO", + "DGO/LBBRING4.DGO", + "DGO/LBBRING5.DGO", + "DGO/LBBRING6.DGO", + "DGO/LBBSDRP1.DGO", + "DGO/LBBSDRP2.DGO", + "DGO/LBBSDRP3.DGO", + "DGO/LBBSPID.DGO", + "DGO/LBBSPIRT.DGO", + "DGO/LBBSPRT2.DGO", + "DGO/LBBSPRT3.DGO", + "DGO/LBBTCHA1.DGO", + "DGO/LBBTCHA2.DGO", + "DGO/LBBTCHA3.DGO", + "DGO/LWASBBV.DGO", + "DGO/LNSTOBB.DGO", + "DGO/FACC.DGO", + "DGO/FACD.DGO", + "DGO/FACTORYA.DGO", + "DGO/LFACRM1.DGO", + "DGO/LFACRM2.DGO", + "DGO/DESOASIS.DGO", + "DGO/LCTYDEST.DGO", + "DGO/COMBX.DGO", + "DGO/COMBA.DGO", + "DGO/LFACTORY.DGO", + "DGO/RAILX.DGO", + "DGO/FACB.DGO" ], "skip_compile_files": [ @@ -277,7 +307,19 @@ "check-normals", // wasdef-manager "(method 30 task-manager-wascity-defend)", - "maker-init-by-other" + "maker-init-by-other", + // des-bush + "(method 12 desert-chase-ring)", + // factoryc-obs + "(method 27 fac-robopod)", + // sew-laser-turret + "check-enemy", + // oasis-defense + "(method 34 task-manager-desert-oasis-defense)", // register allocator failure + // fac-robotank-turret + "draw-2d-hud", + // fac-robotank + "(method 7 fac-robotank)" ], "skip_compile_states": {